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
Neg | |
Pos |
Methods
impl Int
fn from_u64(n: u64) -> Int
fn from_i64(n: i64) -> Int
fn i64(&self) -> Option<i64>
Map this value to an i64. If the value does not
fit within [i64::MIN, i64::MAX], None is returned instead.
fn u64(&self) -> Option<u64>
Map this value to a u64. If the value is negative,
None is returned instead.