pub struct RequestContext { /* private fields */ }Expand description
Re-exported public API.
Public Caelix type RequestContext.
Implementations§
Source§impl RequestContext
impl RequestContext
Sourcepub fn new(
method: impl Into<String>,
path: impl Into<String>,
headers: HashMap<String, String>,
) -> Self
pub fn new( method: impl Into<String>, path: impl Into<String>, headers: HashMap<String, String>, ) -> Self
Runs the new public API operation.
Sourcepub fn with_peer_addr(self, peer_addr: SocketAddr) -> Self
pub fn with_peer_addr(self, peer_addr: SocketAddr) -> Self
Sets the immediate socket peer address.
Sourcepub fn peer_addr(&self) -> Option<SocketAddr>
pub fn peer_addr(&self) -> Option<SocketAddr>
Returns the immediate socket peer address, when the runtime supplied one.
Sourcepub fn request_id(&self) -> &str
pub fn request_id(&self) -> &str
Returns the accepted incoming X-Request-Id, or a generated UUID.
Sourcepub fn trace_id(&self) -> &str
pub fn trace_id(&self) -> &str
Returns the W3C traceparent trace ID, X-Trace-Id, or request ID fallback.
Sourcepub fn attach_correlation_headers(&self, response: HttpResponse) -> HttpResponse
pub fn attach_correlation_headers(&self, response: HttpResponse) -> HttpResponse
Adds this request’s correlation identifiers to an HTTP response.
Sourcepub fn bearer_token(&self) -> Option<&str>
pub fn bearer_token(&self) -> Option<&str>
Runs the bearer_token public API operation.
Returns the first cookie with name.
Auto Trait Implementations§
impl !Freeze for RequestContext
impl RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin for RequestContext
impl UnsafeUnpin 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