pub trait InterleavedBuf {
    type Sample;

    // Required method
    fn as_interleaved(&self) -> &[Self::Sample];
}
Expand description

A trait describing a buffer that is interleaved.

This allows for accessing the raw underlying interleaved buffer.

Required Associated Types§

source

type Sample

The type of a single sample.

Required Methods§

source

fn as_interleaved(&self) -> &[Self::Sample]

Access the underlying raw interleaved buffer.

Examples
use audio::InterleavedBuf;

fn test(buf: impl InterleavedBuf<Sample = i16>) {
    assert_eq!(buf.as_interleaved(), &[1, 1, 2, 2, 3, 3, 4, 4]);
}

test(audio::interleaved![[1, 2, 3, 4]; 2]);

Implementations on Foreign Types§

source§

impl<B> InterleavedBuf for &B
where B: ?Sized + InterleavedBuf,

§

type Sample = <B as InterleavedBuf>::Sample

source§

fn as_interleaved(&self) -> &[Self::Sample]

source§

impl<B> InterleavedBuf for &mut B
where B: ?Sized + InterleavedBuf,

§

type Sample = <B as InterleavedBuf>::Sample

source§

fn as_interleaved(&self) -> &[Self::Sample]

Implementors§