Trait InMemoryResponseExt

Source
pub trait InMemoryResponseExt {
    // Required methods
    fn new(status: StatusCode, headers: HeaderMap, body: InMemoryBody) -> Self;
    fn text(self) -> Result<String, Error>;
    fn json<U>(self) -> Result<U, Error>
       where U: DeserializeOwned;
    fn bytes(self) -> Result<Bytes, Error>;
    fn sanitize(&mut self);
    fn get_cookie(&self, name: &str) -> Option<&str>;
}

Required Methods§

Source

fn new(status: StatusCode, headers: HeaderMap, body: InMemoryBody) -> Self

Source

fn text(self) -> Result<String, Error>

Source

fn json<U>(self) -> Result<U, Error>

Source

fn bytes(self) -> Result<Bytes, Error>

Source

fn sanitize(&mut self)

Attempt to clear sensitive information from the response.

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 InMemoryResponseExt for Response<InMemoryBody>

Source§

fn sanitize(&mut self)

Attempt to clear sensitive information from the response.

Source§

fn new( status: StatusCode, headers: HeaderMap, body: InMemoryBody, ) -> Response<InMemoryBody>

Source§

fn text(self) -> Result<String, Error>

Source§

fn json<U>(self) -> Result<U, Error>

Source§

fn bytes(self) -> Result<Bytes, Error>

Implementors§