Skip to main content

Indexing

Struct Indexing 

Source
pub struct Indexing {
    pub input_offset: usize,
    pub output_offset: usize,
    pub partial_len: Option<usize>,
    pub active_channels_mask: Option<Vec<bool>>,
}
Expand description

A struct for providing optional parameters when calling process_into_buffer.

All fields have sensible defaults: zero offsets, no partial length, and all channels active. Pass None as the indexing argument to use these defaults without constructing the struct.

Fields§

§input_offset: usize

Number of frames to skip at the beginning of the input buffer before reading. Use this to process a sub-region of a larger buffer without copying data. Defaults to 0 (read from the start of the buffer).

§output_offset: usize

Number of frames to skip at the beginning of the output buffer before writing. Use this to write results into a sub-region of a larger buffer. Defaults to 0 (write from the start of the buffer).

§partial_len: Option<usize>

Set to Some(n) when the input buffer contains fewer valid frames than Resampler::input_frames_next requires. The resampler will read the first n frames from the input buffer and treat the remaining frames as silence. This is useful for processing the very last (partial) chunk of a stream or audio clip.

Important: even with partial_len set, the output buffer must still be large enough to hold at least Resampler::output_frames_next frames (plus output_offset), because the resampler always produces a full output chunk.

Set to Some(0) to process a chunk of pure silence (e.g. to flush the resampler delay).

Defaults to None, meaning the full Resampler::input_frames_next frames are read.

§active_channels_mask: Option<Vec<bool>>

Optional per-channel processing mask. When Some(vec), each element corresponds to one channel: true means the channel is processed normally, false means the channel is skipped and its output is left unchanged. When None, all channels are processed.

Trait Implementations§

Source§

impl Clone for Indexing

Source§

fn clone(&self) -> Indexing

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Indexing

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.