pub struct DtmfTable;Expand description
Zero-sized table wrapper for const and runtime utilities.
Implementations§
Source§impl DtmfTable
impl DtmfTable
pub const HIGHS: [u16; 4]
Sourcepub const ALL_TONES: [DtmfTone; 16]
pub const ALL_TONES: [DtmfTone; 16]
All tones as (key, low, high). Kept explicit to stay const.
Sourcepub const fn lookup_key(key: DtmfKey) -> (u16, u16)
pub const fn lookup_key(key: DtmfKey) -> (u16, u16)
Forward: key → (low, high) (const).
Sourcepub const fn from_pair_exact(low: u16, high: u16) -> Option<DtmfKey>
pub const fn from_pair_exact(low: u16, high: u16) -> Option<DtmfKey>
Reverse: exact (low, high) → key (const). Order-sensitive.
Sourcepub const fn from_pair_normalised(a: u16, b: u16) -> Option<DtmfKey>
pub const fn from_pair_normalised(a: u16, b: u16) -> Option<DtmfKey>
Reverse with normalisation (const): accepts (high, low) as well.
Sourcepub fn iter_keys(&self) -> Iter<'static, DtmfKey>
pub fn iter_keys(&self) -> Iter<'static, DtmfKey>
Iterate keys in keypad order (no allocation).
Sourcepub fn iter_tones(&self) -> Iter<'static, DtmfTone>
pub fn iter_tones(&self) -> Iter<'static, DtmfTone>
Iterate tones (key + freqs) in keypad order (no allocation).
Sourcepub fn from_pair_tol_u32(
&self,
low: u32,
high: u32,
tol_hz: u32,
) -> Option<DtmfKey>
pub fn from_pair_tol_u32( &self, low: u32, high: u32, tol_hz: u32, ) -> Option<DtmfKey>
Reverse lookup with tolerance in Hz (integer inputs).
Matches only when both low and high fall within ±tol_hz of a canonical pair.
Sourcepub fn from_pair_tol_f64(
&self,
low: f64,
high: f64,
tol_hz: f64,
) -> Option<DtmfKey>
pub fn from_pair_tol_f64( &self, low: f64, high: f64, tol_hz: f64, ) -> Option<DtmfKey>
Reverse lookup with tolerance for floating-point estimates (e.g., FFT bin centres).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DtmfTable
impl RefUnwindSafe for DtmfTable
impl Send for DtmfTable
impl Sync for DtmfTable
impl Unpin for DtmfTable
impl UnwindSafe for DtmfTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more