Struct audio_time::Bytes
source · #[repr(transparent)]pub struct Bytes<const SYS: System>(_);Expand description
An audio time span, measured in the number of bytes required for its representation.
The usize contained in this struct is invariantly held to be divisible
(without remainder) by the size of a single sample
(SYS.sample_size()).
Implementations§
source§impl<const SYS: System> Bytes<SYS>
impl<const SYS: System> Bytes<SYS>
sourcepub const fn into_duration(self) -> Duration
pub const fn into_duration(self) -> Duration
Equivalent to Duration::try_from(bytes).unwrap().
sourcepub const fn from_duration(dur: Duration) -> Self
pub const fn from_duration(dur: Duration) -> Self
Equivalent to Bytes::try_from(duration).unwrap().
sourcepub const fn into_samples(self) -> Samples<SYS>
pub const fn into_samples(self) -> Samples<SYS>
Equivalent to Samples::from(bytes).
sourcepub const fn from_samples(samples: Samples<SYS>) -> Self
pub const fn from_samples(samples: Samples<SYS>) -> Self
Equivalent to Bytes::try_from(samples).unwrap().
Trait Implementations§
source§impl<const SYS: System> Ord for Bytes<SYS>
impl<const SYS: System> Ord for Bytes<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<Bytes<SYS>> for Bytes<SYS>
impl<const SYS: System> PartialEq<Bytes<SYS>> for Bytes<SYS>
source§impl<const SYS: System> PartialOrd<Bytes<SYS>> for Bytes<SYS>
impl<const SYS: System> PartialOrd<Bytes<SYS>> for Bytes<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