pub struct ByteRange {
pub start: u64,
pub end: Option<u64>,
}Expand description
Byte range for partial downloads
Fields§
§start: u64Start byte position
end: Option<u64>End byte position (inclusive, or None for end of file)
Implementations§
Source§impl ByteRange
impl ByteRange
Sourcepub fn from_start(start: u64) -> Self
pub fn from_start(start: u64) -> Self
Create range from start byte to end of file
Sourcepub fn last_bytes(bytes: u64) -> Self
pub fn last_bytes(bytes: u64) -> Self
Create range for last N bytes
Sourcepub fn to_header_value(&self) -> String
pub fn to_header_value(&self) -> String
Convert to HTTP range header value
Trait Implementations§
impl Copy for ByteRange
impl Eq for ByteRange
impl StructuralPartialEq for ByteRange
Auto Trait Implementations§
impl Freeze for ByteRange
impl RefUnwindSafe for ByteRange
impl Send for ByteRange
impl Sync for ByteRange
impl Unpin for ByteRange
impl UnsafeUnpin for ByteRange
impl UnwindSafe for ByteRange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.