pub struct Stat {
pub time: Option<String>,
pub latitude_deg: Option<f64>,
pub longitude_deg: Option<f64>,
pub altitude_m: Option<i32>,
pub received: u32,
pub received_ok: u32,
pub forwarded: u32,
pub acknowledged_percent: f64,
pub downlinks: u32,
pub transmitted: u32,
}Expand description
The gateway’s own status report.
§Examples
use pamoja_gateway::udp::Stat;
let report = Stat::new().with_counts(2, 2, 2).with_downlinks(2, 2);
assert!(report.to_json().contains("\"rxfw\":2"));Fields§
§time: Option<String>The gateway’s clock, as time::expanded writes it.
latitude_deg: Option<f64>Its latitude in degrees, north positive.
longitude_deg: Option<f64>Its longitude in degrees, east positive.
altitude_m: Option<i32>Its altitude in meters.
received: u32How many packets its radio received.
received_ok: u32How many of those had a good CRC.
forwarded: u32How many it forwarded.
acknowledged_percent: f64What share of its datagrams were acknowledged, as a percentage.
downlinks: u32How many downlink datagrams it received.
transmitted: u32How many packets it transmitted.
Implementations§
Source§impl Stat
impl Stat
Sourcepub fn with_downlinks(self, downlinks: u32, transmitted: u32) -> Stat
pub fn with_downlinks(self, downlinks: u32, transmitted: u32) -> Stat
Sourcepub fn with_acknowledged_percent(self, percent: f64) -> Stat
pub fn with_acknowledged_percent(self, percent: f64) -> Stat
Trait Implementations§
impl StructuralPartialEq for Stat
Auto Trait Implementations§
impl Freeze for Stat
impl RefUnwindSafe for Stat
impl Send for Stat
impl Sync for Stat
impl Unpin for Stat
impl UnsafeUnpin for Stat
impl UnwindSafe for Stat
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