pub struct StreamInstant(pub u64);Expand description
A point in stream time, measured in points since stream start.
Tuple Fields§
§0: u64Implementations§
Source§impl StreamInstant
impl StreamInstant
Sourcepub fn as_seconds(&self, pps: u32) -> f64
pub fn as_seconds(&self, pps: u32) -> f64
Convert this instant to seconds at the given points-per-second rate.
Sourcepub fn from_seconds(seconds: f64, pps: u32) -> Self
pub fn from_seconds(seconds: f64, pps: u32) -> Self
Create a stream instant from a duration in seconds at the given PPS.
Sourcepub fn add_points(&self, points: u64) -> Self
pub fn add_points(&self, points: u64) -> Self
Add a number of points to this instant.
Sourcepub fn sub_points(&self, points: u64) -> Self
pub fn sub_points(&self, points: u64) -> Self
Subtract a number of points from this instant (saturating at 0).
Trait Implementations§
Source§impl Add<u64> for StreamInstant
impl Add<u64> for StreamInstant
Source§impl AddAssign<u64> for StreamInstant
impl AddAssign<u64> for StreamInstant
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+= operation. Read moreSource§impl Clone for StreamInstant
impl Clone for StreamInstant
Source§fn clone(&self) -> StreamInstant
fn clone(&self) -> StreamInstant
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamInstant
impl Debug for StreamInstant
Source§impl Default for StreamInstant
impl Default for StreamInstant
Source§fn default() -> StreamInstant
fn default() -> StreamInstant
Returns the “default value” for a type. Read more
Source§impl Hash for StreamInstant
impl Hash for StreamInstant
Source§impl Ord for StreamInstant
impl Ord for StreamInstant
Source§fn cmp(&self, other: &StreamInstant) -> Ordering
fn cmp(&self, other: &StreamInstant) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StreamInstant
impl PartialEq for StreamInstant
Source§impl PartialOrd for StreamInstant
impl PartialOrd for StreamInstant
Source§impl Sub<u64> for StreamInstant
impl Sub<u64> for StreamInstant
Source§impl SubAssign<u64> for StreamInstant
impl SubAssign<u64> for StreamInstant
Source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-= operation. Read moreimpl Copy for StreamInstant
impl Eq for StreamInstant
impl StructuralPartialEq for StreamInstant
Auto Trait Implementations§
impl Freeze for StreamInstant
impl RefUnwindSafe for StreamInstant
impl Send for StreamInstant
impl Sync for StreamInstant
impl Unpin for StreamInstant
impl UnwindSafe for StreamInstant
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