pub struct AppSKey(/* private fields */);
Expand description
You can construct AppSKey from a hex-encoded MSB string or bytes in MSB format.
Typically, a LNS will provide a hex-encoded MSB string format such as: 00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF
.
To create from a string:
use lorawan::keys::AppSKey;
use core::str::FromStr;
let appskey = AppSKey::from_str("00112233445566778899aabbccddeeff").unwrap();
To create from a byte array, you should enter the bytes in MSB format:
use lorawan::keys::AppSKey;
let appskey = AppSKey::from([0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF]);
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for AppSKey
impl<'de> Deserialize<'de> for AppSKey
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
impl Copy for AppSKey
impl Eq for AppSKey
impl StructuralPartialEq for AppSKey
Auto Trait Implementations§
impl Freeze for AppSKey
impl RefUnwindSafe for AppSKey
impl Send for AppSKey
impl Sync for AppSKey
impl Unpin for AppSKey
impl UnwindSafe for AppSKey
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)