pub trait SizedSample: Sample {
const FORMAT: SampleFormat;
}Expand description
A Sample type with a known corresponding SampleFormat.
This trait is automatically implemented for all primitive sample types and provides
a way to determine the SampleFormat at compile time.
§Example
use cpal::SizedSample;
assert_eq!(i16::FORMAT, cpal::SampleFormat::I16);
assert_eq!(f32::FORMAT, cpal::SampleFormat::F32);Required Associated Constants§
Sourceconst FORMAT: SampleFormat
const FORMAT: SampleFormat
The corresponding SampleFormat for this 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.