pub trait BcdTime<T>: Sized {
// Required methods
fn from_bcd_time(value: T) -> Self;
fn into_bcd_time(self) -> T;
}Expand description
Converts between Unix Timestamp and Binary Coded Decimal Time
Required Methods§
fn from_bcd_time(value: T) -> Self
fn into_bcd_time(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 BcdTime<[u8; 2]> for u16
impl BcdTime<[u8; 2]> for u16
Source§fn from_bcd_time(value: [u8; 2]) -> Self
fn from_bcd_time(value: [u8; 2]) -> Self
Converts BCD time (HH:MM) to minutes
Source§fn into_bcd_time(self) -> [u8; 2]
fn into_bcd_time(self) -> [u8; 2]
Converts minutes to BCD time Value should be less than 1440 (24 hours * 60 minutes)
Source§impl BcdTime<[u8; 3]> for u32
impl BcdTime<[u8; 3]> for u32
Source§fn from_bcd_time(value: [u8; 3]) -> Self
fn from_bcd_time(value: [u8; 3]) -> Self
Converts u32 BCD time (HH:MM:SS) to seconds
Source§fn into_bcd_time(self) -> [u8; 3]
fn into_bcd_time(self) -> [u8; 3]
Converts seconds to BCD time
Source§impl BcdTime<[u8; 3]> for u64
impl BcdTime<[u8; 3]> for u64
Source§fn from_bcd_time(value: [u8; 3]) -> Self
fn from_bcd_time(value: [u8; 3]) -> Self
Converts u64 BCD time (HH:MM:SS) to seconds
Source§fn into_bcd_time(self) -> [u8; 3]
fn into_bcd_time(self) -> [u8; 3]
Converts seconds to BCD time