Struct lorawan::maccommands::ChannelMask
source · pub struct ChannelMask<const N: usize>(/* private fields */);
Expand description
ChannelMask represents the ChannelMask from LoRaWAN.
Implementations§
source§impl<const N: usize> ChannelMask<N>
impl<const N: usize> ChannelMask<N>
sourcepub fn new(data: &[u8]) -> Result<Self, Error>
pub fn new(data: &[u8]) -> Result<Self, Error>
Constructs a new ChannelMask from the provided data.
pub fn set_bank(&mut self, index: usize, value: u8)
sourcepub fn set_channel(&mut self, channel: usize, set: bool)
pub fn set_channel(&mut self, channel: usize, set: bool)
Enable or disable a specific channel. Recall that LoRaWAN channel numbers start indexing at zero.
Improper use of this method could lead to out of bounds panic during runtime!
pub fn get_index(&self, index: usize) -> u8
sourcepub fn new_from_raw(data: &[u8]) -> Self
pub fn new_from_raw(data: &[u8]) -> Self
Constructs a new ChannelMask from the provided data, without verifying if they are admissible.
Improper use of this method could lead to panic during runtime!
Trait Implementations§
source§impl<const N: usize> Clone for ChannelMask<N>
impl<const N: usize> Clone for ChannelMask<N>
source§fn clone(&self) -> ChannelMask<N>
fn clone(&self) -> ChannelMask<N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<const N: usize> Debug for ChannelMask<N>
impl<const N: usize> Debug for ChannelMask<N>
source§impl<const N: usize> Default for ChannelMask<N>
impl<const N: usize> Default for ChannelMask<N>
source§impl<const N: usize> PartialEq for ChannelMask<N>
impl<const N: usize> PartialEq for ChannelMask<N>
source§fn eq(&self, other: &ChannelMask<N>) -> bool
fn eq(&self, other: &ChannelMask<N>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<const N: usize> Eq for ChannelMask<N>
impl<const N: usize> StructuralEq for ChannelMask<N>
impl<const N: usize> StructuralPartialEq for ChannelMask<N>
Auto Trait Implementations§
impl<const N: usize> RefUnwindSafe for ChannelMask<N>
impl<const N: usize> Send for ChannelMask<N>
impl<const N: usize> Sync for ChannelMask<N>
impl<const N: usize> Unpin for ChannelMask<N>
impl<const N: usize> UnwindSafe for ChannelMask<N>
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