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<T, S> Deletable for StateBox<T, S>where
T: Serial + DeserialWithState<S> + Deletable,
S: HasStateApi,
impl<T, S> Deletable for StateBox<T, S>where
T: Serial + DeserialWithState<S> + Deletable,
S: HasStateApi,
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>where
S: HasStateApi,
T: Serial + DeserialWithState<S>,
impl<T, S> DeserialWithState<S> for StateBox<T, S>where
S: HasStateApi,
T: Serial + DeserialWithState<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.
source§impl<T: DeserialWithState<S> + Serial, S: HasStateApi> StateClone<S> for StateBox<T, S>
impl<T: DeserialWithState<S> + Serial, S: HasStateApi> StateClone<S> for StateBox<T, S>
source§unsafe fn clone_state(&self, cloned_state_api: &S) -> Self
unsafe fn clone_state(&self, cloned_state_api: &S) -> Self
Make a clone of the type while using the
cloned_state_api
. Read more