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§
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 Methods§
fn read_newtype<T: StrictSum + From<I>, I: StrictDecode>( &mut self, ) -> Result<T, DecodeError>
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.