Struct audio_core::buf::Skip
source · pub struct Skip<B> { /* private fields */ }
Expand description
A buffer where a number of frames have been skipped over.
See Buf::skip.
Trait Implementations§
source§impl<B> Buf for Skip<B>where
B: Buf,
impl<B> Buf for Skip<B>where
B: Buf,
Skip adjusts the implementation of Buf.
use audio::{Buf, ExactSizeBuf};
let buf = audio::interleaved![[0; 4]; 2];
assert_eq!((&buf).skip(0).channels(), 2);
assert_eq!((&buf).skip(0).frames_hint(), Some(4));
assert_eq!((&buf).skip(1).channels(), 2);
assert_eq!((&buf).skip(1).frames_hint(), Some(3));
assert_eq!((&buf).skip(5).channels(), 2);
assert_eq!((&buf).skip(5).frames_hint(), Some(0));
§type Channel<'this> = <B as Buf>::Channel<'this>
where
Self: 'this
type Channel<'this> = <B as Buf>::Channel<'this> where Self: 'this
The type of the channel container.
§type IterChannels<'this> = IterChannels<<B as Buf>::IterChannels<'this>>
where
Self: 'this
type IterChannels<'this> = IterChannels<<B as Buf>::IterChannels<'this>> 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<B> BufMut for Skip<B>where
B: BufMut,
impl<B> BufMut for Skip<B>where
B: BufMut,
§type ChannelMut<'a> = <B as BufMut>::ChannelMut<'a>
where
Self: 'a
type ChannelMut<'a> = <B as BufMut>::ChannelMut<'a> where Self: 'a
The type of the mutable channel container.
§type IterChannelsMut<'a> = IterChannelsMut<<B as BufMut>::IterChannelsMut<'a>>
where
Self: 'a
type IterChannelsMut<'a> = IterChannelsMut<<B as BufMut>::IterChannelsMut<'a>> where Self: 'a
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<B> ExactSizeBuf for Skip<B>where
B: ExactSizeBuf,
impl<B> ExactSizeBuf for Skip<B>where
B: ExactSizeBuf,
Skip adjusts the implementation of ExactSizeBuf.
use audio::{Buf, ExactSizeBuf};
let buf = audio::interleaved![[0; 4]; 2];
assert_eq!((&buf).skip(0).frames(), 4);
assert_eq!((&buf).skip(1).frames(), 3);
assert_eq!((&buf).skip(5).frames(), 0);
Auto Trait Implementations§
impl<B> RefUnwindSafe for Skip<B>where
B: RefUnwindSafe,
impl<B> Send for Skip<B>where
B: Send,
impl<B> Sync for Skip<B>where
B: Sync,
impl<B> Unpin for Skip<B>where
B: Unpin,
impl<B> UnwindSafe for Skip<B>where
B: 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