Trait TokenService

Source
pub trait TokenService {
    // Required methods
    fn encode<'a, CLAIMS: Debug + Serialize + Deserialize<'a>>(
        &self,
        claims: CLAIMS,
    ) -> String;
    fn decode<CLAIMS: Debug + Serialize + DeserializeOwned>(
        &self,
        token: &str,
    ) -> Result<CLAIMS, DecodeError>;
}

Required Methods§

Source

fn encode<'a, CLAIMS: Debug + Serialize + Deserialize<'a>>( &self, claims: CLAIMS, ) -> String

Source

fn decode<CLAIMS: Debug + Serialize + DeserializeOwned>( &self, token: &str, ) -> Result<CLAIMS, DecodeError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§