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
sourceimpl<T, S> StateBox<T, S> where
T: Serial + DeserialWithState<S>,
S: HasStateApi,
impl<T, S> StateBox<T, S> where
T: Serial + DeserialWithState<S>,
S: HasStateApi,
Trait Implementations
sourceimpl<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,
sourceimpl<S: HasStateApi, T: Serial + DeserialWithState<S>> Deref for StateBox<T, S>
impl<S: HasStateApi, T: Serial + DeserialWithState<S>> Deref for StateBox<T, S>
sourceimpl<S: HasStateApi, T: Serial + DeserialWithState<S>> DerefMut for StateBox<T, S>
impl<S: HasStateApi, T: Serial + DeserialWithState<S>> DerefMut for StateBox<T, S>
sourceimpl<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>,
sourcefn 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. Read more
sourceimpl<T: Serial, S: HasStateApi> Drop for StateBox<T, S>
impl<T: Serial, S: HasStateApi> Drop for StateBox<T, S>
sourceimpl<T: Serial, S: HasStateApi> Serial for StateBox<T, S>
impl<T: Serial, S: HasStateApi> Serial for StateBox<T, S>
sourceimpl<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>
sourceunsafe 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
Auto Trait Implementations
impl<T, S> !RefUnwindSafe for StateBox<T, S>
impl<T, S> Send for StateBox<T, S> where
S: Send,
T: Send,
<S as HasStateApi>::EntryType: Send,
impl<T, S> !Sync for StateBox<T, S>
impl<T, S> Unpin for StateBox<T, S> where
S: Unpin,
T: Unpin,
<S as HasStateApi>::EntryType: Unpin,
impl<T, S> UnwindSafe for StateBox<T, S> where
S: UnwindSafe,
T: UnwindSafe,
<S as HasStateApi>::EntryType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more