Struct minicbor::Decoder[][src]

pub struct Decoder<'b> { /* fields omitted */ }
Expand description

A non-allocating CBOR decoder.

Implementations

Construct a Decoder for the given byte slice.

Decode any type that implements Decode.

Get the current decode position.

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 bool value.

Decode a u8 value.

Decode a u16 value.

Decode a u32 value.

Decode a u64 value.

Decode an i8 value.

Decode an i16 value.

Decode an i32 value.

Decode an i64 value.

Decode a half float (f16) and return it in an f32.

Only available when the feature half is present.

Decode an f32 value.

Decode an f64 value.

Decode a char value.

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.

Decode a CBOR tag.

Decode a CBOR null value.

Decode a CBOR undefined value.

Decode a CBOR simple value.

Inspect the CBOR type at the current position.

Skip over the current CBOR value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.