Struct cpal::StreamInstant
source · [−]pub struct StreamInstant { /* private fields */ }
Expand description
A monotonic time instance associated with a stream, retrieved from either:
- A timestamp provided to the stream’s underlying audio data callback or
- 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
Host | Source |
---|---|
alsa | snd_pcm_status_get_htstamp |
coreaudio | mach_absolute_time |
wasapi | QueryPerformanceCounter |
asio | timeGetTime |
emscripten | AudioContext.getOutputTimestamp |
Implementations
The amount of time elapsed from another instant to this one.
Returns None
if earlier
is later than self.
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.
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for StreamInstant
impl Send for StreamInstant
impl Sync for StreamInstant
impl Unpin for StreamInstant
impl UnwindSafe for StreamInstant
Blanket Implementations
Mutably borrows from an owned value. Read more