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,
pub fn new() -> ManagedMapEncoded<M, K, V>
Trait Implementations§
Source§impl<M, K, V> Default for ManagedMapEncoded<M, K, V>
impl<M, K, V> Default for ManagedMapEncoded<M, K, V>
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
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more