Trait rotary::Buf[][src]

pub trait Buf<T> {
    fn channels(&self) -> usize;
fn is_masked(&self, channel: usize) -> bool;
fn channel(&self, channel: usize) -> BufChannel<'_, T>; }

A trait describing an immutable audio buffer.

Required methods

fn channels(&self) -> usize[src]

The number of channels in the buffer.

fn is_masked(&self, channel: usize) -> bool[src]

Test if the given channel is masked.

fn channel(&self, channel: usize) -> BufChannel<'_, T>[src]

Return a handler to the buffer associated with the channel.

Note that we don’t access the buffer for the underlying channel directly as a linear buffer like &[T], because the underlying representation might be different.

We must instead make use of the various utility functions found on BufChannel to copy data out of the channel.

Panics

Panics if the specified channel is out of bound as reported by Buf::channels.

Loading content...

Implementations on Foreign Types

impl<T> Buf<T> for Vec<Vec<T>>[src]

The simple vector of vectors buffer where an empty vector indicates that the channel is masked.

impl<T> Buf<T> for [Vec<T>][src]

The simple slice of vectors buffer where an empty vector indicates that the channel is masked.

Loading content...

Implementors

impl<T> Buf<T> for Dynamic<T> where
    T: Sample
[src]

impl<T> Buf<T> for Interleaved<T> where
    T: Sample
[src]

impl<T> Buf<T> for Sequential<T> where
    T: Sample
[src]

impl<T, M> Buf<T> for MaskedDynamic<T, M> where
    T: Sample,
    M: Mask
[src]

Loading content...