1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5#[non_exhaustive]
6pub enum SampleType {
7 U8,
9 U16,
11 I16,
13}
14
15pub trait Sample: Copy + Default + Send + Sync + 'static {
17 const TYPE: SampleType;
19 const BITS: u8;
21}
22
23impl Sample for u8 {
24 const TYPE: SampleType = SampleType::U8;
25 const BITS: u8 = 8;
26}
27
28impl Sample for u16 {
29 const TYPE: SampleType = SampleType::U16;
30 const BITS: u8 = 16;
31}
32
33impl Sample for i16 {
34 const TYPE: SampleType = SampleType::I16;
35 const BITS: u8 = 16;
36}