pub struct AuxOutput<'borrow, 'data, S: Sample = f32> { /* private fields */ }Expand description
Mutable view of an auxiliary output bus.
Provides access to output channels for a single auxiliary bus
(e.g., aux sends, multi-out). Created via AuxiliaryBuffers::output().
§Type Parameter
S is the sample type, defaulting to f32.
§Lifetime Parameters
'borrow- The borrow lifetime (from&mut selfonAuxiliaryBuffers)'data- The underlying audio data lifetime
This separation is required because &'a mut [&'a mut T] is invariant
in Rust, which prevents returning borrowed data from methods.
§Example
ⓘ
if let Some(mut aux_out) = aux.output(0) {
// Write to aux output
for sample in aux_out.output(0) {
*sample = processed_signal;
}
}Implementations§
Source§impl<'borrow, 'data, S: Sample> AuxOutput<'borrow, 'data, S>
impl<'borrow, 'data, S: Sample> AuxOutput<'borrow, 'data, S>
Sourcepub fn num_samples(&self) -> usize
pub fn num_samples(&self) -> usize
Number of samples in each channel.
Sourcepub fn num_channels(&self) -> usize
pub fn num_channels(&self) -> usize
Number of channels in this bus.
Sourcepub fn output(&mut self, index: usize) -> &mut [S]
pub fn output(&mut self, index: usize) -> &mut [S]
Get a mutable output channel by index.
Matches Buffer::output() naming for API consistency.
§Panics
Panics if the channel index is out of bounds.
Sourcepub fn output_checked(&mut self, index: usize) -> Option<&mut [S]>
pub fn output_checked(&mut self, index: usize) -> Option<&mut [S]>
Try to get a mutable output channel by index.
Returns None if the channel doesn’t exist.
Sourcepub fn iter_outputs(
&mut self,
) -> impl Iterator<Item = &mut [S]> + use<'_, 'data, S>
pub fn iter_outputs( &mut self, ) -> impl Iterator<Item = &mut [S]> + use<'_, 'data, S>
Iterate over all output channels mutably.
Auto Trait Implementations§
impl<'borrow, 'data, S> Freeze for AuxOutput<'borrow, 'data, S>
impl<'borrow, 'data, S> RefUnwindSafe for AuxOutput<'borrow, 'data, S>where
S: RefUnwindSafe,
impl<'borrow, 'data, S> Send for AuxOutput<'borrow, 'data, S>
impl<'borrow, 'data, S> Sync for AuxOutput<'borrow, 'data, S>
impl<'borrow, 'data, S> Unpin for AuxOutput<'borrow, 'data, S>
impl<'borrow, 'data, S = f32> !UnwindSafe for AuxOutput<'borrow, 'data, S>
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