Trait basic_dsp::Buffer

source ·
pub trait Buffer<'a, S, T>
where S: ToSliceMut<T>, T: RealNumber,
{ type Borrow: BufferBorrow<S, T>; // Required methods fn borrow(&'a mut self, len: usize) -> Self::Borrow; fn alloc_len(&self) -> usize; }
Expand description

A buffer which can be used by other types. Types will call buffers to create new arrays. A buffer may can implement any buffering strategy.

Required Associated Types§

source

type Borrow: BufferBorrow<S, T>

The type of the burrow which is returned.

Required Methods§

source

fn borrow(&'a mut self, len: usize) -> Self::Borrow

Asks the buffer for new storage of exactly size len. The returned array doesn’t need to have be initialized with any default value.

source

fn alloc_len(&self) -> usize

Returns the allocated length of all storage within this buffer.

Implementors§

source§

impl<'a, S, T> Buffer<'a, S, T> for FixedLenBuffer<S, T>
where S: ToSliceMut<T>, T: RealNumber + 'a,

source§

impl<'a, T> Buffer<'a, Vec<T>, T> for NoBuffer
where T: RealNumber,

source§

impl<'a, T> Buffer<'a, Vec<T>, T> for SingleBuffer<T>
where T: RealNumber + 'a,