pub struct ReadData<'a, T: Copy + Clone + Default + Send> { /* private fields */ }Expand description
The sample data returned by a ReadClient.
Implementations§
Source§impl<'a, T: Copy + Clone + Default + Send> ReadData<'a, T>
impl<'a, T: Copy + Clone + Default + Send> ReadData<'a, T>
Sourcepub fn read_channel(&self, channel: usize) -> &[T]
pub fn read_channel(&self, channel: usize) -> &[T]
Read a single channel of samples.
Use ReadData::num_channels() to get the number of available channels.
The length of this data will be equal to ReadData::num_frames().
Sourcepub fn num_channels(&self) -> usize
pub fn num_channels(&self) -> usize
Return the number of channels in this data.
Sourcepub fn num_frames(&self) -> usize
pub fn num_frames(&self) -> usize
Return the number of samples in a single channel of data.
Sourcepub fn reached_end_of_file(&self) -> bool
pub fn reached_end_of_file(&self) -> bool
This returns (true) if the last frame in this data is the end of the file, (false) otherwise.
Auto Trait Implementations§
impl<'a, T> Freeze for ReadData<'a, T>
impl<'a, T> RefUnwindSafe for ReadData<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ReadData<'a, T>where
T: Sync,
impl<'a, T> Sync for ReadData<'a, T>where
T: Sync,
impl<'a, T> Unpin for ReadData<'a, T>
impl<'a, T> UnsafeUnpin for ReadData<'a, T>
impl<'a, T> UnwindSafe for ReadData<'a, T>where
T: RefUnwindSafe,
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