Struct plutus_ledger_api::v1::assoc_map::AssocMap
source · pub struct AssocMap<K, V>(pub Vec<(K, V)>);
Tuple Fields§
§0: Vec<(K, V)>
Implementations§
source§impl<K, V> AssocMap<K, V>
impl<K, V> AssocMap<K, V>
pub fn new() -> Self
sourcepub fn insert(&mut self, key: K, value: V) -> Option<V>where
K: PartialEq,
pub fn insert(&mut self, key: K, value: V) -> Option<V>where
K: PartialEq,
Inserts a key-value pair into the map.
If the map did not have this key present, None is returned.
If the map did have this key present, the value is updated, and the old value is returned. The key is not updated, though; this matters for types that can be == without being identical. See the module-level documentation for more.
Trait Implementations§
source§impl<K: Hash + Eq, V> From<LinkedHashMap<K, V>> for AssocMap<K, V>
impl<K: Hash + Eq, V> From<LinkedHashMap<K, V>> for AssocMap<K, V>
source§fn from(value: LinkedHashMap<K, V>) -> Self
fn from(value: LinkedHashMap<K, V>) -> Self
Converts to this type from the input type.
source§impl<K: IsPlutusData, V: IsPlutusData> IsPlutusData for AssocMap<K, V>
impl<K: IsPlutusData, V: IsPlutusData> IsPlutusData for AssocMap<K, V>
fn to_plutus_data(&self) -> PlutusData
fn from_plutus_data(plutus_data: &PlutusData) -> Result<Self, PlutusDataError>
impl<K: Eq, V: Eq> Eq for AssocMap<K, V>
impl<K, V> StructuralPartialEq for AssocMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for AssocMap<K, V>
impl<K, V> RefUnwindSafe for AssocMap<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for AssocMap<K, V>
impl<K, V> Sync for AssocMap<K, V>
impl<K, V> Unpin for AssocMap<K, V>
impl<K, V> UnwindSafe for AssocMap<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)