Skip to main content

Constants

Struct Constants 

Source
pub struct Constants {}
Expand description

Constant values required for CBOR encoding.

Implementations§

Source§

impl Constants

Source

pub const MAJOR_TYPE_BIT_SHIFT: u8 = 5

Number of bits used to shift left the major type of a CBOR type byte.

Source

pub const ADDITIONAL_INFORMATION_MASK: u8 = 0x1F

Mask to retrieve the additional information held in a CBOR type bytes, ignoring the major type.

Source

pub const ADDITIONAL_INFORMATION_MAX_INT: u8 = 23

Additional information value that indicates the largest inline value.

Source

pub const ADDITIONAL_INFORMATION_1_BYTE: u8 = 24

Additional information value indicating that a 1-byte length follows.

Source

pub const ADDITIONAL_INFORMATION_2_BYTES: u8 = 25

Additional information value indicating that a 2-byte length follows.

Source

pub const ADDITIONAL_INFORMATION_4_BYTES: u8 = 26

Additional information value indicating that a 4-byte length follows.

Source

pub const ADDITIONAL_INFORMATION_8_BYTES: u8 = 27

Additional information value indicating that an 8-byte length follows.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.