Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§