pub trait TypedRead: Sized {
type TupleReader<'parent>: ReadTuple
where
Self: 'parent;
type StructReader<'parent>: ReadStruct
where
Self: 'parent;
type UnionReader: ReadUnion;
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;
fn read_newtype<T: StrictTuple + Wrapper>(
&mut self
) -> Result<T, DecodeError>
where
T::Inner: StrictDecode,
{ ... }
}