pub struct BoxBody(_);
Expand description
A boxed message body with boxed errors.
Implementations
sourceimpl BoxBody
impl BoxBody
sourcepub fn new<B>(body: B) -> BoxBody where
B: 'static + MessageBody,
pub fn new<B>(body: B) -> BoxBody where
B: 'static + MessageBody,
Same as MessageBody::boxed
.
If the body type to wrap is unknown or generic it is better to use MessageBody::boxed
to
avoid double boxing.
sourcepub fn as_pin_mut(&mut self) -> Pin<&mut BoxBody>
pub fn as_pin_mut(&mut self) -> Pin<&mut BoxBody>
Returns a mutable pinned reference to the inner message body type.
Trait Implementations
sourceimpl MessageBody for BoxBody
impl MessageBody for BoxBody
type Error = Box<dyn Error + 'static, Global>
type Error = Box<dyn Error + 'static, Global>
The type of error that will be returned if streaming body fails. Read more
sourcefn poll_next(
self: Pin<&mut BoxBody>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, <BoxBody as MessageBody>::Error>>>
fn poll_next(
self: Pin<&mut BoxBody>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, <BoxBody as MessageBody>::Error>>>
Attempt to pull out the next chunk of body bytes.
Auto Trait Implementations
impl !RefUnwindSafe for BoxBody
impl !Send for BoxBody
impl !Sync for BoxBody
impl Unpin for BoxBody
impl !UnwindSafe for BoxBody
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more