pub struct BoxBody(/* private fields */);Expand description
Cloning this struct will clone the inner body but if it’s a stream it will not be cloned and instead a new empty body will be created
Implementations§
Source§impl BoxBody
impl BoxBody
Sourcepub fn new<B>(body: B) -> Selfwhere
B: MessageBody + Clone + 'static,
pub fn new<B>(body: B) -> Selfwhere
B: MessageBody + Clone + '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 Self>
pub fn as_pin_mut(&mut self) -> Pin<&mut Self>
Returns a mutable pinned reference to the inner message body type.
Trait Implementations§
Source§impl MessageBody for BoxBody
impl MessageBody for BoxBody
impl Send for BoxBody
Auto Trait Implementations§
impl !Freeze for BoxBody
impl !RefUnwindSafe for BoxBody
impl !Sync for BoxBody
impl Unpin for BoxBody
impl !UnwindSafe for BoxBody
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