[][src]Struct cpal::StreamInstant

pub struct StreamInstant { /* fields omitted */ }

A monotonic time instance associated with a stream, retrieved from either:

  1. A timestamp provided to the stream's underlying audio data callback or
  2. The same time source used to generate timestamps for a stream's underlying audio data callback.

StreamInstant represents a duration since some unspecified origin occurring either before or equal to the moment the stream from which it was created begins.

Host StreamInstant Sources

HostSource
alsasnd_pcm_status_get_htstamp
coreaudiomach_absolute_time
wasapiQueryPerformanceCounter
asiotimeGetTime
emscriptenAudioContext.getOutputTimestamp

Implementations

impl StreamInstant[src]

pub fn duration_since(&self, earlier: &Self) -> Option<Duration>[src]

The amount of time elapsed from another instant to this one.

Returns None if earlier is later than self.

pub fn add(&self, duration: Duration) -> Option<Self>[src]

Returns the instant in time after the given duration has passed.

Returns None if the resulting instant would exceed the bounds of the underlying data structure.

pub fn sub(&self, duration: Duration) -> Option<Self>[src]

Returns the instant in time one duration ago.

Returns None if the resulting instant would underflow. As a result, it is important to consider that on some platforms the StreamInstant may begin at 0 from the moment the source stream is created.

Trait Implementations

impl Clone for StreamInstant[src]

impl Copy for StreamInstant[src]

impl Debug for StreamInstant[src]

impl Eq for StreamInstant[src]

impl Hash for StreamInstant[src]

impl Ord for StreamInstant[src]

impl PartialEq<StreamInstant> for StreamInstant[src]

impl PartialOrd<StreamInstant> for StreamInstant[src]

impl StructuralEq for StreamInstant[src]

impl StructuralPartialEq for StreamInstant[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.