Enum cbor::value::Int [] [src]

pub enum Int {
    Neg(u64),
    Pos(u64),
}

Type to represent all possible CBOR integer values.

Since the encoding of negative integers (major type 1) follows unsigned integers (major type 0), mapping negative integers to i8, i16, i32 or i64 can result in integer overflows. If all possible values should be handled, this type can be used.

Variants

Methods

impl Int
[src]

Map this value to an i64. If the value does not fit within [i64::MIN, i64::MAX], None is returned instead.

Map this value to a u64. If the value is negative, None is returned instead.

Trait Implementations

impl Clone for Int
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Int
[src]

impl Debug for Int
[src]

Formats the value using the given formatter.

impl Hash for Int
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Int
[src]

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

This method tests for !=.

impl Eq for Int
[src]

impl PartialOrd for Int
[src]

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

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

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

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

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

impl Ord for Int
[src]

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