pub struct CucConfig {
pub time_code_id: TimeCodeId,
pub coarse_len: u8,
pub fine_len: u8,
}Expand description
Configuration for a CUC time code.
Fields§
§time_code_id: TimeCodeIdTime code identifier.
coarse_len: u8Number of coarse (whole-second) bytes (1-4).
fine_len: u8Number of fine (fractional-second) bytes (0-3).
Implementations§
Source§impl CucConfig
impl CucConfig
Sourcepub const CCSDS_4_2: Self
pub const CCSDS_4_2: Self
Standard 4+2 configuration: 4 coarse bytes (seconds since CCSDS epoch) + 2 fine bytes (~15 µs resolution).
Sourcepub const fn new(time_code_id: TimeCodeId, coarse_len: u8, fine_len: u8) -> Self
pub const fn new(time_code_id: TimeCodeId, coarse_len: u8, fine_len: u8) -> Self
Creates a new CUC configuration.
Panics if coarse_len is 0 or > 4, or fine_len > 3.
Sourcepub const fn p_field(&self) -> u8
pub const fn p_field(&self) -> u8
Returns the P-field byte for this configuration.
This encodes the time code ID, coarse length, and fine length into a single byte. The extension flag is 0.
Sourcepub const fn from_p_field(pf: u8) -> Result<Self, Error>
pub const fn from_p_field(pf: u8) -> Result<Self, Error>
Parses a P-field byte into a CUC configuration.
Sourcepub const fn t_field_len(&self) -> usize
pub const fn t_field_len(&self) -> usize
Total T-field size in bytes (coarse + fine).
Sourcepub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Total encoded size including the P-field (1 + T-field).
Trait Implementations§
impl Copy for CucConfig
impl Eq for CucConfig
impl StructuralPartialEq for CucConfig
Auto Trait Implementations§
impl Freeze for CucConfig
impl RefUnwindSafe for CucConfig
impl Send for CucConfig
impl Sync for CucConfig
impl Unpin for CucConfig
impl UnsafeUnpin for CucConfig
impl UnwindSafe for CucConfig
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