pub struct AuthToken { /* private fields */ }Expand description
Implementation of the Pubky Auth spec.
Implementations§
Source§impl AuthToken
impl AuthToken
Sourcepub fn sign(keypair: &Keypair, capabilities: impl Into<Capabilities>) -> Self
pub fn sign(keypair: &Keypair, capabilities: impl Into<Capabilities>) -> Self
Sign a new AuthToken with given capabilities.
Sourcepub fn capabilities(&self) -> &[Capability]
pub fn capabilities(&self) -> &[Capability]
Returns the capabilities in this AuthToken.
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Serialize this AuthToken to its canonical binary representation.
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self, Error>
pub fn deserialize(bytes: &[u8]) -> Result<Self, Error>
Deserialize an AuthToken from its canonical binary representation.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AuthToken
impl<'de> Deserialize<'de> for AuthToken
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for AuthToken
Auto Trait Implementations§
impl Freeze for AuthToken
impl RefUnwindSafe for AuthToken
impl Send for AuthToken
impl Sync for AuthToken
impl Unpin for AuthToken
impl UnwindSafe for AuthToken
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