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
bytesis 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 duplicate 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§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§impl TryFrom<Credential> for Credential
impl TryFrom<Credential> for Credential
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more