pub struct RequestData {
pub correlation_id: u64,
pub timestamp: SystemTime,
pub method: Method,
pub uri: Uri,
pub headers: HashMap<String, Vec<Bytes>>,
pub body: Option<Bytes>,
}Expand description
Data captured from an HTTP request.
Contains all the information about an HTTP request that was captured by the middleware. The body is optionally captured based on the configuration.
§Examples
use outlet::types::RequestData;
use axum::http::{Method, Uri};
use std::time::SystemTime;
// This struct is typically created by the middleware, but you might
// encounter it in your RequestHandler implementationFields§
§correlation_id: u64Unique identifier for correlating this request with its response
timestamp: SystemTimeWhen the request was received by the middleware
method: MethodHTTP method (GET, POST, etc.)
uri: UriRequest URI including path and query parameters
headers: HashMap<String, Vec<Bytes>>HTTP request headers as key-value pairs (values as raw bytes - no encoding guarantees)
body: Option<Bytes>Request body bytes, if body capture is enabled and the body was successfully captured
Trait Implementations§
Source§impl Clone for RequestData
impl Clone for RequestData
Source§fn clone(&self) -> RequestData
fn clone(&self) -> RequestData
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 RequestData
impl RefUnwindSafe for RequestData
impl Send for RequestData
impl Sync for RequestData
impl Unpin for RequestData
impl UnwindSafe for RequestData
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