Enum poem::web::StaticFileResponse
source · pub enum StaticFileResponse {
Ok {
body: Body,
content_length: u64,
content_type: Option<String>,
etag: Option<String>,
last_modified: Option<String>,
content_range: Option<(Range<u64>, u64)>,
},
NotModified,
}
Expand description
A response for static file extractor.
Variants§
Implementations§
source§impl StaticFileResponse
impl StaticFileResponse
sourcepub fn with_content_type(self, ct: impl Into<String>) -> Self
pub fn with_content_type(self, ct: impl Into<String>) -> Self
Set the content type
Trait Implementations§
source§impl Debug for StaticFileResponse
impl Debug for StaticFileResponse
source§impl IntoResponse for StaticFileResponse
impl IntoResponse for StaticFileResponse
source§fn into_response(self) -> Response
fn into_response(self) -> Response
Consume itself and return
Response
.source§fn with_header<K, V>(self, key: K, value: V) -> WithHeader<Self>where
K: TryInto<HeaderName>,
V: TryInto<HeaderValue>,
Self: Sized,
fn with_header<K, V>(self, key: K, value: V) -> WithHeader<Self>where K: TryInto<HeaderName>, V: TryInto<HeaderValue>, Self: Sized,
Wrap an
impl IntoResponse
to add a header. Read moresource§fn with_content_type<V>(self, content_type: V) -> WithContentType<Self>where
V: TryInto<HeaderValue>,
Self: Sized,
fn with_content_type<V>(self, content_type: V) -> WithContentType<Self>where V: TryInto<HeaderValue>, Self: Sized,
Wrap an
impl IntoResponse
to with a new content type. Read moresource§fn with_status(self, status: StatusCode) -> WithStatus<Self>where
Self: Sized,
fn with_status(self, status: StatusCode) -> WithStatus<Self>where Self: Sized,
Wrap an
impl IntoResponse
to set a status code. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for StaticFileResponse
impl Send for StaticFileResponse
impl Sync for StaticFileResponse
impl Unpin for StaticFileResponse
impl !UnwindSafe for StaticFileResponse
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoResult<T> for Twhere
T: IntoResponse,
impl<T> IntoResult<T> for Twhere T: IntoResponse,
source§fn into_result(self) -> Result<T, Error>
fn into_result(self) -> Result<T, Error>
Consumes this value returns a
poem::Result<T>
.source§impl<T> TowerCompatExt for T
impl<T> TowerCompatExt for T
source§fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: HttpBody + Send + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<Body>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static,
Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where ResBody: HttpBody + Send + 'static, ResBody::Data: Into<Bytes> + Send + 'static, ResBody::Error: StdError + Send + Sync + 'static, Err: Into<Error>, Self: Service<Request<Body>, Response = Response<ResBody>, Error = Err, Future = Fut> + Clone + Send + Sync + Sized + 'static, Fut: Future<Output = Result<Response<ResBody>, Err>> + Send + 'static,
Available on crate feature
tower-compat
only.Converts a tower service to a poem endpoint.