Body

Trait Body 

Source
pub trait Body: AsyncRead {
    // Required method
    fn len(&self) -> Option<usize>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A trait representing an HTTP body.

Required Methods§

Source

fn len(&self) -> Option<usize>

Returns the exact remaining length of the iterator, if known.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true if the body is known to be empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§