pub struct Probe<'a, 'b> { /* private fields */ }
Expand description

A decoding probe to to look ahead what comes next.

A Probe derefs to Decoder and thus can be used like one without affecting the decoder from which it was created.

Methods from Deref<Target = Decoder<'b>>

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

Inspect the CBOR type at the current position.

Skip over the current CBOR value.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.