pub struct LinkFeedbackSidecar {
pub version: u8,
pub received_at_unix_ms: u64,
pub loss_percent: f64,
pub rssi_dbm: f64,
pub snr_db: f64,
pub packets_received: u32,
pub fec_failed: u32,
pub bitrate_kbps: u32,
pub has_measurement: bool,
pub target_slot: u8,
}Expand description
The on-disk form: the received record plus when it arrived.
Fields§
§version: u8§received_at_unix_ms: u64Wall-clock milliseconds since the epoch when this record was received.
loss_percent: f64§rssi_dbm: f64§snr_db: f64§packets_received: u32§fec_failed: u32§bitrate_kbps: u32§has_measurement: bool§target_slot: u8The slot the record was addressed to, carried through so the consumer can prove it was the intended recipient rather than assuming it.
Implementations§
Source§impl LinkFeedbackSidecar
impl LinkFeedbackSidecar
Sourcepub fn now(fb: &LinkFeedback) -> Self
pub fn now(fb: &LinkFeedback) -> Self
Stamp a received record with the current wall clock.
Sourcepub fn stamped(fb: &LinkFeedback, received_at_unix_ms: u64) -> Self
pub fn stamped(fb: &LinkFeedback, received_at_unix_ms: u64) -> Self
Stamp with an explicit time (the seam the tests drive).
Sourcepub fn is_fresh_at(&self, now_unix_ms: u64) -> bool
pub fn is_fresh_at(&self, now_unix_ms: u64) -> bool
Whether this record is recent enough to act on, given a current epoch-ms reading. A record stamped in the future (a clock step) is treated as stale, not as infinitely fresh.
Sourcepub fn is_usable_at(&self, now_unix_ms: u64) -> bool
pub fn is_usable_at(&self, now_unix_ms: u64) -> bool
Whether this record is a usable ladder input right now: fresh AND an actual measurement. Both gates in one place so no caller can apply one and forget the other.
Trait Implementations§
Source§impl Clone for LinkFeedbackSidecar
impl Clone for LinkFeedbackSidecar
Source§impl Debug for LinkFeedbackSidecar
impl Debug for LinkFeedbackSidecar
Source§impl<'de> Deserialize<'de> for LinkFeedbackSidecar
impl<'de> Deserialize<'de> for LinkFeedbackSidecar
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LinkFeedbackSidecar
impl RefUnwindSafe for LinkFeedbackSidecar
impl Send for LinkFeedbackSidecar
impl Sync for LinkFeedbackSidecar
impl Unpin for LinkFeedbackSidecar
impl UnsafeUnpin for LinkFeedbackSidecar
impl UnwindSafe for LinkFeedbackSidecar
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