pub trait AudioBlockOpsMut<S: Sample> {
// Required methods
fn copy_from_block(&mut self, block: &impl AudioBlock<S>);
fn copy_from_block_exact(&mut self, block: &impl AudioBlock<S>);
fn copy_mono_to_all_channels(&mut self, mono: &AudioBlockMonoView<'_, S>);
fn for_each(&mut self, f: impl FnMut(&mut S));
fn for_each_including_non_visible(&mut self, f: impl FnMut(&mut S));
fn enumerate(&mut self, f: impl FnMut(u16, usize, &mut S));
fn enumerate_including_non_visible(
&mut self,
f: impl FnMut(u16, usize, &mut S),
);
fn fill_with(&mut self, sample: S);
fn clear(&mut self)
where S: Default;
}Required Methods§
Sourcefn copy_from_block(&mut self, block: &impl AudioBlock<S>)
fn copy_from_block(&mut self, block: &impl AudioBlock<S>)
Copy samples from source block, clamping to the smaller dimensions.
Resizes destination to min(src, dst) channels and frames.
Never panics - safely handles mismatched block sizes.
Sourcefn copy_from_block_exact(&mut self, block: &impl AudioBlock<S>)
fn copy_from_block_exact(&mut self, block: &impl AudioBlock<S>)
Copy samples from source block, requiring exact size match. Panics if source and destination don’t have identical channels and frames.
Sourcefn copy_mono_to_all_channels(&mut self, mono: &AudioBlockMonoView<'_, S>)
fn copy_mono_to_all_channels(&mut self, mono: &AudioBlockMonoView<'_, S>)
Copy a mono block to all channels of this block. Panics if blocks don’t have the same number of frames.
Sourcefn for_each_including_non_visible(&mut self, f: impl FnMut(&mut S))
fn for_each_including_non_visible(&mut self, f: impl FnMut(&mut S))
Gives access to all samples in the block.
This is faster than for_each by not checking bounds of the block.
It can be used if your algorithm does not change if wrong samples are accessed.
For example this is the case for gain, clear, etc.
Sourcefn enumerate(&mut self, f: impl FnMut(u16, usize, &mut S))
fn enumerate(&mut self, f: impl FnMut(u16, usize, &mut S))
Gives access to all samples in the block while supplying the information about which channel and frame number the sample is stored in.
Sourcefn enumerate_including_non_visible(&mut self, f: impl FnMut(u16, usize, &mut S))
fn enumerate_including_non_visible(&mut self, f: impl FnMut(u16, usize, &mut S))
Gives access to all samples in the block while supplying the information about which channel and frame number the sample is stored in.
This is faster than enumerate by not checking bounds of the block.
It can be used if your algorithm does not change if wrong samples are accessed.
For example this is the case for applying a gain, clear, etc.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.