pub struct AuthenticatedUser<T> {
pub jwt: String,
pub claims: T,
}
Expand description
AuthenticatedUser with your given Claims struct will be extracted data to use in your functions. The struct may contain registered claims, these are validated according to RFC 7519
NOTE: It is expected that you create your own struct based on the JWT and claims you like to process.
Fields§
§jwt: String
The complete encoded token (without the Bearer part)
claims: T
The claims deserialized to the given struct T
Trait Implementations§
Source§impl<T: Clone> Clone for AuthenticatedUser<T>
impl<T: Clone> Clone for AuthenticatedUser<T>
Source§fn clone(&self) -> AuthenticatedUser<T>
fn clone(&self) -> AuthenticatedUser<T>
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<T: Debug> Debug for AuthenticatedUser<T>
impl<T: Debug> Debug for AuthenticatedUser<T>
Source§impl<'de, T> Deserialize<'de> for AuthenticatedUser<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for AuthenticatedUser<T>where
T: Deserialize<'de>,
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
Source§impl<T: for<'de> Deserialize<'de>> FromRequest for AuthenticatedUser<T>
impl<T: for<'de> Deserialize<'de>> FromRequest for AuthenticatedUser<T>
Source§type Future = Pin<Box<dyn Future<Output = Result<AuthenticatedUser<T>, <AuthenticatedUser<T> as FromRequest>::Error>>>>
type Future = Pin<Box<dyn Future<Output = Result<AuthenticatedUser<T>, <AuthenticatedUser<T> as FromRequest>::Error>>>>
Future that resolves to a
Self
. Read moreSource§fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
Create a
Self
from request parts asynchronously.Source§impl<T: PartialEq> PartialEq for AuthenticatedUser<T>
impl<T: PartialEq> PartialEq for AuthenticatedUser<T>
Source§impl<T> Serialize for AuthenticatedUser<T>where
T: Serialize,
impl<T> Serialize for AuthenticatedUser<T>where
T: Serialize,
impl<T> StructuralPartialEq for AuthenticatedUser<T>
Auto Trait Implementations§
impl<T> Freeze for AuthenticatedUser<T>where
T: Freeze,
impl<T> RefUnwindSafe for AuthenticatedUser<T>where
T: RefUnwindSafe,
impl<T> Send for AuthenticatedUser<T>where
T: Send,
impl<T> Sync for AuthenticatedUser<T>where
T: Sync,
impl<T> Unpin for AuthenticatedUser<T>where
T: Unpin,
impl<T> UnwindSafe for AuthenticatedUser<T>where
T: UnwindSafe,
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