Enum cbor_tools::CborType[][src]

pub enum CborType {
    Null,
    Undefined,
    Bool(bool),
    Integer(Integer),
    ByteString(ByteString),
    TextString(TextString),
    Array(Array),
    Map(Map),
    Indefinite(Indefinite),
    Tagged(Tagged),
    Float(Float),
}
Expand description

A CBOR value.

This enum can represent any CBOR value; see the documentation of each variant for more details.

Many variants can be constructed directly using from(). For example,

let i = 42;
let x = CborType::from(i);

produces the same value as

let i = 42;
let x = CborType::Integer(Integer::from(i));

Variants

Null

Undefined

Bool(bool)

Tuple Fields

0: bool

Integer(Integer)

Tuple Fields

ByteString(ByteString)

Tuple Fields

TextString(TextString)

Tuple Fields

Array(Array)

Tuple Fields

0: Array

Map(Map)

Tuple Fields

0: Map

Indefinite(Indefinite)

Tuple Fields

Tagged(Tagged)

Tuple Fields

0: Tagged

Float(Float)

Tuple Fields

0: Float

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

Encode data to bytes.

Encode data to format::Element symbols representing a CBOR encoding.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.