pub enum HttpRange {
StartingPoint(u64),
Range(OrderedRange),
Suffix(u64),
}Expand description
A typed HTTP Range header that only supports a single range.
Variants§
Trait Implementations§
impl Copy for HttpRange
impl Eq for HttpRange
Source§impl From<&HttpRange> for HeaderValue
impl From<&HttpRange> for HeaderValue
Source§impl<S> OptionalFromRequestParts<S> for HttpRange
Available on crate feature axum only.
impl<S> OptionalFromRequestParts<S> for HttpRange
Available on crate feature
axum only.Source§async fn from_request_parts(
parts: &mut Parts,
_state: &S,
) -> Result<Option<Self>, Self::Rejection>
async fn from_request_parts( parts: &mut Parts, _state: &S, ) -> Result<Option<Self>, Self::Rejection>
Extracts an optional HttpRange from the request’s Range header.
Per RFC 9110 Section 14.2, range handling is only defined for the
GET method, and a server may ignore a Range header it cannot parse
or does not support (unknown range unit, multiple ranges, malformed
values). This extractor returns Ok(None) for non-GET requests and
in all such cases instead of rejecting the request, so that the full
representation is served.
Source§type Rejection = Infallible
type Rejection = Infallible
If the extractor fails, it will use this “rejection” type. Read more
impl StructuralPartialEq for HttpRange
Source§impl TryFrom<&HeaderValue> for HttpRange
impl TryFrom<&HeaderValue> for HttpRange
Source§type Error = ParseHttpRangeOrContentRangeError
type Error = ParseHttpRangeOrContentRangeError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for HttpRange
impl RefUnwindSafe for HttpRange
impl Send for HttpRange
impl Sync for HttpRange
impl Unpin for HttpRange
impl UnsafeUnpin for HttpRange
impl UnwindSafe for HttpRange
Blanket Implementations§
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