pub struct ByteRange {
pub start: u64,
pub end_inclusive: u64,
}Expand description
An inclusive byte range, as in HTTP Range.
Fields§
§start: u64First byte.
end_inclusive: u64Last byte; clamped to the blob’s last byte.
Implementations§
Source§impl ByteRange
impl ByteRange
Sourcepub fn resolve(self, len: u64) -> Result<Range<u64>, StoreError>
pub fn resolve(self, len: u64) -> Result<Range<u64>, StoreError>
The start..end slice this range selects in a blob of len bytes.
§Errors
StoreError::Invalid when start > end_inclusive (malformed);
StoreError::RangeNotSatisfiable when start >= len.
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