pub trait UseJWTOnResource<Claims, Algorithm, ReAuth, Args>where
Claims: Serialize + DeserializeOwned + 'static,
Algorithm: JWTAlgorithm + Clone,
Algorithm::SigningKey: Clone,
ReAuth: Handler<Args, Output = Result<(), Error>>,
Args: FromRequest,{
// Required method
fn use_jwt(
self,
authority: Authority<Claims, Algorithm, ReAuth, Args>,
) -> Resource<impl ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse, Error = ActixWebError, InitError = ()>>;
}Expand description
This trait gives the ability to call Self::use_jwt on the implemented type.
It is currently behind a features flag, use_jwt_on_resource, because it uses some experimental rust features.
Required Methods§
Sourcefn use_jwt(
self,
authority: Authority<Claims, Algorithm, ReAuth, Args>,
) -> Resource<impl ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse, Error = ActixWebError, InitError = ()>>
fn use_jwt( self, authority: Authority<Claims, Algorithm, ReAuth, Args>, ) -> Resource<impl ServiceFactory<ServiceRequest, Config = (), Response = ServiceResponse, Error = ActixWebError, InitError = ()>>
Calls wrap on the scope will passing the authority.
Then it adds the scope as a service on self.
If there is a crate::TokenSigner set on the authority, it is clone it and adds it as app data on self.
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.