Struct minicbor::Decoder [−][src]
pub struct Decoder<'b> { /* fields omitted */ }
Expand description
A non-allocating CBOR decoder.
Implementations
Decode any type that implements Decode
.
Set the current decode position.
Get a decoding probe to look ahead what is coming next.
This will not affect the decoding state of self
and after the
returned Probe
has been dropped, decoding can continue from
its current position as if probe
was never called.
Decode a half float (f16
) and return it in an f32
.
Only available when the feature half
is present.
Decode a byte slice.
This only decodes byte slices of definite lengths.
See Decoder::bytes_iter
for indefinite byte slice support.
Iterate over byte slices.
This supports indefinite byte slices by returing a byte slice on each iterator step. If a single definite slice is decoded the iterator will only yield one item.
Decode a string slice.
This only decodes string slices of definite lengths.
See Decoder::str_iter
for indefinite string slice support.
Iterate over string slices.
This supports indefinite string slices by returing a string slice on each iterator step. If a single definite slice is decoded the iterator will only yield one item.
Begin decoding an array.
CBOR arrays are heterogenous collections and may be of indefinite
length. If the length is known it is returned as a Some
, for
indefinite arrays a None
is returned.
Iterate over all array elements.
This supports indefinite and definite length arrays and uses the
Decode
trait to decode each element. Consequently only
homogenous arrays are supported by this method.
Begin decoding a map.
CBOR maps are heterogenous collections (both in keys and in values)
and may be of indefinite length. If the length is known it is returned
as a Some
, for indefinite maps a None
is returned.
Iterate over all map entries.
This supports indefinite and definite length maps and uses the
Decode
trait to decode each key and value. Consequently only
homogenous maps are supported by this method.
Trait Implementations
Auto Trait Implementations
impl<'b> RefUnwindSafe for Decoder<'b>
impl<'b> UnwindSafe for Decoder<'b>
Blanket Implementations
Mutably borrows from an owned value. Read more