Skip to main content

ReadData

Struct ReadData 

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

Source

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().

Source

pub fn num_channels(&self) -> usize

Return the number of channels in this data.

Source

pub fn num_frames(&self) -> usize

Return the number of samples in a single channel of data.

Source

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

Source§

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

Source§

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.