Struct tower_async_hyper::HyperBody
source · pub struct HyperBody { /* private fields */ }
Expand description
A wrapper around hyper::body::Incoming
that implements http_body::Body
.
This type is used to bridge the hyper
and tower-async
ecosystems.
Reason is that a lot of middlewares in tower-async-http
that
operate on http_body::Body
which also have to implement Default
.
Implementations§
source§impl Body
impl Body
sourcepub fn as_ref(&self) -> Option<&Incoming>
pub fn as_ref(&self) -> Option<&Incoming>
Return a reference to the inner hyper::body::Incoming
value.
This is normally not needed, but in case you do ever need it, it’s here.
sourcepub fn as_mut(&mut self) -> Option<&mut Incoming>
pub fn as_mut(&mut self) -> Option<&mut Incoming>
Return a mutable reference to the inner hyper::body::Incoming
value.
This is normally not needed, but in case you do ever need it, it’s here.
sourcepub fn into_inner(self) -> Option<Incoming>
pub fn into_inner(self) -> Option<Incoming>
Turn this Body
into the inner hyper::body::Incoming
value.
This is normally not needed, but in case you do ever need it, it’s here.
Trait Implementations§
source§impl Body for Body
impl Body for Body
impl<'__pin> Unpin for Bodywhere __Origin<'__pin>: Unpin,
Auto Trait Implementations§
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