Struct audio_core::buf::Limit
source · pub struct Limit<B> { /* private fields */ }
Expand description
A buffer that has been limited.
See Buf::limit.
Trait Implementations§
source§impl<B> Buf for Limit<B>where
B: Buf,
impl<B> Buf for Limit<B>where
B: Buf,
§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 Limit<B>where
B: BufMut,
impl<B> BufMut for Limit<B>where
B: BufMut,
§type ChannelMut<'this> = <B as BufMut>::ChannelMut<'this>
where
Self: 'this
type ChannelMut<'this> = <B as BufMut>::ChannelMut<'this> where Self: 'this
The type of the mutable channel container.
§type IterChannelsMut<'this> = IterChannelsMut<<B as BufMut>::IterChannelsMut<'this>>
where
Self: 'this
type IterChannelsMut<'this> = IterChannelsMut<<B as BufMut>::IterChannelsMut<'this>> 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<B> ExactSizeBuf for Limit<B>where
B: ExactSizeBuf,
impl<B> ExactSizeBuf for Limit<B>where
B: ExactSizeBuf,
Limit adjusts the implementation of ExactSizeBuf to take the frame limiting into account.
use audio::{Buf, ExactSizeBuf};
let buf = audio::interleaved![[0; 4]; 2];
assert_eq!((&buf).limit(0).frames(), 0);
assert_eq!((&buf).limit(1).frames(), 1);
assert_eq!((&buf).limit(5).frames(), 4);
Auto Trait Implementations§
impl<B> RefUnwindSafe for Limit<B>where
B: RefUnwindSafe,
impl<B> Send for Limit<B>where
B: Send,
impl<B> Sync for Limit<B>where
B: Sync,
impl<B> Unpin for Limit<B>where
B: Unpin,
impl<B> UnwindSafe for Limit<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