pub struct MiddlewareContext {
pub request: Value,
pub response: Option<Value>,
pub request_id: Option<String>,
pub model: Option<String>,
pub metadata: HashMap<String, Value>,
}Fields§
§request: Value§response: Option<Value>§request_id: Option<String>§model: Option<String>§metadata: HashMap<String, Value>Implementations§
Source§impl MiddlewareContext
impl MiddlewareContext
pub fn new(request: Value) -> Self
pub fn set_response(&mut self, r: Value)
pub fn with_request_id(self, id: impl Into<String>) -> Self
pub fn with_model(self, m: impl Into<String>) -> Self
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