ResponseExt

Trait ResponseExt 

Source
pub trait ResponseExt
where Self: Sized,
{ // Required methods fn error_for_status(self) -> Result<Self>; fn text<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<String>> + Send + 'async_trait>> where Self: 'async_trait; fn json<'async_trait, U>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<U>> + Send + 'async_trait>> where U: 'async_trait + DeserializeOwned, Self: 'async_trait; fn bytes<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<Bytes>> + Send + 'async_trait>> where Self: 'async_trait; fn get_cookie(&self, name: &str) -> Option<&str>; }

Required Methods§

Source

fn error_for_status(self) -> Result<Self>

Source

fn text<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<String>> + Send + 'async_trait>>
where Self: 'async_trait,

Source

fn json<'async_trait, U>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<U>> + Send + 'async_trait>>
where U: 'async_trait + DeserializeOwned, Self: 'async_trait,

Source

fn bytes<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,

Get body as bytes.

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.

Implementations on Foreign Types§

Source§

impl ResponseExt for Response<Body>

Source§

fn bytes<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,

Get body as bytes.

Source§

fn error_for_status(self) -> Result<Self>

Source§

fn text<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<String>> + Send + 'async_trait>>
where Self: 'async_trait,

Source§

fn json<'async_trait, U>( self, ) -> Pin<Box<dyn Future<Output = InMemoryResult<U>> + Send + 'async_trait>>
where U: 'async_trait + DeserializeOwned, Self: 'async_trait,

Implementors§