pub struct Context { /* private fields */ }Expand description
Data associated with a request-response lifecycle.
Implementations§
Source§impl Context
impl Context
Sourcepub fn set_instance(&mut self, instance: String)
pub fn set_instance(&mut self, instance: String)
Sets the instance.
Sourcepub fn set_trace_id(&mut self, trace_id: Uuid)
pub fn set_trace_id(&mut self, trace_id: Uuid)
Sets the trace ID.
Sourcepub fn set_session_id(&mut self, session_id: Option<String>)
pub fn set_session_id(&mut self, session_id: Option<String>)
Sets the session ID.
Sourcepub fn set_locale(&mut self, locale: LanguageIdentifier)
Available on crate feature i18n only.
pub fn set_locale(&mut self, locale: LanguageIdentifier)
i18n only.Sets the locale.
Sourcepub fn start_time(&self) -> Instant
pub fn start_time(&self) -> Instant
Returns the start time.
Sourcepub fn request_id(&self) -> Uuid
pub fn request_id(&self) -> Uuid
Returns the request ID.
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
Returns the session ID.
Sourcepub fn locale(&self) -> Option<&LanguageIdentifier>
Available on crate feature i18n only.
pub fn locale(&self) -> Option<&LanguageIdentifier>
i18n only.Returns the locale.
Trait Implementations§
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