Enum http_content_range::ContentRange
source · [−]pub enum ContentRange {
Bytes(ContentRangeBytes),
UnboundBytes(ContentRangeUnbound),
Unsatisfied(ContentRangeUnsatisfied),
Unknown,
}Expand description
HTTP Content-Range response header representation.
Variants
Bytes(ContentRangeBytes)
Regular bytes range response with status 206
UnboundBytes(ContentRangeUnbound)
Regular bytes range response with status 206
Unsatisfied(ContentRangeUnsatisfied)
Server response with status 416
Unknown
Header cannot be parsed. This includes non-standard response with status 206
Implementations
sourceimpl ContentRange
impl ContentRange
sourcepub fn parse(header: &str) -> ContentRange
pub fn parse(header: &str) -> ContentRange
Parses Content-Range HTTP header string as per RFC 7233.
header is the HTTP Content-Range header (e.g. bytes 0-9/30).
This parser is a bit more lenient than the official RFC, it allows spaces and tabs between everything. See https://httpwg.org/specs/rfc7233.html#rfc.section.4.2
sourcepub fn parse_bytes(header: &[u8]) -> ContentRange
pub fn parse_bytes(header: &[u8]) -> ContentRange
Same as [parse] but parses directly from the byte array
Trait Implementations
sourceimpl Clone for ContentRange
impl Clone for ContentRange
sourcefn clone(&self) -> ContentRange
fn clone(&self) -> ContentRange
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 Debug for ContentRange
impl Debug for ContentRange
sourceimpl PartialEq<ContentRange> for ContentRange
impl PartialEq<ContentRange> for ContentRange
sourcefn eq(&self, other: &ContentRange) -> bool
fn eq(&self, other: &ContentRange) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ContentRange) -> bool
fn ne(&self, other: &ContentRange) -> bool
This method tests for !=.
impl Copy for ContentRange
impl Eq for ContentRange
impl StructuralEq for ContentRange
impl StructuralPartialEq for ContentRange
Auto Trait Implementations
impl RefUnwindSafe for ContentRange
impl Send for ContentRange
impl Sync for ContentRange
impl Unpin for ContentRange
impl UnwindSafe for ContentRange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more