pub struct Body { /* private fields */ }Expand description
A response body, read in the chunks the platform delivers. The body pulls from the network only while its reader keeps up. Dropping it before the end cancels the request.
Implementations§
Source§impl Body
impl Body
Sourcepub fn next_blocking(&mut self) -> Option<Result<Vec<u8>, HttpError>>
pub fn next_blocking(&mut self) -> Option<Result<Vec<u8>, HttpError>>
Wait for the next chunk on this thread. Never call it on the UI thread.
Sourcepub fn in_flight(&self) -> InFlight
pub fn in_flight(&self) -> InFlight
A grip that cancels this body’s request from any thread, also after
Body::read_async took the body.
Sourcepub fn expected_length(&self) -> Option<u64>
pub fn expected_length(&self) -> Option<u64>
Content-Length, when the response declared one.
Sourcepub fn metrics(&self) -> Option<Metrics>
pub fn metrics(&self) -> Option<Metrics>
Transfer metrics, once the platform reported them (usually just before the end).
Sourcepub fn resume(&self)
pub fn resume(&self)
Pull from the network again after Body::pause.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Body
impl !UnwindSafe for Body
impl Forget for Body
impl Freeze for Body
impl Move for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnsafeUnpin for Body
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