Struct hyper_staticfile::FileResponseBuilder [−][src]
pub struct FileResponseBuilder {
pub cache_headers: Option<u32>,
pub is_head: bool,
pub if_modified_since: Option<SystemTime>,
pub range: Option<String>,
pub if_range: Option<String>,
}
Expand description
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
cache_headers: Option<u32>
Whether to send cache headers, and what lifespan to indicate.
is_head: bool
Whether this is a HEAD
request, with no response body.
if_modified_since: Option<SystemTime>
The parsed value of the If-Modified-Since
request header.
range: Option<String>
The file ranges to read, if any, otherwise we read from the beginning.
if_range: Option<String>
The unparsed value of the If-Range
request header. May match etag or last-modified.
Implementations
Apply parameters based on a request.
Apply parameters based on request parts.
Apply parameters based on a request method.
Apply parameters based on request headers.
Add cache headers to responses for the given lifespan.
Set whether this is a HEAD
request, with no response body.
Build responses for the given If-Modified-Since
date-time.
Build responses for the given If-Modified-Since
request header value.
Build responses for the given If-Range
request header value.
Build responses for the given Range
request header value.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for FileResponseBuilder
impl Send for FileResponseBuilder
impl Sync for FileResponseBuilder
impl Unpin for FileResponseBuilder
impl UnwindSafe for FileResponseBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more