pub struct Key1(/* private fields */);
Expand description
A compacted 2-byte key
This is defined specifically as the following conversion:
- Key8 bytes (
[u8; 8]
):[a, b, c, d, e, f, g, h]
- Key4 bytes (
u8
):a ^ b ^ c ^ d ^ e ^ f ^ g ^ h
Implementations§
Source§impl Key1
impl Key1
Sourcepub const fn from_key2(value: Key2) -> Self
pub const fn from_key2(value: Key2) -> Self
Convert from a 2-byte key
This is a lossy conversion, and can never fail
Sourcepub const fn from_key4(value: Key4) -> Self
pub const fn from_key4(value: Key4) -> Self
Convert from a 4-byte key
This is a lossy conversion, and can never fail
Sourcepub const fn from_key8(value: Key) -> Self
pub const fn from_key8(value: Key) -> Self
Convert from a full size 8-byte key
This is a lossy conversion, and can never fail
Sourcepub fn try_from_varkey(value: &VarKey) -> Option<Self>
pub fn try_from_varkey(value: &VarKey) -> Option<Self>
Create a Key1
from a VarKey
This method can never fail, but has the same API as other key types for consistency reasons.
Trait Implementations§
impl Copy for Key1
impl StructuralPartialEq for Key1
Auto Trait Implementations§
impl Freeze for Key1
impl RefUnwindSafe for Key1
impl Send for Key1
impl Sync for Key1
impl Unpin for Key1
impl UnwindSafe for Key1
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