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