[−][src]Struct cpal::StreamInstant
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
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]
fn clone(&self) -> StreamInstant
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for StreamInstant
[src]
impl Debug for StreamInstant
[src]
impl Eq for StreamInstant
[src]
impl Hash for StreamInstant
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for StreamInstant
[src]
fn cmp(&self, other: &StreamInstant) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<StreamInstant> for StreamInstant
[src]
fn eq(&self, other: &StreamInstant) -> bool
[src]
fn ne(&self, other: &StreamInstant) -> bool
[src]
impl PartialOrd<StreamInstant> for StreamInstant
[src]
fn partial_cmp(&self, other: &StreamInstant) -> Option<Ordering>
[src]
fn lt(&self, other: &StreamInstant) -> bool
[src]
fn le(&self, other: &StreamInstant) -> bool
[src]
fn gt(&self, other: &StreamInstant) -> bool
[src]
fn ge(&self, other: &StreamInstant) -> bool
[src]
impl StructuralEq for StreamInstant
[src]
impl StructuralPartialEq for StreamInstant
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,