[][src]Enum moz_cbor::CborType

pub enum CborType {
    Integer(u64),
    SignedInteger(i64),
    Tag(u64Box<CborType>),
    Bytes(Vec<u8>),
    String(String),
    Array(Vec<CborType>),
    Map(BTreeMap<CborType, CborType>),
    Null,
}

Variants

Integer(u64)
SignedInteger(i64)
Tag(u64Box<CborType>)
Bytes(Vec<u8>)
String(String)
Array(Vec<CborType>)
Null

Implementations

impl CborType[src]

pub fn serialize(&self) -> Vec<u8>[src]

Serialize a Cbor object. NB: if the object to be serialized consists of too many nested Cbor objects (for example, Array(Array(Array(...(Array(0))))), it is possible that calling serialize will exhaust the stack. It is considered the caller's responsibility to prevent this.

Trait Implementations

impl Clone for CborType[src]

impl Debug for CborType[src]

impl Eq for CborType[src]

impl Ord for CborType[src]

pub fn cmp(&self, other: &Self) -> Ordering[src]

Sorting for maps: RFC 7049 Section 3.9

The keys in every map must be sorted lowest value to highest.

  • If two keys have different lengths, the shorter one sorts earlier;

  • If two keys have the same length, the one with the lower value in (byte-wise) lexical order sorts earlier.

impl PartialEq<CborType> for CborType[src]

impl PartialOrd<CborType> for CborType[src]

impl StructuralEq for CborType[src]

impl StructuralPartialEq for CborType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.