pub struct ContentRange {
pub start: u64,
pub end: u64,
}Expand description
Parsed Content-Range: <start>-<end> header.
Fields§
§start: u64Inclusive start byte offset.
end: u64Inclusive end byte offset.
Implementations§
Source§impl ContentRange
impl ContentRange
Sourcepub fn parse(value: &str) -> Result<Self, ContentRangeParseError>
pub fn parse(value: &str) -> Result<Self, ContentRangeParseError>
Parse a Content-Range header value as defined by Distribution
Spec v1.1 §4.3 (different from RFC 7233 — no bytes prefix,
no total-length suffix).
§Errors
Returns ContentRangeParseError when the value is not N-M
with N <= M.
Trait Implementations§
Source§impl Clone for ContentRange
impl Clone for ContentRange
Source§fn clone(&self) -> ContentRange
fn clone(&self) -> ContentRange
Returns a duplicate 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 ContentRange
impl Debug for ContentRange
Source§impl PartialEq for ContentRange
impl PartialEq for ContentRange
impl Copy for ContentRange
impl Eq for ContentRange
impl StructuralPartialEq for ContentRange
Auto Trait Implementations§
impl Freeze for ContentRange
impl RefUnwindSafe for ContentRange
impl Send for ContentRange
impl Sync for ContentRange
impl Unpin for ContentRange
impl UnsafeUnpin for ContentRange
impl UnwindSafe for ContentRange
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