#[repr(transparent)]pub struct Psk(pub [u8; 32]);
Expand description
WPA pre-shared key (PSK).
Tuple Fields§
§0: [u8; 32]
Implementations§
Source§impl Psk
impl Psk
Sourcepub fn parse(bytes: impl AsRef<[u8]>) -> Result<Self, PskError>
pub fn parse(bytes: impl AsRef<[u8]>) -> Result<Self, PskError>
Parses a PSK from a byte sequence.
This function parses both unencoded and ASCII hexadecimal encoded PSKs.
Note that Psk
does not provide a mechanism to restore the original byte sequence parsed
by this function, so the exact encoding of ASCII hexadecimal encoded PSKs may be lost.
§Errors
Returns an error if the size or encoding of the byte sequence is incompatible.
Trait Implementations§
Source§impl From<Psk> for BareCredentials
impl From<Psk> for BareCredentials
Conversion from a WPA PSK into bare credentials.
Source§impl From<Psk> for Wpa1Credentials
impl From<Psk> for Wpa1Credentials
Source§impl From<Psk> for Wpa2PersonalCredentials
impl From<Psk> for Wpa2PersonalCredentials
Source§impl<'a> TryFrom<&'a [u8]> for Psk
impl<'a> TryFrom<&'a [u8]> for Psk
Converts unencoded bytes into a PSK.
This conversion is not a parse and does not accept ASCII hexadecimal encoded PSKs; the
bytes are copied as is. Use Psk::parse
for hexadecimal keys.
impl Eq for Psk
impl StructuralPartialEq for Psk
Auto Trait Implementations§
impl Freeze for Psk
impl RefUnwindSafe for Psk
impl Send for Psk
impl Sync for Psk
impl Unpin for Psk
impl UnwindSafe for Psk
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§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
)§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> OptionalField for Twhere
T: ?Sized,
impl<T> OptionalField for Twhere
T: ?Sized,
§impl<T> Pointable for T
impl<T> Pointable for T
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
)