pub struct UserBitsPayload {
pub raw: u32,
pub is_date: bool,
}Expand description
User bits payload from SMPTE 12M (32 bits split into 8 nibbles).
Fields§
§raw: u32Raw 32-bit user bits value
is_date: boolWhether the user bits encode a date (BG flag)
Implementations§
Source§impl UserBitsPayload
impl UserBitsPayload
Sourcepub fn set_nibble(&mut self, index: u8, value: u8)
pub fn set_nibble(&mut self, index: u8, value: u8)
Sets a nibble (0-7) in the user bits.
Sourcepub fn decode_date(&self) -> Option<RecordDate>
pub fn decode_date(&self) -> Option<RecordDate>
Decodes the user bits as a BCD date (if applicable).
SMPTE 12M encodes dates as: nibbles 0-1 = day, 2-3 = month, 4-7 = year.
Sourcepub fn encode_date(date: &RecordDate) -> Self
pub fn encode_date(date: &RecordDate) -> Self
Encodes a date into user bits in BCD format.
Trait Implementations§
Source§impl Clone for UserBitsPayload
impl Clone for UserBitsPayload
Source§fn clone(&self) -> UserBitsPayload
fn clone(&self) -> UserBitsPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserBitsPayload
impl Debug for UserBitsPayload
Source§impl PartialEq for UserBitsPayload
impl PartialEq for UserBitsPayload
impl Eq for UserBitsPayload
impl StructuralPartialEq for UserBitsPayload
Auto Trait Implementations§
impl Freeze for UserBitsPayload
impl RefUnwindSafe for UserBitsPayload
impl Send for UserBitsPayload
impl Sync for UserBitsPayload
impl Unpin for UserBitsPayload
impl UnsafeUnpin for UserBitsPayload
impl UnwindSafe for UserBitsPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more