pub struct Timestamp { /* private fields */ }
Expand description
A timestamp supporting various time bases. All comparisons are done within microsecond time base.
Implementations§
Source§impl Timestamp
impl Timestamp
Sourcepub const fn new(timestamp: i64, time_base: TimeBase) -> Self
pub const fn new(timestamp: i64, time_base: TimeBase) -> Self
Create a new timestamp with a given time base.
Sourcepub const fn from_millis(timestamp: i64) -> Self
pub const fn from_millis(timestamp: i64) -> Self
Create a new timestamp with 1/1_000 time base.
Sourcepub const fn from_micros(timestamp: i64) -> Self
pub const fn from_micros(timestamp: i64) -> Self
Create a new timestamp with 1/1_000_000 time base.
Sourcepub const fn from_nanos(timestamp: i64) -> Self
pub const fn from_nanos(timestamp: i64) -> Self
Create a new timestamp with 1/1_000_000_000 time base.
Sourcepub fn with_raw_timestamp(self, timestamp: i64) -> Self
pub fn with_raw_timestamp(self, timestamp: i64) -> Self
Set the timestamp with the current time base.
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Check if this is the “null” timestamp (i.e. it is equal to the AV_NOPTS_VALUE).
Sourcepub fn with_time_base(&self, time_base: TimeBase) -> Self
pub fn with_time_base(&self, time_base: TimeBase) -> Self
Rescale the timestamp value to a given time base.
Trait Implementations§
Source§impl AddAssign<Duration> for Timestamp
impl AddAssign<Duration> for Timestamp
Source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+=
operation. Read moreSource§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
Source§impl SubAssign<Duration> for Timestamp
impl SubAssign<Duration> for Timestamp
Source§fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the
-=
operation. Read moreimpl Copy for Timestamp
impl Eq for Timestamp
Auto Trait Implementations§
impl Freeze for Timestamp
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
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