pub trait TypedRead {
type TupleReader<'parent>: ReadTuple
where Self: 'parent;
type StructReader<'parent>: ReadStruct
where Self: 'parent;
type UnionReader: ReadUnion;
type RawReader: ReadRaw;
// Required methods
fn read_union<T: StrictUnion>(
&mut self,
inner: impl FnOnce(VariantName, &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§
type TupleReader<'parent>: ReadTuple where Self: 'parent
type StructReader<'parent>: ReadStruct where Self: 'parent
type UnionReader: ReadUnion
type RawReader: ReadRaw
Required Methods§
fn read_union<T: StrictUnion>( &mut self, inner: impl FnOnce(VariantName, &mut Self::UnionReader) -> Result<T, DecodeError>, ) -> Result<T, DecodeError>
fn read_enum<T: StrictEnum>(&mut self) -> Result<T, DecodeError>
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 Methods§
fn read_newtype<T: StrictTuple + Wrapper>(&mut self) -> Result<T, DecodeError>where
T::Inner: StrictDecode,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.