Sample

Trait Sample 

Source
pub unsafe trait Sample {
    const DEFAULT_FORMAT: Format;

    // Required methods
    fn test(format: Format) -> bool;
    fn describe() -> &'static str;
}
Available on crate feature alsa only.
Expand description

Trait used to designate types which are sample-appropriate for Pcm.

§Safety

This trait is unsafe to implement, because an incorrectly implemented format test might have safety implications.

Required Associated Constants§

Source

const DEFAULT_FORMAT: Format

The default format to use for this sample.

Required Methods§

Source

fn test(format: Format) -> bool

Test if the given format is appropriate for this sample type.

Source

fn describe() -> &'static str

A static description of the sample type.

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.

Implementations on Foreign Types§

Source§

impl Sample for f32

Source§

const DEFAULT_FORMAT: Format = Format::FloatLE

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Source§

impl Sample for f64

Source§

const DEFAULT_FORMAT: Format = Format::Float64LE

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Source§

impl Sample for i8

Source§

const DEFAULT_FORMAT: Format = Format::S8

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Source§

impl Sample for i16

Source§

const DEFAULT_FORMAT: Format = Format::S16LE

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Source§

impl Sample for i32

Source§

const DEFAULT_FORMAT: Format = Format::S32LE

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Source§

impl Sample for u8

Source§

const DEFAULT_FORMAT: Format = Format::U8

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Source§

impl Sample for u16

Source§

const DEFAULT_FORMAT: Format = Format::U16LE

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Source§

impl Sample for u32

Source§

const DEFAULT_FORMAT: Format = Format::U32LE

Source§

fn test(format: Format) -> bool

Source§

fn describe() -> &'static str

Implementors§