[go: up one dir, main page]

Enum cbor::CborSigned [] [src]

pub enum CborSigned {
    Int8(i8),
    Int16(i16),
    Int32(i32),
    Int64(i64),
}

A negative integer (major type 1).

Note that while the number -255 can be encoded using two bytes as a CBOR uint8, it is outside the range of numbers allowed in i8. Therefore, when CBOR data is decoded, -225 is stored as in i16 in memory.

Variants

Int8(i8)

Negative 8 bit integer.

Int16(i16)

Negative 16 bit integer.

Int32(i32)

Negative 32 bit integer.

Int64(i64)

Negative 64 bit integer.

Methods

impl CborSigned
[src]

fn into_i64(self) -> i64

Return the underlying value as a i64.

Trait Implementations

impl Decodable for CborSigned
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<CborSigned, __D::Error>

impl PartialOrd for CborSigned
[src]

fn partial_cmp(&self, __arg_0: &CborSigned) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &CborSigned) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &CborSigned) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &CborSigned) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &CborSigned) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq for CborSigned
[src]

fn eq(&self, __arg_0: &CborSigned) -> bool

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

fn ne(&self, __arg_0: &CborSigned) -> bool

This method tests for !=.

impl Ord for CborSigned
[src]

fn cmp(&self, __arg_0: &CborSigned) -> Ordering

This method returns an Ordering between self and other. Read more

impl Eq for CborSigned
[src]

impl Debug for CborSigned
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for CborSigned
[src]

impl Clone for CborSigned
[src]

fn clone(&self) -> CborSigned

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Encodable for CborSigned
[src]

fn encode<E: RustcEncoder>(&self, e: &mut E) -> Result<(), E::Error>