Skip to main content

EncodeAsMap

Trait EncodeAsMap 

Source
pub trait EncodeAsMap: Encode {
    // Provided methods
    fn into_cbor_value_map(self) -> Value
       where Self: Sized { ... }
    fn into_cbor_map(self) -> Vec<(Value, Value)>
       where Self: Sized { ... }
}
Expand description

Trait for types that always encode as CBOR maps.

Provided Methods§

Source

fn into_cbor_value_map(self) -> Value
where Self: Sized,

Encode the type into a CBOR Map.

Source

fn into_cbor_map(self) -> Vec<(Value, Value)>
where Self: Sized,

Encode the type into a CBOR Map, returning the map items.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K: Encode, V: Encode> EncodeAsMap for BTreeMap<K, V>

Source§

impl<K: Encode, V: Encode> EncodeAsMap for HashMap<K, V>

Implementors§