Struct cbor::decoder::Decoder [] [src]

pub struct Decoder<R> { /* fields omitted */ }

The actual decoder type definition

Methods

impl<R: ReadBytesExt> Decoder<R>
[src]

Decode a single byte string into the given buffer.

The provided buffer must be large enough to hold the entire byte string, otherwise an error is returned.

Please note that indefinite byte strings are not supported by this method (Consider using Decoder::bytes_iter() for this use-case).

Decode a single byte string.

Please note that indefinite byte strings are not supported by this method (Consider using Decoder::bytes_iter() for this use-case).

Decode an indefinite byte string.

Decode a single UTF-8 encoded String.

Please note that indefinite strings are not supported by this method (Consider using Decoder::text_iter() for this use-case).

Decode an indefinite string.

Decode a Tag. If no tag is found an UnexpectedType error is returned.

Decode the begin of an array. The length is returned unless it exceeds the configured maximum.

Please note that indefinite arrays are not supported by this method (Consider using Decoder::array_begin() for this use-case).

Decode the begin of an indefinite array. After this one can continue decoding items, but a Break value will be encountered at some unknown point.

(Consider using or_break around every decoding step within an indefinite array to handle this case).

Decode the begin of an object. The size (number of key-value pairs) is returned unless it exceeds the configured maximum.

Please note that indefinite objects are not supported by this method (Consider using Decoder::object_begin for this use-case).

Decode the begin of an indefinite object. After this one can continue decoding items, but a Break value will be encountered at some unknown point.

(Consider using or_break around every decoding step within an indefinite object to handle this case).

impl<R: ReadBytesExt + Skip> Decoder<R>
[src]

Skip over a single CBOR value.

Please note that this function does not validate the value hence it might not even be well-formed CBOR. Instead skip is an optimisation over GenericDecoder::value() and generally only determines as much information as necessary to safely skip a value without keeping all of it in memory.

impl<R: ReadBytesExt + ReadSlice> Decoder<R>
[src]

Decode a single UTF-8 encoded String and borrow it from underlying buffer instead of allocating.

Please note that indefinite strings are not supported by this method.

Decode a single byte string and borrow it from underlying buffer instead of allocating.

Please note that indefinite byte strings are not supported by this method.