Struct audio_time::Samples
source · #[repr(transparent)]pub struct Samples<const SYS: System>(_);
Expand description
An audio time span, measured by the number of samples contained in it.
Implementations§
source§impl<const SYS: System> Samples<SYS>
impl<const SYS: System> Samples<SYS>
sourcepub const fn into_duration(self) -> Duration
pub const fn into_duration(self) -> Duration
Equivalent to Duration::try_from(samples).unwrap()
.
sourcepub const fn from_duration(dur: Duration) -> Self
pub const fn from_duration(dur: Duration) -> Self
Equivalent to Samples::try_from(duration).unwrap()
.
sourcepub const fn into_bytes(self) -> Bytes<SYS>
pub const fn into_bytes(self) -> Bytes<SYS>
Equivalent to Bytes::try_from(samples).unwrap()
.
sourcepub const fn from_bytes(bytes: Bytes<SYS>) -> Self
pub const fn from_bytes(bytes: Bytes<SYS>) -> Self
Equivalent to Samples::from(bytes)
.
Trait Implementations§
source§impl<const SYS: System> Ord for Samples<SYS>
impl<const SYS: System> Ord for Samples<SYS>
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<const SYS: System> PartialEq<Samples<SYS>> for Samples<SYS>
impl<const SYS: System> PartialEq<Samples<SYS>> for Samples<SYS>
source§impl<const SYS: System> PartialOrd<Samples<SYS>> for Samples<SYS>
impl<const SYS: System> PartialOrd<Samples<SYS>> for Samples<SYS>
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 more