Struct cbor_data::DictWriter[][src]

pub struct DictWriter<'a>(_);
Expand description

Builder for a dict value, used by write_dict_rec().

see trait Encoder for usage examples

Implementations

Configure the limit above which indefinite size encoding will be used.

The default is 255, which is the largest size up to which definite size is at least as compact as indefinite size. Set to 23 to avoid moving bytes around when finishing the array. Set to None to always use indefinite size encoding.

Add one key–value pair to the dict.

let cbor = CborBuilder::new().encode_dict(|builder| {
    builder.with_key("the answer", |b| b.encode_u64(42));
});

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