pub struct ManagedMapEncoded<M, K, V>where
M: ManagedTypeApi,{ /* private fields */ }
Expand description
A managed map that works with any serializable key and value types.
It encodes both when saving, and decodes the value when getting.
§Empty encodings
Just like the base ManagedMap, it makes no difference between a missing key and a key with a corresponding empty encoded value.
So, for instance, here contains
returns false, because 0
is encoded as an empty buffer:
mme.put(&key, &0);
assert!(!mme.contains(&key));
Implementations§
Source§impl<M, K, V> ManagedMapEncoded<M, K, V>where
M: ManagedTypeApi,
impl<M, K, V> ManagedMapEncoded<M, K, V>where
M: ManagedTypeApi,
Trait Implementations§
Source§impl<M, K: Default, V: Default> Default for ManagedMapEncoded<M, K, V>where
M: ManagedTypeApi + Default,
impl<M, K: Default, V: Default> Default for ManagedMapEncoded<M, K, V>where
M: ManagedTypeApi + Default,
Source§fn default() -> ManagedMapEncoded<M, K, V>
fn default() -> ManagedMapEncoded<M, K, V>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<M, K, V> Freeze for ManagedMapEncoded<M, K, V>
impl<M, K, V> RefUnwindSafe for ManagedMapEncoded<M, K, V>
impl<M, K, V> Send for ManagedMapEncoded<M, K, V>
impl<M, K, V> Sync for ManagedMapEncoded<M, K, V>
impl<M, K, V> Unpin for ManagedMapEncoded<M, K, V>
impl<M, K, V> UnwindSafe for ManagedMapEncoded<M, K, V>
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