pub struct Passphrase { /* private fields */ }
Expand description
WPA passphrase.
Passphrases are UTF-8 encoded and the underlying representation is String
.
Implementations§
Source§impl Passphrase
impl Passphrase
Sourcepub fn try_write_with<F>(self, f: F) -> Result<Self, PassphraseError>
pub fn try_write_with<F>(self, f: F) -> Result<Self, PassphraseError>
Consumes the Passphrase
and performs a fallible write.
The function f
is used to mutate the String
representation of the passphrase.
§Errors
Returns an error if the mutated String
is not a valid WPA passphrase. Namely, the
String
must consist of between PASSPHRASE_MIN_SIZE_BYTES
and
PASSPHRASE_MAX_SIZE_BYTES
bytes (not characters or graphemes).
Note that if an error is returned, then the Passphrase
is consumed. Use clone
to
recover the original Passphrase
.
Trait Implementations§
Source§impl AsRef<[u8]> for Passphrase
impl AsRef<[u8]> for Passphrase
Source§impl AsRef<str> for Passphrase
impl AsRef<str> for Passphrase
Source§impl Clone for Passphrase
impl Clone for Passphrase
Source§fn clone(&self) -> Passphrase
fn clone(&self) -> Passphrase
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 Debug for Passphrase
impl Debug for Passphrase
Source§impl From<Passphrase> for BareCredentials
impl From<Passphrase> for BareCredentials
Conversion from a WPA passphrase into bare credentials.
Source§fn from(passphrase: Passphrase) -> Self
fn from(passphrase: Passphrase) -> Self
Converts to this type from the input type.
Source§impl From<Passphrase> for String
impl From<Passphrase> for String
Source§fn from(passphrase: Passphrase) -> Self
fn from(passphrase: Passphrase) -> Self
Converts to this type from the input type.
Source§impl From<Passphrase> for Vec<u8>
impl From<Passphrase> for Vec<u8>
Source§fn from(passphrase: Passphrase) -> Self
fn from(passphrase: Passphrase) -> Self
Converts to this type from the input type.
Source§impl From<Passphrase> for Wpa1Credentials
impl From<Passphrase> for Wpa1Credentials
Source§fn from(passphrase: Passphrase) -> Self
fn from(passphrase: Passphrase) -> Self
Converts to this type from the input type.
Source§impl From<Passphrase> for Wpa2PersonalCredentials
impl From<Passphrase> for Wpa2PersonalCredentials
Source§fn from(passphrase: Passphrase) -> Self
fn from(passphrase: Passphrase) -> Self
Converts to this type from the input type.
Source§impl From<Passphrase> for Wpa3PersonalCredentials
impl From<Passphrase> for Wpa3PersonalCredentials
Source§fn from(passphrase: Passphrase) -> Self
fn from(passphrase: Passphrase) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Passphrase
impl PartialEq for Passphrase
Source§impl<'a> TryFrom<&'a [u8]> for Passphrase
impl<'a> TryFrom<&'a [u8]> for Passphrase
Source§type Error = PassphraseError
type Error = PassphraseError
The type returned in the event of a conversion error.
Source§impl<'a> TryFrom<&'a str> for Passphrase
impl<'a> TryFrom<&'a str> for Passphrase
Source§type Error = PassphraseError
type Error = PassphraseError
The type returned in the event of a conversion error.
Source§impl TryFrom<String> for Passphrase
impl TryFrom<String> for Passphrase
Source§type Error = PassphraseError
type Error = PassphraseError
The type returned in the event of a conversion error.
impl Eq for Passphrase
impl StructuralPartialEq for Passphrase
Auto Trait Implementations§
impl Freeze for Passphrase
impl RefUnwindSafe for Passphrase
impl Send for Passphrase
impl Sync for Passphrase
impl Unpin for Passphrase
impl UnwindSafe for Passphrase
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
)