pub enum Authorization {
Ucan(Ucan),
Cid(Cid),
}Expand description
An Authorization is a wrapper around something that can be resolved into a Ucan. Typically this is a Cid, but it may also be something like a Ucan itself, or a UcanIpld, or a Jwt. We don’t want to deal with each of these heterogenous types separately, so we move them around as an Authorization instead. TODO(ucan-wg/rs-ucan#32): Maybe swap this out is we get a substantially similar construct to land in rs-ucan
Variants§
Implementations§
Source§impl Authorization
impl Authorization
Sourcepub async fn as_ucan<S: UcanJwtStore>(&self, store: &S) -> Result<Ucan>
pub async fn as_ucan<S: UcanJwtStore>(&self, store: &S) -> Result<Ucan>
Attempt to resolve the Authorization as a fully deserialized Ucan (if it is not one already).
Sourcepub async fn as_proof_chain<S: UcanJwtStore>(
&self,
store: &S,
) -> Result<ProofChain>
pub async fn as_proof_chain<S: UcanJwtStore>( &self, store: &S, ) -> Result<ProofChain>
Attempt to resolve the Authorization as a ProofChain (via its associated Ucan)
Trait Implementations§
Source§impl Clone for Authorization
impl Clone for Authorization
Source§fn clone(&self) -> Authorization
fn clone(&self) -> Authorization
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 Authorization
impl Debug for Authorization
Source§impl Display for Authorization
impl Display for Authorization
Source§impl From<Cid<64>> for Authorization
impl From<Cid<64>> for Authorization
Source§impl FromStr for Authorization
impl FromStr for Authorization
Source§impl TryFrom<&Authorization> for Cid
impl TryFrom<&Authorization> for Cid
Auto Trait Implementations§
impl Freeze for Authorization
impl RefUnwindSafe for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Unpin for Authorization
impl UnwindSafe for Authorization
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