Trait Buffer

Source
pub trait Buffer<T> {
    // Required methods
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn as_slice(&self) -> &[T];
    fn as_mut_slice(&mut self) -> &mut [T];
    fn clear(&mut self);
    fn zeroize(&mut self);
}
Expand description

A generic buffer interface for DSP operations.

Provides common operations for buffers used throughout the DSP system. Implemented by AudioBuffer for audio sample storage.

Required Methods§

Source

fn len(&self) -> usize

Get the length of the Buffer.

Source

fn is_empty(&self) -> bool

Check if the Buffer is empty.

Source

fn as_slice(&self) -> &[T]

Get the Buffer as a data slice.

Source

fn as_mut_slice(&mut self) -> &mut [T]

Get the Buffer as a mutable data slice.

Source

fn clear(&mut self)

Remove all values from the Buffer

Source

fn zeroize(&mut self)

Set all values in the Buffer to zero.

Implementors§

Source§

impl<S> Buffer<S> for AudioBuffer<S>
where S: Sample,