Trait audio_core::Frame

source ·
pub trait Frame {
    type Sample: Copy;
    type Frame<'this>: Frame<Sample = Self::Sample>
       where Self: 'this;
    type Iter<'this>: Iterator<Item = Self::Sample>
       where Self: 'this;

    // Required methods
    fn as_frame(&self) -> Self::Frame<'_>;
    fn len(&self) -> usize;
    fn get(&self, channel: usize) -> Option<Self::Sample>;
    fn iter(&self) -> Self::Iter<'_>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

The buffer of a single frame.

Required Associated Types§

source

type Sample: Copy

The sample of a channel.

source

type Frame<'this>: Frame<Sample = Self::Sample> where Self: 'this

The type the frame assumes when coerced into a reference.

source

type Iter<'this>: Iterator<Item = Self::Sample> where Self: 'this

A borrowing iterator over the channel.

Required Methods§

source

fn as_frame(&self) -> Self::Frame<'_>

Reborrow the current frame as a reference.

source

fn len(&self) -> usize

Get the length which indicates number of samples in the current frame.

source

fn get(&self, channel: usize) -> Option<Self::Sample>

Get the sample at the given channel in the frame.

source

fn iter(&self) -> Self::Iter<'_>

Construct an iterator over the frame.

Provided Methods§

source

fn is_empty(&self) -> bool

Test if the current frame is empty.

Object Safety§

This trait is not object safe.

Implementors§