pub struct OccupiedEntry<'a, K, V: Serial, S: HasStateApi> { /* private fields */ }Expand description
A view into an occupied entry in a StateMap. It can be obtained via the
StateMap::entry method. This allows looking up or modifying the value at
a give key in-place.
The type implements DerefMut which allows the
value to be mutated. The Drop implementation ensures
that the value is properly stored in the contract state maintained by the
node.
This differs from OccupiedEntryRaw in that this automatically handles
serialization and provides convenience methods for modifying the value via
the DerefMut implementation.
Implementations§
Source§impl<'a, K, V, StateApi> OccupiedEntry<'a, K, V, StateApi>
impl<'a, K, V, StateApi> OccupiedEntry<'a, K, V, StateApi>
Trait Implementations§
Source§impl<'a, K, V: Serial, S: HasStateApi> Deref for OccupiedEntry<'a, K, V, S>
impl<'a, K, V: Serial, S: HasStateApi> Deref for OccupiedEntry<'a, K, V, S>
Source§impl<'a, K, V: Serial, S: HasStateApi> DerefMut for OccupiedEntry<'a, K, V, S>
impl<'a, K, V: Serial, S: HasStateApi> DerefMut for OccupiedEntry<'a, K, V, S>
Source§impl<'a, K, V: Serial, S: HasStateApi> Drop for OccupiedEntry<'a, K, V, S>
impl<'a, K, V: Serial, S: HasStateApi> Drop for OccupiedEntry<'a, K, V, S>
Auto Trait Implementations§
impl<'a, K, V, S> Freeze for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> RefUnwindSafe for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> Send for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> Sync for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> Unpin for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> !UnwindSafe for OccupiedEntry<'a, K, V, S>
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