pub struct TrustedDevices { /* private fields */ }Expand description
The end devices a relay trusts, TRUSTED_ED_NUMBER of them, each at the index the
network gave it.
Implementations§
Source§impl TrustedDevices
impl TrustedDevices
Sourcepub const fn new() -> TrustedDevices
pub const fn new() -> TrustedDevices
Sourcepub fn get(&self, index: u8) -> Option<&TrustedDevice>
pub fn get(&self, index: u8) -> Option<&TrustedDevice>
Sourcepub fn get_mut(&mut self, index: u8) -> Option<&mut TrustedDevice>
pub fn get_mut(&mut self, index: u8) -> Option<&mut TrustedDevice>
Sourcepub fn set(&mut self, index: u8, device: TrustedDevice) -> bool
pub fn set(&mut self, index: u8, device: TrustedDevice) -> bool
Sourcepub fn remove(&mut self, index: u8) -> Option<TrustedDevice>
pub fn remove(&mut self, index: u8) -> Option<TrustedDevice>
Sourcepub fn iter(&self) -> impl Iterator<Item = (u8, &TrustedDevice)> + '_
pub fn iter(&self) -> impl Iterator<Item = (u8, &TrustedDevice)> + '_
Sourcepub fn open(
&mut self,
wor: &SealedWor,
carrier: Carrier,
) -> Option<Result<(u8, u32, Carrier), LorawanError>>
pub fn open( &mut self, wor: &SealedWor, carrier: Carrier, ) -> Option<Result<(u8, u32, Carrier), LorawanError>>
Checks and opens a wake-on-radio frame with the keys of whichever device it verifies for.
§Arguments
wor- the frame.carrier- the carrier it arrived on.
§Returns
The index of the device it came from, the full counter it carried, and where its
uplink follows; or None when no trusted device has the address it names.
§Errors
When devices have the address but the frame verifies for none of them, the last of
their errors, as TrustedDevice::open gives them.
Trait Implementations§
Source§impl Clone for TrustedDevices
impl Clone for TrustedDevices
Source§fn clone(&self) -> TrustedDevices
fn clone(&self) -> TrustedDevices
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TrustedDevices
Source§impl Debug for TrustedDevices
impl Debug for TrustedDevices
Source§impl Default for TrustedDevices
impl Default for TrustedDevices
Source§fn default() -> TrustedDevices
fn default() -> TrustedDevices
Returns the “default value” for a type. Read more
impl Eq for TrustedDevices
Source§impl PartialEq for TrustedDevices
impl PartialEq for TrustedDevices
impl StructuralPartialEq for TrustedDevices
Auto Trait Implementations§
impl Freeze for TrustedDevices
impl RefUnwindSafe for TrustedDevices
impl Send for TrustedDevices
impl Sync for TrustedDevices
impl Unpin for TrustedDevices
impl UnsafeUnpin for TrustedDevices
impl UnwindSafe for TrustedDevices
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