pub trait DeserialWithState<S>: Sized
where S: HasStateApi,
{ // Required method 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§

source

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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.

source§

impl<K, V, S> DeserialWithState<S> for StateMap<K, V, S>
where S: HasStateApi,

source§

impl<T, S> DeserialWithState<S> for StateBox<T, S>

source§

impl<T, S> DeserialWithState<S> for StateSet<T, S>

source§

impl<const M: usize, K> DeserialWithState<ExternStateApi> for StateBTreeSet<K, M>

source§

impl<const M: usize, K, V> DeserialWithState<ExternStateApi> for StateBTreeMap<K, V, M>