pub struct Snr(/* private fields */);Expand description
Signal-to-noise ratio represented in centibels (0.1 dB units).
This uses a slightly finer unit than whole decibels while still staying compact and integer-friendly. Some common LoRa radios report SNR in quarter-dB steps. Converting those readings into centibels requires rounding, introducing at most 0.5 cB (0.05 dB) of error.
Implementations§
Source§impl Snr
impl Snr
Sourcepub const fn from_centibels(centibels: i16) -> Snr
pub const fn from_centibels(centibels: i16) -> Snr
Construct an SNR value directly from centibels.
Sourcepub const fn from_decibels(db: i8) -> Snr
pub const fn from_decibels(db: i8) -> Snr
Construct an SNR value from whole decibels.
Sourcepub const fn from_quarter_db_steps(steps: i16) -> Snr
pub const fn from_quarter_db_steps(steps: i16) -> Snr
Construct an SNR value from quarter-dB steps, rounding to the nearest centibel.
Sourcepub const fn as_centibels(self) -> i16
pub const fn as_centibels(self) -> i16
Return the stored value in centibels.
Trait Implementations§
Source§impl Ord for Snr
impl Ord for Snr
Source§impl PartialOrd for Snr
impl PartialOrd for Snr
impl Copy for Snr
impl Eq for Snr
impl StructuralPartialEq for Snr
Auto Trait Implementations§
impl Freeze for Snr
impl RefUnwindSafe for Snr
impl Send for Snr
impl Sync for Snr
impl Unpin for Snr
impl UnwindSafe for Snr
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)