pub struct Key(/* private fields */);Expand description
A 16-byte key used for NVS storage (15 characters + null terminator)
Implementations§
Source§impl Key
impl Key
Sourcepub const fn from_array<const M: usize>(src: &[u8; M]) -> Self
pub const fn from_array<const M: usize>(src: &[u8; M]) -> Self
Creates a 16 byte, null-padded byte array used as key for values and namespaces.
Usage: Key::from_array(b"my_key")
Tip: use a const context if possible to ensure that the key is transformed at compile time:
let my_key = const { Key::from_array(b"my_key") };
Sourcepub const fn from_slice(src: &[u8]) -> Self
pub const fn from_slice(src: &[u8]) -> Self
Creates a 16 byte, null-padded byte array used as key for values and namespaces.
Usage: Key::from_slice(b"my_key")
Tip: use a const context if possible to ensure that the key is transformed at compile time:
let my_key = const { Key::from_slice("my_key".as_bytes()) };
Trait Implementations§
Source§impl Ord for Key
impl Ord for Key
Source§impl PartialOrd for Key
impl PartialOrd for Key
impl Copy for Key
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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