pub struct RequestContext {
pub request: JsonRpcRequest,
pub metadata: HashMap<String, Value>,
pub timestamp: DateTime<Utc>,
}
Expand description
Context for request processing
Fields§
§request: JsonRpcRequest
The JSON-RPC request being processed
metadata: HashMap<String, Value>
Additional metadata (can be modified by plugins)
timestamp: DateTime<Utc>
Request timestamp
Implementations§
Source§impl RequestContext
impl RequestContext
Sourcepub fn new(request: JsonRpcRequest, metadata: HashMap<String, Value>) -> Self
pub fn new(request: JsonRpcRequest, metadata: HashMap<String, Value>) -> Self
Create a new request context
Sourcepub fn add_metadata(&mut self, key: String, value: Value)
pub fn add_metadata(&mut self, key: String, value: Value)
Add metadata
Sourcepub fn get_metadata(&self, key: &str) -> Option<&Value>
pub fn get_metadata(&self, key: &str) -> Option<&Value>
Get metadata value
Trait Implementations§
Source§impl Clone for RequestContext
impl Clone for RequestContext
Source§fn clone(&self) -> RequestContext
fn clone(&self) -> RequestContext
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 RequestContext
impl RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin for RequestContext
impl UnwindSafe for RequestContext
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