#[non_exhaustive]pub enum Credential {
Basic(BasicCredential),
X509(CertificateChain),
Custom(CustomCredential),
}
Expand description
A MLS credential used to authenticate a group member.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Basic(BasicCredential)
Basic identifier-only credential.
§Warning
Basic credentials are inherently insecure since they can not be
properly validated. It is not recommended to use BasicCredential
in production applications.
X509(CertificateChain)
X.509 Certificate chain.
Custom(CustomCredential)
User provided custom credential.
Implementations§
Source§impl Credential
impl Credential
Sourcepub fn credential_type(&self) -> CredentialType
pub fn credential_type(&self) -> CredentialType
Credential type of the underlying credential.
Sourcepub fn as_basic(&self) -> Option<&BasicCredential>
pub fn as_basic(&self) -> Option<&BasicCredential>
Convert this enum into a BasicCredential
Returns None
if this credential is any other type.
Sourcepub fn as_x509(&self) -> Option<&CertificateChain>
pub fn as_x509(&self) -> Option<&CertificateChain>
Convert this enum into a CertificateChain
Returns None
if this credential is any other type.
Sourcepub fn as_custom(&self) -> Option<&CustomCredential>
pub fn as_custom(&self) -> Option<&CustomCredential>
Convert this enum into a CustomCredential
Returns None
if this credential is any other type.
Trait Implementations§
Source§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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Credential
impl Debug for Credential
Source§impl Hash for Credential
impl Hash for Credential
Source§impl MlsDecode for Credential
impl MlsDecode for Credential
fn mls_decode(reader: &mut &[u8]) -> Result<Credential, Error>
Source§impl MlsEncode for Credential
impl MlsEncode for Credential
Source§impl MlsSize for Credential
impl MlsSize for Credential
fn mls_encoded_len(&self) -> usize
Source§impl Ord for Credential
impl Ord for Credential
Source§fn cmp(&self, other: &Credential) -> Ordering
fn cmp(&self, other: &Credential) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Credential
impl PartialEq for Credential
Source§impl PartialOrd for Credential
impl PartialOrd for Credential
impl Eq 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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