pub struct SessionInfo {
    pub info: Session,
    pub token: String,
}
Expand description

Struct for session information that can be retrieved for every access to a route that explicitly retrieves it.

Adding a State containing a SessionInfo to a route function’s parameters automatically means that the route will only be accessible by an authenticated user that passes its authentication info through cookies. If a SessionInfo can be retrieved given the cookies information, then the user is authenticated for using that route.

Fields

info: Session

Session info for the authenticated user.

token: String

Session token for the authenticated user.

Implementations

Generates a new session info from a SessionData gRPC message.

Trait Implementations

The associated error to be returned if derivation fails.
Derives an instance of Self from the incoming request metadata. Read more
Specifies what headers or other parameters are required for this Request Guards to validate successfully. Read more
Optionally add responses to the Request Guard. This can be used for when the request guard could return a “401 Unauthorized”. Or any other responses, other then one from the default response. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.
Wrap the input message T in a tonic::Request
Convert self to an expression for Diesel’s query builder. Read more
Convert &self to an expression for Diesel’s query builder. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more