Struct concordium_std::StateBox
source · pub struct StateBox<T: Serial, S: HasStateApi> { /* private fields */ }
Expand description
A pointer type for data in the state.
The actual data is lazily loaded and thereafter cached in memory.
Due to its laziness, a StateBox
can be used to defer loading of data in
your state. This is useful when part of your state isn’t used in every
receive method.
The type parameter T
is the type stored in the box. The type parameter S
is the state.
Implementations§
Trait Implementations§
source§impl<S: HasStateApi, T: Serial + DeserialWithState<S>> Deref for StateBox<T, S>
impl<S: HasStateApi, T: Serial + DeserialWithState<S>> Deref for StateBox<T, S>
source§impl<S: HasStateApi, T: Serial + DeserialWithState<S>> DerefMut for StateBox<T, S>
impl<S: HasStateApi, T: Serial + DeserialWithState<S>> DerefMut for StateBox<T, S>
source§impl<T, S> DeserialWithState<S> for StateBox<T, S>
impl<T, S> DeserialWithState<S> for StateBox<T, S>
source§fn deserial_with_state<R: Read>(state: &S, source: &mut R) -> ParseResult<Self>
fn deserial_with_state<R: Read>(state: &S, source: &mut R) -> ParseResult<Self>
Attempt to read a structure from a given source and state, failing if
an error occurs during deserialization or reading.
Auto Trait Implementations§
impl<T, S> !Freeze for StateBox<T, S>
impl<T, S> !RefUnwindSafe for StateBox<T, S>
impl<T, S> Send for StateBox<T, S>
impl<T, S> !Sync for StateBox<T, S>
impl<T, S> Unpin for StateBox<T, S>
impl<T, S> UnwindSafe for StateBox<T, 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