pub struct Token {
pub header: TokenHeader,
pub body: TokenBody,
pub method: Arc<dyn SigningMethod>,
}Expand description
Token is a Protobuf Web Token consisting of a header, body, and signing method.
Fields§
§header: TokenHeader§body: TokenBody§method: Arc<dyn SigningMethod>Implementations§
Source§impl Token
impl Token
Sourcepub fn new<M: SigningMethod + 'static>(method: M, body: TokenBody) -> Self
pub fn new<M: SigningMethod + 'static>(method: M, body: TokenBody) -> Self
new creates a token using version “1.0” with the provided signing method.
Sourcepub fn new_versioned<M: SigningMethod + 'static>(
method: M,
body: TokenBody,
version: &str,
) -> Self
pub fn new_versioned<M: SigningMethod + 'static>( method: M, body: TokenBody, version: &str, ) -> Self
new_versioned creates a token with the supplied version string.
Sourcepub fn new_with_claims<M: SigningMethod + 'static>(
method: M,
body: TokenBody,
) -> Self
pub fn new_with_claims<M: SigningMethod + 'static>( method: M, body: TokenBody, ) -> Self
new_with_claims mirrors jwt.NewWithClaims for compatibility.
Sourcepub fn new_with_method(
method: Arc<dyn SigningMethod>,
body: TokenBody,
version: Option<&str>,
) -> Self
pub fn new_with_method( method: Arc<dyn SigningMethod>, body: TokenBody, version: Option<&str>, ) -> Self
new_with_method creates a token using the provided signing method instance.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Token
impl !UnwindSafe for Token
impl Freeze for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
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