pub struct Pcr {
pub base: u64,
pub extension: u16,
}Expand description
Program Clock Reference (ISO/IEC 13818-1:2007 §2.4.3.5): a 33-bit base on a 90 kHz clock plus a 9-bit extension on a 27 MHz clock.
Fields§
§base: u6433-bit base (90 kHz units).
extension: u169-bit extension (27 MHz units).
Implementations§
Source§impl Pcr
impl Pcr
Sourcepub fn as_27mhz(self) -> u64
pub fn as_27mhz(self) -> u64
Full PCR value on the 27 MHz clock: base * 300 + extension.
ISO/IEC 13818-1:2007 §2.4.3.5: PCR = PCR_base * 300 + PCR_ext.
Sourcepub fn from_27mhz(ticks: u64) -> Self
pub fn from_27mhz(ticks: u64) -> Self
Sourcepub fn to_field_bytes(self) -> [u8; 6]
pub fn to_field_bytes(self) -> [u8; 6]
Encode as the exact 6-byte PCR/OPCR field used in the adaptation field (ISO/IEC 13818-1:2007 §2.4.3.5).
Wire layout (big-endian, 48 bits):
[base[32:25]][base[24:17]][base[16:9]][base[8:1]][base[0] | 6×reserved(1) | ext[8]][ext[7:0]]
The 6 reserved bits are set to 1 as per the spec’s “reserved” convention.
Exact inverse of the private parse function.
Trait Implementations§
impl Copy for Pcr
impl Eq for Pcr
impl StructuralPartialEq for Pcr
Auto Trait Implementations§
impl Freeze for Pcr
impl RefUnwindSafe for Pcr
impl Send for Pcr
impl Sync for Pcr
impl Unpin for Pcr
impl UnsafeUnpin for Pcr
impl UnwindSafe for Pcr
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