pub struct TransmitterObservations { /* private fields */ }Expand description
A bounded, least-recently-heard table of transmitter observations.
Implementations§
Source§impl TransmitterObservations
impl TransmitterObservations
pub const fn new() -> Self
Sourcepub fn observe(
&mut self,
hint: RouterHint,
rssi_dbm: i16,
snr: Snr,
now_ms: u64,
)
pub fn observe( &mut self, hint: RouterHint, rssi_dbm: i16, snr: Snr, now_ms: u64, )
Record a reception from hint, replacing whatever was known before.
Only the latest reception is kept: a peer-repeater entry reports the most recent measurement, and an average across a moving neighbor would describe a link that no longer exists.
pub fn iter(&self) -> impl Iterator<Item = &TransmitterObservation>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get(&self, hint: &RouterHint) -> Option<&TransmitterObservation>
pub fn get(&self, hint: &RouterHint) -> Option<&TransmitterObservation>
The observation for one transmitter, if it is still held.
Trait Implementations§
Source§impl Clone for TransmitterObservations
impl Clone for TransmitterObservations
Source§fn clone(&self) -> TransmitterObservations
fn clone(&self) -> TransmitterObservations
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransmitterObservations
impl Debug for TransmitterObservations
Source§impl Default for TransmitterObservations
impl Default for TransmitterObservations
Source§fn default() -> TransmitterObservations
fn default() -> TransmitterObservations
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TransmitterObservations
impl RefUnwindSafe for TransmitterObservations
impl Send for TransmitterObservations
impl Sync for TransmitterObservations
impl Unpin for TransmitterObservations
impl UnwindSafe for TransmitterObservations
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)