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

    // Required methods
    fn read_tuple<'parent, 'me, T: StrictSum>(
        &'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: StrictSum>(
        &'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: StrictSum + From<I>, I: StrictDecode>(
        &mut self
    ) -> Result<T, DecodeError> { ... }
}

Required Associated Types§

source

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

source

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

Required Methods§

source

fn read_tuple<'parent, 'me, T: StrictSum>( &'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: StrictSum>( &'me mut self, inner: impl FnOnce(&mut Self::StructReader<'parent>) -> Result<T, DecodeError> ) -> Result<T, DecodeError>
where Self: 'parent, 'me: 'parent,

Provided Methods§

source

fn read_newtype<T: StrictSum + From<I>, I: StrictDecode>( &mut self ) -> Result<T, DecodeError>

Object Safety§

This trait is not object safe.

Implementors§

source§

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

§

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

§

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