pub trait TypedRead: Sized {
    type TupleReader<'parent>: ReadTuple
       where Self: 'parent;
    type StructReader<'parent>: ReadStruct
       where Self: 'parent;
    type UnionReader: ReadUnion;

    // Required methods
    fn read_union<T: StrictUnion>(
        &mut self,
        inner: impl FnOnce(FieldName, &mut Self::UnionReader) -> Result<T, DecodeError>
    ) -> Result<T, DecodeError>;
    fn read_enum<T: StrictEnum>(&mut self) -> Result<T, DecodeError>
       where u8: From<T>;
    fn read_tuple<'parent, 'me, T: StrictTuple>(
        &'me mut self,
        inner: impl FnOnce(&mut Self::TupleReader<'parent>) -> Result<T, DecodeError>
    ) -> Result<T, DecodeError>
       where Self: 'parent,
             'me: 'parent;
    fn read_struct<'parent, 'me, T: StrictStruct>(
        &'me mut self,
        inner: impl FnOnce(&mut Self::StructReader<'parent>) -> Result<T, DecodeError>
    ) -> Result<T, DecodeError>
       where Self: 'parent,
             'me: 'parent;

    // Provided method
    fn read_newtype<T: StrictTuple + Wrapper>(
        &mut self
    ) -> Result<T, DecodeError>
       where T::Inner: StrictDecode { ... }
}

Required Associated Types§

source

type TupleReader<'parent>: ReadTuple where Self: 'parent

source

type StructReader<'parent>: ReadStruct where Self: 'parent

source

type UnionReader: ReadUnion

Required Methods§

source

fn read_union<T: StrictUnion>( &mut self, inner: impl FnOnce(FieldName, &mut Self::UnionReader) -> Result<T, DecodeError> ) -> Result<T, DecodeError>

source

fn read_enum<T: StrictEnum>(&mut self) -> Result<T, DecodeError>
where u8: From<T>,

source

fn read_tuple<'parent, 'me, T: StrictTuple>( &'me mut self, inner: impl FnOnce(&mut Self::TupleReader<'parent>) -> Result<T, DecodeError> ) -> Result<T, DecodeError>
where Self: 'parent, 'me: 'parent,

source

fn read_struct<'parent, 'me, T: StrictStruct>( &'me mut self, inner: impl FnOnce(&mut Self::StructReader<'parent>) -> Result<T, DecodeError> ) -> Result<T, DecodeError>
where Self: 'parent, 'me: 'parent,

Provided Methods§

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<R: Read> TypedRead for StrictReader<R>

§

type TupleReader<'parent> = TupleReader<'parent, R> where Self: 'parent

§

type StructReader<'parent> = StructReader<'parent, R> where Self: 'parent

§

type UnionReader = StrictReader<R>