#[non_exhaustive]pub struct Clock { /* private fields */ }Expand description
The broadcast’s one continuous clock, advertised at the catalog root.
wall is the wall-clock time of PTS zero since the moq epoch
([moq_net::time::EPOCH], 2020-01-01). Its embedded timescale is serialized beside it as
{ wall, timescale }, preserving the catalog wire shape while keeping the pair inseparable in
Rust. Every media track and every HLS record refer to this mapping after timescale conversion.
Implementations§
Source§impl Clock
impl Clock
Sourcepub fn new(wall: Timestamp) -> Result<Self>
pub fn new(wall: Timestamp) -> Result<Self>
Construct a catalog clock from its typed wall timestamp.
Refuses a value outside the JSON-safe integer range or a timescale that cannot be represented
by the catalog’s u32 wire field.
Sourcepub fn wall_clock(&self, pts: Timestamp) -> Result<Wall>
pub fn wall_clock(&self, pts: Timestamp) -> Result<Wall>
The wall-clock time of pts under this fixed mapping.
Exact down to the nanosecond; an instant finer than that (a 90 kHz tick) is floored.
Refuses a result past the JSON-safe range or the wall clock’s 1970-2554 range, and an
unscaled pts or wall, which has no time.
Trait Implementations§
impl Copy for Clock
Source§impl<'de> Deserialize<'de> for Clock
impl<'de> Deserialize<'de> for Clock
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for Clock
impl StructuralPartialEq for Clock
Auto Trait Implementations§
impl Freeze for Clock
impl RefUnwindSafe for Clock
impl Send for Clock
impl Sync for Clock
impl Unpin for Clock
impl UnsafeUnpin for Clock
impl UnwindSafe for Clock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.