Trait concordium_std::DeserialWithState
source · [−]pub trait DeserialWithState<S>: Sized where
S: HasStateApi, {
fn deserial_with_state<R: Read>(
state: &S,
source: &mut R
) -> ParseResult<Self>;
}
Expand description
The DeserialWithState
trait provides a means of reading structures from
byte-sources (Read
) for types that also need a reference to a
HasStateApi
type.
Types that need a reference to the state include
StateBox
, StateMap
,
StateSet
, and structs or enums that contain one of
these types.
Required Methods
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.
Implementors
impl<D: Deserial, S: HasStateApi> DeserialWithState<S> for D
Blanket implementation of DeserialWithState for any Deserial types, which simply does not use the state argument.