pub struct Uplink {
pub packets: Vec<Rxpk>,
pub status: Option<Stat>,
}Expand description
What a PUSH_DATA carries: the packets heard, and the gateway’s own report.
Fields§
§packets: Vec<Rxpk>The packets, which may be none when only a report is being sent.
status: Option<Stat>The report, which a gateway sends every half minute or so.
Implementations§
Source§impl Uplink
impl Uplink
Sourcepub fn to_json(&self) -> String
pub fn to_json(&self) -> String
Writes the payload as the protocol carries it.
§Returns
The JSON text, with an rxpk array when there are packets and a stat object when
there is a report.
Sourcepub fn from_json(body: &[u8]) -> Result<Uplink, ProtocolError>
pub fn from_json(body: &[u8]) -> Result<Uplink, ProtocolError>
Reads the payload of a PUSH_DATA.
§Arguments
body- the bytes after the header and the gateway’s identifier.
§Returns
The packets and the report it carries.
§Errors
Returns ProtocolError::Payload when the body is not a JSON object, carries neither
an rxpk array nor a stat object, or holds an entry the protocol does not describe.
Trait Implementations§
impl StructuralPartialEq for Uplink
Auto Trait Implementations§
impl Freeze for Uplink
impl RefUnwindSafe for Uplink
impl Send for Uplink
impl Sync for Uplink
impl Unpin for Uplink
impl UnsafeUnpin for Uplink
impl UnwindSafe for Uplink
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