Struct BCD

Source
pub struct BCD<const BYTES: usize> { /* private fields */ }

Implementations§

Source§

impl<const BYTES: usize> BCD<BYTES>

Source

pub fn new(value: u128) -> Self

Source

pub fn get_number(&self) -> u128

Trait Implementations§

Source§

impl<const BYTES: usize> Clone for BCD<BYTES>

Source§

fn clone(&self) -> BCD<BYTES>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<const BYTES_OG: usize, const BYTES_DST: usize> Convertible<BCD<BYTES_DST>> for BCD<BYTES_OG>

Source§

fn convert(&self) -> BCD<BYTES_DST>

Source§

impl<const BYTES: usize> Debug for BCD<BYTES>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const BYTES: usize> Display for BCD<BYTES>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<BCD<1>> for u8

Source§

fn from(val: BCD<1>) -> Self

Converts to this type from the input type.
Source§

impl From<BCD<16>> for u128

Source§

fn from(value: BCD<16>) -> Self

Converts to this type from the input type.
Source§

impl From<BCD<2>> for u16

Source§

fn from(value: BCD<2>) -> Self

Converts to this type from the input type.
Source§

impl From<BCD<4>> for u32

Source§

fn from(value: BCD<4>) -> Self

Converts to this type from the input type.
Source§

impl From<BCD<8>> for u64

Source§

fn from(value: BCD<8>) -> Self

Converts to this type from the input type.
Source§

impl<const BYTES: usize> From<BCD<BYTES>> for DynBCD

Source§

fn from(value: BCD<BYTES>) -> Self

Converts to this type from the input type.
Source§

impl<const BYTES: usize> From<BCD<BYTES>> for Vec<u8>

Source§

fn from(data: BCD<BYTES>) -> Self

Converts to this type from the input type.
Source§

impl<const BYTES_OG: usize, const BYTES_DST: usize> From<BCD<BYTES_OG>> for [u8; BYTES_DST]

Source§

fn from(data: BCD<BYTES_OG>) -> Self

Converts to this type from the input type.
Source§

impl<const BYTES: usize> From<DynBCD> for BCD<BYTES>

Source§

fn from(value: DynBCD) -> Self

Converts to this type from the input type.
Source§

impl<const BYTES: usize> IntoIterator for BCD<BYTES>

Source§

type Item = u8

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<BCD<BYTES> as IntoIterator>::Item, BYTES>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<const BYTES: usize> TryFrom<&[u8]> for BCD<BYTES>

Source§

type Error = BCDConversionError

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

fn try_from(value: &[u8]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const BYTES_OG: usize, const BYTES_DST: usize> TryFrom<[u8; BYTES_OG]> for BCD<BYTES_DST>

Source§

type Error = BCDConversionError

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

fn try_from(value: [u8; BYTES_OG]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u128> for BCD<16>

Source§

type Error = BCDConversionError

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

fn try_from(value: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u16> for BCD<2>

Source§

type Error = BCDConversionError

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

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u32> for BCD<4>

Source§

type Error = BCDConversionError

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

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u64> for BCD<8>

Source§

type Error = BCDConversionError

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

fn try_from(value: u64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u8> for BCD<1>

Source§

type Error = BCDConversionError

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

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<const BYTES: usize> Copy for BCD<BYTES>

Auto Trait Implementations§

§

impl<const BYTES: usize> Freeze for BCD<BYTES>

§

impl<const BYTES: usize> RefUnwindSafe for BCD<BYTES>

§

impl<const BYTES: usize> Send for BCD<BYTES>

§

impl<const BYTES: usize> Sync for BCD<BYTES>

§

impl<const BYTES: usize> Unpin for BCD<BYTES>

§

impl<const BYTES: usize> UnwindSafe for BCD<BYTES>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.