pub struct BoxBody(_);
Expand description
A boxed message body with boxed errors.
Implementations§
source§impl BoxBody
impl BoxBody
sourcepub fn new<B>(body: B) -> BoxBodywhere
B: MessageBody + 'static,
pub fn new<B>(body: B) -> BoxBodywhere
B: MessageBody + 'static,
Boxes body type, erasing type information.
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§
source§impl 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
source§fn 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. Read more