pub trait DeserialWithState<S>: Sizedwhere
    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.

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>where S: HasStateApi, T: Serial + DeserialWithState<S>,

source§

impl<T, S> DeserialWithState<S> for StateSet<T, S>where S: HasStateApi, T: Serial + DeserialWithState<S>,