pub trait TreeDecode<'b, C>: Sized {
type Builder;
// Required methods
fn begin(
d: &mut Decoder<'b>,
ctx: &mut C,
) -> Result<(Self::Builder, Arity), Error>;
fn child(builder: &mut Self::Builder, child: Self) -> Result<(), Error>;
fn end(
builder: Self::Builder,
d: &mut Decoder<'b>,
ctx: &mut C,
) -> Result<Self, Error>;
}Expand description
A recursive type whose nodes can be decoded without recursion.
The driver never reserves memory from a CBOR length header; builders grow only as children are actually decoded from the input.
Required Associated Types§
Required Methods§
Sourcefn begin(
d: &mut Decoder<'b>,
ctx: &mut C,
) -> Result<(Self::Builder, Arity), Error>
fn begin( d: &mut Decoder<'b>, ctx: &mut C, ) -> Result<(Self::Builder, Arity), Error>
Decode a node’s header: everything up to and including the header of its child list.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".