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 PartialEq<Timestamp> for Timestamp
impl PartialEq<Timestamp> for Timestamp
source§impl PartialOrd<Timestamp> for Timestamp
impl PartialOrd<Timestamp> for Timestamp
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§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 more