Skip to main content

Bcd

Trait Bcd 

Source
pub trait Bcd<T>: Sized {
    // Required methods
    fn from_bcd(value: T) -> Self;
    fn into_bcd(self) -> T;
}
Expand description

BCD (Binary-Coded Decimal) is a class of binary encodings of decimal numbers where each decimal digit is represented by a fixed number of bits.

Required Methods§

Source

fn from_bcd(value: T) -> Self

Source

fn into_bcd(self) -> T

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Bcd<[u8; 2]> for u16

Source§

fn from_bcd(value: [u8; 2]) -> Self

Source§

fn into_bcd(self) -> [u8; 2]

Source§

impl Bcd<[u8; 4]> for u32

Source§

fn from_bcd(value: [u8; 4]) -> Self

Source§

fn into_bcd(self) -> [u8; 4]

Source§

impl Bcd<u8> for u8

Source§

fn from_bcd(value: u8) -> Self

Source§

fn into_bcd(self) -> u8

Implementors§