pub struct MiddlewareContext {
pub request_id: String,
pub user_id: Option<String>,
pub session_id: Option<String>,
pub correlation_id: Option<String>,
pub custom_data: HashMap<String, String>,
}
Expand description
Request-scoped middleware context for dependency injection
Fields§
§request_id: String
§user_id: Option<String>
§session_id: Option<String>
§correlation_id: Option<String>
§custom_data: HashMap<String, String>
Implementations§
Source§impl MiddlewareContext
impl MiddlewareContext
Sourcepub fn from_request(request: &ElifRequest) -> Self
pub fn from_request(request: &ElifRequest) -> Self
Create middleware context from request
Trait Implementations§
Source§impl Clone for MiddlewareContext
impl Clone for MiddlewareContext
Source§fn clone(&self) -> MiddlewareContext
fn clone(&self) -> MiddlewareContext
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 moreAuto Trait Implementations§
impl Freeze for MiddlewareContext
impl RefUnwindSafe for MiddlewareContext
impl Send for MiddlewareContext
impl Sync for MiddlewareContext
impl Unpin for MiddlewareContext
impl UnwindSafe for MiddlewareContext
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