[][src]Trait hreq::server::ResponseBuilderExt

pub trait ResponseBuilderExt where
    Self: Sized
{ fn timeout(self, duration: Duration) -> Self;
fn timeout_millis(self, millis: u64) -> Self;
fn charset_encode(self, enable: bool) -> Self;
fn charset_encode_source(self, encoding: &str) -> Self;
fn content_encode(self, enabled: bool) -> Self;
fn with_body<B: Into<Body>>(self, body: B) -> Result<Response<Body>>;
fn with_json<B: Serialize + ?Sized>(
        self,
        body: &B
    ) -> Result<Response<Body>>; }

Extends http::response::Builder with ergonomic extras for hreq.

These extensions are part of the primary goal of hreq to provide a "User first API".

Required methods

fn timeout(self, duration: Duration) -> Self

fn timeout_millis(self, millis: u64) -> Self

fn charset_encode(self, enable: bool) -> Self

fn charset_encode_source(self, encoding: &str) -> Self

fn content_encode(self, enabled: bool) -> Self

fn with_body<B: Into<Body>>(self, body: B) -> Result<Response<Body>>

fn with_json<B: Serialize + ?Sized>(self, body: &B) -> Result<Response<Body>>

Loading content...

Implementations on Foreign Types

impl ResponseBuilderExt for Builder[src]

Loading content...

Implementors

Loading content...