pub enum Credential {
None,
Password(Vec<u8>),
Psk(Vec<u8>),
}
Expand description
The credential of a network connection. It mirrors the fidl_fuchsia_wlan_policy Credential
Variants§
Implementations§
source§impl Credential
impl Credential
sourcepub fn from_bytes(bytes: impl AsRef<[u8]> + Into<Vec<u8>>) -> Self
pub fn from_bytes(bytes: impl AsRef<[u8]> + Into<Vec<u8>>) -> Self
Returns:
- an Open-Credential instance iff
bytes
is empty, - a Password-Credential in all other cases. This function does not support reading PSK from bytes because the PSK byte length overlaps with a valid password length. This function should only be used to load legacy data, where PSK was not supported. Note: This function is of temporary nature to support legacy code.
sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Transform credential into the bytes that represent the credential, dropping the information of the type. This is used to support the legacy storage method.
sourcepub fn derived_security_type(&self) -> SecurityType
pub fn derived_security_type(&self) -> SecurityType
Choose a security type that fits the credential while we don’t actually know the security type of the saved networks. This should only be used if we don’t have a specified security type.
pub fn type_str(&self) -> &str
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for Credential
impl<'arbitrary> Arbitrary<'arbitrary> for Credential
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given unstructured data. Read moresource§impl Clone for Credential
impl Clone for Credential
source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
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 Credential
impl Debug for Credential
source§impl From<Credential> for Credential
impl From<Credential> for Credential
source§fn from(credential: Credential) -> Self
fn from(credential: Credential) -> Self
Converts to this type from the input type.
source§impl From<Credential> for Credential
impl From<Credential> for Credential
source§fn from(item: Credential) -> Self
fn from(item: Credential) -> Self
Converts to this type from the input type.
source§impl From<Credential> for Credential
impl From<Credential> for Credential
source§fn from(item: Credential) -> Self
fn from(item: Credential) -> Self
Converts to this type from the input type.
source§impl PartialEq for Credential
impl PartialEq for Credential
source§fn eq(&self, other: &Credential) -> bool
fn eq(&self, other: &Credential) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<Credential> for Credential
impl TryFrom<Credential> for Credential
source§fn try_from(credential: Credential) -> Result<Self, Self::Error>
fn try_from(credential: Credential) -> Result<Self, Self::Error>
Create a Credential from a fidl Crednetial value.
§type Error = NetworkConfigError
type Error = NetworkConfigError
The type returned in the event of a conversion error.
impl StructuralPartialEq for Credential
Auto Trait Implementations§
impl Freeze for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnwindSafe for Credential
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