pub struct ToneCode(/* private fields */);Expand description
Validated tone code (index into CTCSS_FREQUENCIES).
Wraps a u8 index in the range 0..=50. Indices 0-49 are standard
CTCSS sub-audible tones. Index 50 is the 1750 Hz tone burst used for
European repeater access — it is NOT a CTCSS tone but a short
audio-frequency burst. Confirmed by ARFC-D75 decompilation.
Use ToneCode::frequency_hz to look up the corresponding frequency.
Implementations§
Source§impl ToneCode
impl ToneCode
Sourcepub const fn new(index: u8) -> Result<Self, ValidationError>
pub const fn new(index: u8) -> Result<Self, ValidationError>
Creates a new ToneCode from a raw index.
§Errors
Returns ValidationError::ToneCodeOutOfRange if index > 50.
Sourcepub const fn frequency_hz(self) -> f64
pub const fn frequency_hz(self) -> f64
Returns the CTCSS frequency in Hz for this tone code.
Trait Implementations§
impl Copy for ToneCode
impl Eq for ToneCode
impl StructuralPartialEq for ToneCode
Auto Trait Implementations§
impl Freeze for ToneCode
impl RefUnwindSafe for ToneCode
impl Send for ToneCode
impl Sync for ToneCode
impl Unpin for ToneCode
impl UnwindSafe for ToneCode
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