pub struct Context {
pub request_id: String,
pub correlation_id: String,
pub credentials_token: CredentialsToken,
}
Fields§
§request_id: String
§correlation_id: String
§credentials_token: CredentialsToken
Implementations§
Source§impl Context
impl Context
Sourcepub fn extend<'a>(&'a self, token: &'a CredentialsToken) -> ExtendedContext<'a>
pub fn extend<'a>(&'a self, token: &'a CredentialsToken) -> ExtendedContext<'a>
Extends this Context to use the same request and Correlation Ids but a different token.
Mainly used in callbacks and similar.
pub fn as_extended(&self) -> ExtendedContext<'_>
Trait Implementations§
Source§impl<B> FromRequest<B> for Contextwhere
B: Send,
impl<B> FromRequest<B> for Contextwhere
B: Send,
Source§type Rejection = Error
type Rejection = Error
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>,
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>,
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform the extraction.
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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