Struct audio::wrap::Sequential

source ·
pub struct Sequential<T> { /* private fields */ }
Expand description

A wrapper for a sequential audio buffer.

See wrap::sequential.

Implementations§

source§

impl<T> Sequential<T>
where T: Slice,

source

pub fn into_inner(self) -> T

Convert back into the wrapped value.

Examples
let buf = audio::wrap::sequential(&[1, 2, 3, 4], 2);
assert_eq!(buf.into_inner(), &[1, 2, 3, 4]);
source

pub fn iter(&self) -> IterChannels<'_, T::Item>

Construct an iterator over all sequential channels.

Examples
let buf = audio::wrap::sequential(&[1, 2, 3, 4], 2);
let mut it = buf.iter();

assert_eq!(it.next().unwrap(), [1, 2]);
assert_eq!(it.next().unwrap(), [3, 4]);
source§

impl<T> Sequential<T>
where T: SliceMut,

source

pub fn iter_mut(&mut self) -> IterChannelsMut<'_, T::Item>

Construct an iterator over all sequential channels.

Trait Implementations§

source§

impl<T> Buf for Sequential<T>
where T: Slice,

§

type Sample = <T as Slice>::Item

The type of a single sample.
§

type Channel<'this> = LinearChannel<'this, <Sequential<T> as Buf>::Sample> where Self: 'this

The type of the channel container.
§

type IterChannels<'this> = IterChannels<'this, <Sequential<T> as Buf>::Sample> where Self: 'this

An iterator over available channels.
source§

fn frames_hint(&self) -> Option<usize>

A typical number of frames for each channel in the buffer, if known. Read more
source§

fn channels(&self) -> usize

The number of channels in the buffer. Read more
source§

fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>

Return a handler to the buffer associated with the channel. Read more
source§

fn iter_channels(&self) -> Self::IterChannels<'_>

Construct an iterator over all the channels in the audio buffer. Read more
source§

fn skip(self, n: usize) -> Skip<Self>
where Self: Sized,

Construct a wrapper around this buffer that skips the first n frames. Read more
source§

fn tail(self, n: usize) -> Tail<Self>
where Self: Sized,

Construct a wrapper around this buffer that skips to the last n frames. Read more
source§

fn limit(self, limit: usize) -> Limit<Self>
where Self: Sized,

Construct a wrapper around this buffer which stops after limit frames. Read more
source§

impl<T> BufMut for Sequential<T>
where T: SliceMut,

§

type ChannelMut<'a> = LinearChannelMut<'a, <Sequential<T> as Buf>::Sample> where Self: 'a

The type of the mutable channel container.
§

type IterChannelsMut<'a> = IterChannelsMut<'a, <Sequential<T> as Buf>::Sample> where Self: 'a

A mutable iterator over available channels.
source§

fn get_channel_mut(&mut self, channel: usize) -> Option<Self::ChannelMut<'_>>

Return a mutable handler to the buffer associated with the channel. Read more
source§

fn copy_channel(&mut self, from: usize, to: usize)

Copy one channel into another. Read more
source§

fn iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>

Construct a mutable iterator over available channels. Read more
source§

impl<T> ExactSizeBuf for Sequential<T>
where T: Slice,

source§

fn frames(&self) -> usize

The number of frames in a buffer. Read more
source§

impl<T> UniformBuf for Sequential<T>
where T: Slice,

§

type Frame<'this> = SequentialFrame<'this, <T as Slice>::Item> where Self: 'this

The type the channel assumes when coerced into a reference.
§

type IterFrames<'this> = SequentialFramesIter<'this, <T as Slice>::Item> where Self: 'this

A borrowing iterator over the channel.
source§

fn get_frame(&self, frame: usize) -> Option<Self::Frame<'_>>

Get a single frame at the given offset. Read more
source§

fn iter_frames(&self) -> Self::IterFrames<'_>

Construct an iterator over all the frames in the audio buffer. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Sequential<T>
where T: RefUnwindSafe,

§

impl<T> Send for Sequential<T>
where T: Send,

§

impl<T> Sync for Sequential<T>
where T: Sync,

§

impl<T> Unpin for Sequential<T>
where T: Unpin,

§

impl<T> UnwindSafe for Sequential<T>
where T: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.