pub struct WaveformData { /* private fields */ }Expand description
An immutable Waveform Data snapshot.
Clones share storage and compare by snapshot identity. Independently constructed values compare unequal even when their buckets match.
Implementations§
Source§impl WaveformData
impl WaveformData
Sourcepub fn from_magnitudes(
duration: Duration,
channels: usize,
levels: Vec<WaveformLevel<f32>>,
) -> Result<Self, WaveformError>
pub fn from_magnitudes( duration: Duration, channels: usize, levels: Vec<WaveformLevel<f32>>, ) -> Result<Self, WaveformError>
Construct Magnitude Waveform Data from normalized channel-major levels.
Sourcepub fn from_signed_envelopes(
duration: Duration,
channels: usize,
levels: Vec<WaveformLevel<SignedEnvelope>>,
) -> Result<Self, WaveformError>
pub fn from_signed_envelopes( duration: Duration, channels: usize, levels: Vec<WaveformLevel<SignedEnvelope>>, ) -> Result<Self, WaveformError>
Construct Signed Envelope Waveform Data from channel-major levels.
Sourcepub fn from_peaks(
duration: Duration,
peaks: Vec<u8>,
) -> Result<Self, WaveformError>
pub fn from_peaks( duration: Duration, peaks: Vec<u8>, ) -> Result<Self, WaveformError>
Convert Peaks into one evenly spaced mono Magnitude resolution.
Peaks do not carry their original cadence, channel structure, or sign, so conversion cannot preserve those facts.
pub fn mode(&self) -> AmplitudeMode
pub fn duration(&self) -> Duration
pub fn channel_count(&self) -> usize
pub fn resolution_count(&self) -> usize
pub fn resolution(&self, index: usize) -> Option<ResolutionInfo>
Sourcepub fn select(
&self,
range: Range<Duration>,
bucket_budget: usize,
) -> Result<WaveformView<'_>, WaveformError>
pub fn select( &self, range: Range<Duration>, bucket_budget: usize, ) -> Result<WaveformView<'_>, WaveformError>
Borrow the finest resolution fitting a per-channel bucket budget.
range is a nonempty half-open source-time range. The coarsest
resolution is returned when no stored resolution fits the budget.
Trait Implementations§
Source§impl Clone for WaveformData
impl Clone for WaveformData
Source§fn clone(&self) -> WaveformData
fn clone(&self) -> WaveformData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WaveformData
impl Debug for WaveformData
impl Eq for WaveformData
Auto Trait Implementations§
impl Freeze for WaveformData
impl RefUnwindSafe for WaveformData
impl Send for WaveformData
impl Sync for WaveformData
impl Unpin for WaveformData
impl UnsafeUnpin for WaveformData
impl UnwindSafe for WaveformData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.