pub enum UcanParseError {
MalformedJwt(usize),
Base64Decode {
segment: &'static str,
reason: String,
},
JsonParse {
segment: &'static str,
reason: String,
},
UnsupportedAlg(String),
UnsupportedTyp(String),
UnsupportedUcv(String),
NonAtdCap(String),
UnsupportedDidMethod {
field: &'static str,
did: String,
},
}Expand description
Errors returned by crate::ucan::parse_jwt.
All variants map to wire code ERR_UCAN_INVALID = 1010 —
retryable: false (deterministic; same token → same failure).
Variants§
MalformedJwt(usize)
JWT compact form requires exactly 3 .-separated segments.
Base64Decode
Header or payload base64url-decode failed.
JsonParse
Header or payload JSON deserialize failed.
UnsupportedAlg(String)
header.alg != "EdDSA". Spec §4.3.
UnsupportedTyp(String)
header.typ != "ucan/1.0+jwt". Spec §4.1.
UnsupportedUcv(String)
header.ucv != "1.0". Spec §4.1.
NonAtdCap(String)
payload.cmd != "atd-cap". Cross-system replay prevention,
spec §4.5.
UnsupportedDidMethod
iss or aud doesn’t start with did:key:z. Spec §4.4 —
did:web / did:agent are deferred to follow-up SPs.
Trait Implementations§
Source§impl Clone for UcanParseError
impl Clone for UcanParseError
Source§fn clone(&self) -> UcanParseError
fn clone(&self) -> UcanParseError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 UcanParseError
impl Debug for UcanParseError
Source§impl Display for UcanParseError
impl Display for UcanParseError
Source§impl Error for UcanParseError
impl Error for UcanParseError
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<UcanParseError> for UcanVerifyError
impl From<UcanParseError> for UcanVerifyError
Source§fn from(source: UcanParseError) -> Self
fn from(source: UcanParseError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UcanParseError
impl PartialEq for UcanParseError
Source§fn eq(&self, other: &UcanParseError) -> bool
fn eq(&self, other: &UcanParseError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for UcanParseError
impl StructuralPartialEq for UcanParseError
Auto Trait Implementations§
impl Freeze for UcanParseError
impl RefUnwindSafe for UcanParseError
impl Send for UcanParseError
impl Sync for UcanParseError
impl Unpin for UcanParseError
impl UnsafeUnpin for UcanParseError
impl UnwindSafe for UcanParseError
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