Skip to main content

Sample

Trait Sample 

Source
pub trait Sample: Sealed + Copy {
    // Required method
    fn to_f32(self) -> f32;
}
Expand description

A sample type accepted by Analyzer::push_planar and Analyzer::push_interleaved.

Sealed: only f32 (and f64 under the f64 feature) implement this trait. Adding more sample types is a deliberate API change.

Required Methods§

Source

fn to_f32(self) -> f32

Convert the sample to the analyzer’s internal f32 representation.

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§

fn to_f32(self) -> f32

Source§

impl Sample for f64

Available on crate feature f64 only.
Source§

fn to_f32(self) -> f32

Implementors§