[][src]Struct hyper_staticfile::ResponseBuilder

pub struct ResponseBuilder {
    pub cache_headers: Option<u32>,
}

Utility to build the default response for a resolve result.

This struct allows direct access to its fields, but these fields are typically initialized by the accessors, using the builder pattern. The fields are basically a bunch of settings that determine the response details.

Fields

cache_headers: Option<u32>

Whether to send cache headers, and what lifespan to indicate.

Methods

impl ResponseBuilder[src]

pub fn new() -> Self[src]

Create a new builder with a default configuration.

pub fn cache_headers(&mut self, value: Option<u32>) -> &mut Self[src]

Add cache headers to responses for the given lifespan.

pub fn build<B>(
    &self,
    req: &Request<B>,
    result: ResolveResult
) -> Result<Response<Body>>
[src]

Build a response for the given request and resolve result.

This function may error if it response could not be constructed, but this should be a seldom occurrence.

Trait Implementations

impl Default for ResponseBuilder[src]

impl Clone for ResponseBuilder[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ResponseBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T