Enum cbor::Cbor [−][src]
pub enum Cbor { Break, Undefined, Null, Bool(bool), Unsigned(CborUnsigned), Signed(CborSigned), Float(CborFloat), Bytes(CborBytes), Unicode(String), Array(Vec<Cbor>), Map(HashMap<String, Cbor>), Tag(CborTag), }
CBOR abstract syntax.
This type can represent any data item described in the CBOR specification with some restrictions. Namely, CBOR maps are limited to Unicode string keys.
Note that this representation distinguishes the size of an encoded number.
Variants
Break
A code used to signify the end of an indefinite length data item.
Undefined
An undefined data item (major type 7, value 23).
Null
A null data item (major type 7, value 22).
Bool(bool)
A boolean data item (major type 7, values 20 or 21).
Unsigned(CborUnsigned)
An unsigned integer (major type 0).
Signed(CborSigned)
A negative integer (major type 1).
Float(CborFloat)
An IEEE 754 floating point number (major type 7).
Bytes(CborBytes)
A byte string (major type 2).
Unicode(String)
A Unicode string (major type 3).
Array(Vec<Cbor>)
An array (major type 4).
Map(HashMap<String, Cbor>)
A map (major type 5).
Tag(CborTag)
A tag (major type 6).
Methods
impl Cbor
[src]
impl Cbor
pub fn decode<D: Decodable>(self) -> CborResult<D>
[src]
pub fn decode<D: Decodable>(self) -> CborResult<D>
Decode a single CBOR value.
pub fn tag(&self) -> Option<u64>
[src]
pub fn tag(&self) -> Option<u64>
If this is a CBOR tag, return the tag number.
Trait Implementations
impl ToJson for Cbor
[src]
impl ToJson for Cbor
impl Clone for Cbor
[src]
impl Clone for Cbor
fn clone(&self) -> Cbor
[src]
fn clone(&self) -> Cbor
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Cbor
[src]
impl Debug for Cbor
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Cbor
[src]
impl PartialEq for Cbor
fn eq(&self, other: &Cbor) -> bool
[src]
fn eq(&self, other: &Cbor) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Cbor) -> bool
[src]
fn ne(&self, other: &Cbor) -> bool
This method tests for !=
.
impl Encodable for Cbor
[src]
impl Encodable for Cbor