pub struct HttpContext { /* private fields */ }Expand description
Concrete implementation of IHttpContext wrapping a hyper request and response.
Implementations§
Source§impl HttpContext
impl HttpContext
Sourcepub fn new(
req: Request<Incoming>,
limits: BodyLimits,
remote_addr: Option<SocketAddr>,
) -> HttpContext
pub fn new( req: Request<Incoming>, limits: BodyLimits, remote_addr: Option<SocketAddr>, ) -> HttpContext
Create a context around req.
No I/O happens here: the body stays a live stream until the endpoint
asks for it. remote_addr is the peer address captured by the accept
loop; None when the host cannot report it.
Sourcepub async fn into_response(self) -> Response<UnsyncBoxBody<Bytes, Error>>
pub async fn into_response(self) -> Response<UnsyncBoxBody<Bytes, Error>>
Finish the request and produce the hyper response.
Trait Implementations§
Source§impl IClaimsExt for HttpContext
impl IClaimsExt for HttpContext
Source§impl IHttpContext for HttpContext
impl IHttpContext for HttpContext
fn request(&self) -> &dyn IHttpRequest
fn request_mut(&mut self) -> &mut dyn IHttpRequest
fn response(&self) -> &dyn IHttpResponse
fn response_mut(&mut self) -> &mut dyn IHttpResponse
Auto Trait Implementations§
impl !Freeze for HttpContext
impl !RefUnwindSafe for HttpContext
impl !Sync for HttpContext
impl !UnwindSafe for HttpContext
impl Forget for HttpContext
impl Send for HttpContext
impl Unpin for HttpContext
impl UnsafeUnpin for HttpContext
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