#[non_exhaustive]pub enum CredentialError {
InvalidContext {
expected: &'static str,
},
MissingType(&'static str),
NoSubject,
InvalidValidity {
from: &'static str,
until: &'static str,
},
MultipleSubjects(usize),
MissingClaim(&'static str),
InvalidClaim {
claim: &'static str,
reason: String,
},
ClaimMismatch {
claim: &'static str,
property: &'static str,
},
UnsupportedMediaType {
kind: &'static str,
media_type: String,
expected: &'static str,
},
NotDataUrl(String),
}Available on crate feature
vc only.Expand description
Why a credential or presentation is not well-formed, or cannot be mapped to or from the claims of a JWT.
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.
InvalidContext
The first @context is not the base context of the data model.
MissingType(&'static str)
type lacks the type the data model requires.
NoSubject
credentialSubject is an empty list.
InvalidValidity
The validity period ends before it starts.
Fields
MultipleSubjects(usize)
A JWT carries one sub, so a credential with several subjects has no JWT form.
MissingClaim(&'static str)
The JWT claims set lacks the claim the profile requires.
InvalidClaim
A JWT claim has the wrong shape or an invalid value.
ClaimMismatch
A JWT claim and the property it duplicates disagree.
Fields
UnsupportedMediaType
The enveloped credential or presentation is not in a form this crate reads.
Fields
NotDataUrl(String)
An enveloped credential or presentation does not hold a data: URL.
Trait Implementations§
Source§impl Clone for CredentialError
impl Clone for CredentialError
Source§impl Debug for CredentialError
impl Debug for CredentialError
Source§impl Display for CredentialError
impl Display for CredentialError
impl Eq for CredentialError
Source§impl Error for CredentialError
impl Error for CredentialError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CredentialError> for DomainLinkageError
Available on crate feature domain-linkage only.
impl From<CredentialError> for DomainLinkageError
Available on crate feature
domain-linkage only.Source§fn from(error: CredentialError) -> Self
fn from(error: CredentialError) -> Self
Converts to this type from the input type.
Source§impl From<CredentialError> for SdJwtCredentialV2Error
Available on crate feature sd-jwt only.
impl From<CredentialError> for SdJwtCredentialV2Error
Available on crate feature
sd-jwt only.Source§fn from(source: CredentialError) -> Self
fn from(source: CredentialError) -> Self
Converts to this type from the input type.
Source§impl From<CredentialError> for ValidationError
impl From<CredentialError> for ValidationError
Source§fn from(source: CredentialError) -> Self
fn from(source: CredentialError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CredentialError
impl PartialEq for CredentialError
impl StructuralPartialEq for CredentialError
Auto Trait Implementations§
impl Freeze for CredentialError
impl RefUnwindSafe for CredentialError
impl Send for CredentialError
impl Sync for CredentialError
impl Unpin for CredentialError
impl UnsafeUnpin for CredentialError
impl UnwindSafe for CredentialError
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.