pub struct InstanceBuffer<T: Clone + Copy + Default, const MAX_CHANNELS: usize> { /* private fields */ }Expand description
A memory-efficient buffer of samples with variable number of instances each with up to
MAX_CHANNELS channels. Each channel has a length of frames.
Implementations§
Source§impl<T: Clone + Copy + Default, const MAX_CHANNELS: usize> InstanceBuffer<T, MAX_CHANNELS>
impl<T: Clone + Copy + Default, const MAX_CHANNELS: usize> InstanceBuffer<T, MAX_CHANNELS>
pub fn new(num_instances: usize, channels: NonZeroUsize, frames: usize) -> Self
pub fn frames(&self) -> usize
pub fn num_channels(&self) -> NonZeroUsize
pub fn num_instances(&self) -> usize
pub fn instance( &self, instance_index: usize, channels: usize, frames: usize, ) -> Option<ArrayVec<&[T], MAX_CHANNELS>>
pub fn instance_mut( &mut self, instance_index: usize, channels: usize, frames: usize, ) -> Option<ArrayVec<&mut [T], MAX_CHANNELS>>
Auto Trait Implementations§
impl<T, const MAX_CHANNELS: usize> Freeze for InstanceBuffer<T, MAX_CHANNELS>
impl<T, const MAX_CHANNELS: usize> RefUnwindSafe for InstanceBuffer<T, MAX_CHANNELS>where
T: RefUnwindSafe,
impl<T, const MAX_CHANNELS: usize> Send for InstanceBuffer<T, MAX_CHANNELS>where
T: Send,
impl<T, const MAX_CHANNELS: usize> Sync for InstanceBuffer<T, MAX_CHANNELS>where
T: Sync,
impl<T, const MAX_CHANNELS: usize> Unpin for InstanceBuffer<T, MAX_CHANNELS>where
T: Unpin,
impl<T, const MAX_CHANNELS: usize> UnwindSafe for InstanceBuffer<T, MAX_CHANNELS>where
T: UnwindSafe,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.