Struct hyper_staticfile::ResponseBuilder
source · [−]pub struct ResponseBuilder<'a> {
pub path: &'a str,
pub query: Option<&'a str>,
pub file_response_builder: FileResponseBuilder,
}
Expand description
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
path: &'a str
The request path.
query: Option<&'a str>
The request query string.
file_response_builder: FileResponseBuilder
Inner file response builder.
Implementations
sourceimpl<'a> ResponseBuilder<'a>
impl<'a> ResponseBuilder<'a>
sourcepub fn request<B>(&mut self, req: &'a Request<B>) -> &mut Self
pub fn request<B>(&mut self, req: &'a Request<B>) -> &mut Self
Apply parameters based on a request.
sourcepub fn request_parts(
&mut self,
method: &Method,
uri: &'a Uri,
headers: &'a HeaderMap
) -> &mut Self
pub fn request_parts(
&mut self,
method: &Method,
uri: &'a Uri,
headers: &'a HeaderMap
) -> &mut Self
Apply parameters based on request parts.
sourcepub fn request_uri(&mut self, uri: &'a Uri) -> &mut Self
pub fn request_uri(&mut self, uri: &'a Uri) -> &mut Self
Apply parameters based on a request URI.
sourcepub fn cache_headers(&mut self, value: Option<u32>) -> &mut Self
pub fn cache_headers(&mut self, value: Option<u32>) -> &mut Self
Add cache headers to responses for the given lifespan.
Trait Implementations
sourceimpl<'a> Clone for ResponseBuilder<'a>
impl<'a> Clone for ResponseBuilder<'a>
sourcefn clone(&self) -> ResponseBuilder<'a>
fn clone(&self) -> ResponseBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for ResponseBuilder<'a>
impl<'a> Debug for ResponseBuilder<'a>
sourceimpl<'a> Default for ResponseBuilder<'a>
impl<'a> Default for ResponseBuilder<'a>
sourcefn default() -> ResponseBuilder<'a>
fn default() -> ResponseBuilder<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for ResponseBuilder<'a>
impl<'a> Send for ResponseBuilder<'a>
impl<'a> Sync for ResponseBuilder<'a>
impl<'a> Unpin for ResponseBuilder<'a>
impl<'a> UnwindSafe for ResponseBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more