Struct hyper_staticfile::FileResponseBuilder[][src]

pub struct FileResponseBuilder {
    pub cache_headers: Option<u32>,
    pub is_head: bool,
    pub if_modified_since: Option<DateTime<LocalTz>>,
}

Utility to build responses for serving a tokio::fs::File.

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

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

Whether this is a HEAD request, with no response body.

The parsed value of the If-Modified-Since request header.

Methods

impl FileResponseBuilder
[src]

Create a new builder with a default configuration.

Create a new builder for the given request.

Add cache headers to responses for the given lifespan.

Build responses for the given request method.

Build responses for the given If-Modified-Since request header value.

Build a response for the given file and metadata.

Trait Implementations

impl Clone for FileResponseBuilder
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for FileResponseBuilder
[src]

Formats the value using the given formatter. Read more

impl Default for FileResponseBuilder
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations