pub struct Dynamic<T> { /* private fields */ }
Expand description
A wrapper for an external dynamic audio buffer.
See wrap::dynamic.
Implementations§
source§impl<T> Dynamic<T>
impl<T> Dynamic<T>
sourcepub fn as_ref(&self) -> &T
pub fn as_ref(&self) -> &T
Get a reference to the inner value.
Examples
let buf = audio::wrap::dynamic(vec![vec![1, 2, 3, 4]]);
assert_eq!(buf.as_ref(), &[vec![1, 2, 3, 4]]);
sourcepub fn as_mut(&mut self) -> &mut T
pub fn as_mut(&mut self) -> &mut T
Get a mutable reference to the inner value.
Examples
let mut buf = audio::wrap::dynamic(vec![vec![1, 2, 3, 4]]);
*buf.as_mut() = vec![vec![5, 6, 7, 8]];
assert_eq!(buf.as_ref(), &[vec![5, 6, 7, 8]]);
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Get the inner wrapper value.
Examples
let buf = audio::wrap::dynamic(vec![vec![1, 2, 3, 4]]);
assert_eq!(buf.into_inner(), vec![vec![1, 2, 3, 4]]);
Trait Implementations§
source§impl<T> Buf for Dynamic<&[Vec<T>]>where
T: Copy,
impl<T> Buf for Dynamic<&[Vec<T>]>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<&[Vec<T>]> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<&[Vec<T>]> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T, const N: usize> Buf for Dynamic<&[Vec<T>; N]>where
T: Copy,
impl<T, const N: usize> Buf for Dynamic<&[Vec<T>; N]>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<&[Vec<T>; N]> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<&[Vec<T>; N]> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T> Buf for Dynamic<&Vec<Vec<T>>>where
T: Copy,
impl<T> Buf for Dynamic<&Vec<Vec<T>>>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<&Vec<Vec<T>>> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<&Vec<Vec<T>>> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T> Buf for Dynamic<&mut [Vec<T>]>where
T: Copy,
impl<T> Buf for Dynamic<&mut [Vec<T>]>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<&mut [Vec<T>]> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<&mut [Vec<T>]> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T, const N: usize> Buf for Dynamic<&mut [Vec<T>; N]>where
T: Copy,
impl<T, const N: usize> Buf for Dynamic<&mut [Vec<T>; N]>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<&mut [Vec<T>; N]> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<&mut [Vec<T>; N]> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T> Buf for Dynamic<&mut Vec<Vec<T>>>where
T: Copy,
impl<T> Buf for Dynamic<&mut Vec<Vec<T>>>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<&mut Vec<Vec<T>>> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<&mut Vec<Vec<T>>> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T, const N: usize> Buf for Dynamic<[Vec<T>; N]>where
T: Copy,
impl<T, const N: usize> Buf for Dynamic<[Vec<T>; N]>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<[Vec<T>; N]> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<[Vec<T>; N]> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T> Buf for Dynamic<Vec<Vec<T>>>where
T: Copy,
impl<T> Buf for Dynamic<Vec<Vec<T>>>where
T: Copy,
§type Channel<'this> = LinearChannel<'this, <Dynamic<Vec<Vec<T>>> as Buf>::Sample>
where
Self: 'this
type Channel<'this> = LinearChannel<'this, <Dynamic<Vec<Vec<T>>> as Buf>::Sample> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<'this, T>
where
Self: 'this
type IterChannels<'this> = IterChannels<'this, T> where Self: 'this
An iterator over available channels.
source§fn frames_hint(&self) -> Option<usize>
fn frames_hint(&self) -> Option<usize>
A typical number of frames for each channel in the buffer, if known. Read more
source§fn get_channel(&self, channel: usize) -> Option<Self::Channel<'_>>
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<'_>
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,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Construct a wrapper around this buffer that skips the first
n
frames. Read moresource§impl<T> BufMut for Dynamic<&mut [Vec<T>]>where
T: Copy,
impl<T> BufMut for Dynamic<&mut [Vec<T>]>where
T: Copy,
§type ChannelMut<'this> = LinearChannelMut<'this, T>
where
Self: 'this
type ChannelMut<'this> = LinearChannelMut<'this, T> where Self: 'this
The type of the mutable channel container.
§type IterChannelsMut<'this> = IterChannelsMut<'this, T>
where
Self: 'this
type IterChannelsMut<'this> = IterChannelsMut<'this, T> where Self: 'this
A mutable iterator over available channels.
source§fn get_channel_mut(&mut self, channel: usize) -> Option<Self::ChannelMut<'_>>
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 iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
fn iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
Construct a mutable iterator over available channels. Read more
source§impl<T, const N: usize> BufMut for Dynamic<&mut [Vec<T>; N]>where
T: Copy,
impl<T, const N: usize> BufMut for Dynamic<&mut [Vec<T>; N]>where
T: Copy,
§type ChannelMut<'this> = LinearChannelMut<'this, T>
where
Self: 'this
type ChannelMut<'this> = LinearChannelMut<'this, T> where Self: 'this
The type of the mutable channel container.
§type IterChannelsMut<'this> = IterChannelsMut<'this, T>
where
Self: 'this
type IterChannelsMut<'this> = IterChannelsMut<'this, T> where Self: 'this
A mutable iterator over available channels.
source§fn get_channel_mut(&mut self, channel: usize) -> Option<Self::ChannelMut<'_>>
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 iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
fn iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
Construct a mutable iterator over available channels. Read more
source§impl<T> BufMut for Dynamic<&mut Vec<Vec<T>>>where
T: Copy,
impl<T> BufMut for Dynamic<&mut Vec<Vec<T>>>where
T: Copy,
§type ChannelMut<'this> = LinearChannelMut<'this, T>
where
Self: 'this
type ChannelMut<'this> = LinearChannelMut<'this, T> where Self: 'this
The type of the mutable channel container.
§type IterChannelsMut<'this> = IterChannelsMut<'this, T>
where
Self: 'this
type IterChannelsMut<'this> = IterChannelsMut<'this, T> where Self: 'this
A mutable iterator over available channels.
source§fn get_channel_mut(&mut self, channel: usize) -> Option<Self::ChannelMut<'_>>
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 iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
fn iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
Construct a mutable iterator over available channels. Read more
source§impl<T, const N: usize> BufMut for Dynamic<[Vec<T>; N]>where
T: Copy,
impl<T, const N: usize> BufMut for Dynamic<[Vec<T>; N]>where
T: Copy,
§type ChannelMut<'this> = LinearChannelMut<'this, T>
where
Self: 'this
type ChannelMut<'this> = LinearChannelMut<'this, T> where Self: 'this
The type of the mutable channel container.
§type IterChannelsMut<'this> = IterChannelsMut<'this, T>
where
Self: 'this
type IterChannelsMut<'this> = IterChannelsMut<'this, T> where Self: 'this
A mutable iterator over available channels.
source§fn get_channel_mut(&mut self, channel: usize) -> Option<Self::ChannelMut<'_>>
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 iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
fn iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
Construct a mutable iterator over available channels. Read more
source§impl<T> BufMut for Dynamic<Vec<Vec<T>>>where
T: Copy,
impl<T> BufMut for Dynamic<Vec<Vec<T>>>where
T: Copy,
§type ChannelMut<'this> = LinearChannelMut<'this, T>
where
Self: 'this
type ChannelMut<'this> = LinearChannelMut<'this, T> where Self: 'this
The type of the mutable channel container.
§type IterChannelsMut<'this> = IterChannelsMut<'this, T>
where
Self: 'this
type IterChannelsMut<'this> = IterChannelsMut<'this, T> where Self: 'this
A mutable iterator over available channels.
source§fn get_channel_mut(&mut self, channel: usize) -> Option<Self::ChannelMut<'_>>
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 iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
fn iter_channels_mut(&mut self) -> Self::IterChannelsMut<'_>
Construct a mutable iterator over available channels. Read more
Auto Trait Implementations§
impl<T> RefUnwindSafe for Dynamic<T>where
T: RefUnwindSafe,
impl<T> Send for Dynamic<T>where
T: Send,
impl<T> Sync for Dynamic<T>where
T: Sync,
impl<T> Unpin for Dynamic<T>where
T: Unpin,
impl<T> UnwindSafe for Dynamic<T>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