Skip to main content

RequestExt

Trait RequestExt 

Source
pub trait RequestExt {
    // Required methods
    fn body_string(&mut self) -> impl Future<Output = Result<String>> + Send;
    fn body_bytes(&mut self) -> impl Future<Output = Result<Bytes>> + Send;
}
Expand description

Extension trait for Request to provide helper methods

Required Methods§

Source

fn body_string(&mut self) -> impl Future<Output = Result<String>> + Send

Read the entire body as a String

Source

fn body_bytes(&mut self) -> impl Future<Output = Result<Bytes>> + Send

Read the entire body as Bytes

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§