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§
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, a server that receives a Range header it
cannot parse or does not support (unknown range unit, multiple ranges,
malformed values) must ignore the header and serve the full
representation. This extractor returns Ok(None) in all such cases
instead of rejecting the request.
Source§type Rejection = Infallible
type Rejection = Infallible
If the extractor fails, it will use this “rejection” type. Read more
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.
impl Copy for HttpRange
impl Eq for HttpRange
impl StructuralPartialEq for HttpRange
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