Struct poem::web::headers::AcceptRanges
source · pub struct AcceptRanges(/* private fields */);
Expand description
Accept-Ranges
header, defined in RFC7233
The Accept-Ranges
header field allows a server to indicate that it
supports range requests for the target resource.
§ABNF
Accept-Ranges = acceptable-ranges
acceptable-ranges = 1#range-unit / \"none\"
# Example values
* `bytes`
* `none`
* `unknown-unit`
§Examples
use headers::{AcceptRanges, HeaderMap, HeaderMapExt};
let mut headers = HeaderMap::new();
headers.typed_insert(AcceptRanges::bytes());
Implementations§
source§impl AcceptRanges
impl AcceptRanges
sourcepub fn bytes() -> AcceptRanges
pub fn bytes() -> AcceptRanges
A constructor to easily create the common Accept-Ranges: bytes
header.
Trait Implementations§
source§impl Clone for AcceptRanges
impl Clone for AcceptRanges
source§fn clone(&self) -> AcceptRanges
fn clone(&self) -> AcceptRanges
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AcceptRanges
impl Debug for AcceptRanges
source§impl Header for AcceptRanges
impl Header for AcceptRanges
source§fn name() -> &'static HeaderName
fn name() -> &'static HeaderName
The name of this header.
source§fn decode<'i, I>(values: &mut I) -> Result<AcceptRanges, Error>where
I: Iterator<Item = &'i HeaderValue>,
fn decode<'i, I>(values: &mut I) -> Result<AcceptRanges, Error>where
I: Iterator<Item = &'i HeaderValue>,
Decode this type from an iterator of
HeaderValue
s.source§impl PartialEq for AcceptRanges
impl PartialEq for AcceptRanges
source§fn eq(&self, other: &AcceptRanges) -> bool
fn eq(&self, other: &AcceptRanges) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for AcceptRanges
Auto Trait Implementations§
impl !Freeze for AcceptRanges
impl RefUnwindSafe for AcceptRanges
impl Send for AcceptRanges
impl Sync for AcceptRanges
impl Unpin for AcceptRanges
impl UnwindSafe for AcceptRanges
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§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> TowerCompatExt for T
impl<T> TowerCompatExt for T
source§fn compat<ResBody, Err, Fut>(self) -> TowerCompatEndpoint<Self>where
ResBody: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, 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: Body + Send + Sync + 'static,
ResBody::Data: Into<Bytes> + Send + 'static,
ResBody::Error: StdError + Send + Sync + 'static,
Err: Into<Error>,
Self: Service<Request<BoxBody<Bytes, Error>>, 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.