pub enum ByteRange {
Bounded(Range<ChunkOffset>),
From(ChunkOffset),
Last(ChunkLength),
Until(ChunkOffset),
}Expand description
A byte range within a chunk or object.
Variants§
Bounded(Range<ChunkOffset>)
The fixed length range represented by the given Range
From(ChunkOffset)
All bytes from the given offset (included) to the end of the object
Last(ChunkLength)
The last n bytes in the object
Until(ChunkOffset)
All bytes up to the last n bytes in the object
Implementations§
Source§impl ByteRange
impl ByteRange
pub const ALL: Self
pub fn from_offset(offset: ChunkOffset) -> Self
pub fn from_offset_with_length(offset: ChunkOffset, length: ChunkOffset) -> Self
pub fn to_offset(offset: ChunkOffset) -> Self
pub fn bounded(start: ChunkOffset, end: ChunkOffset) -> Self
pub fn slice(&self, bytes: &Bytes) -> Bytes
Trait Implementations§
impl Eq for ByteRange
Source§impl From<(Option<u64>, Option<u64>)> for ByteRange
impl From<(Option<u64>, Option<u64>)> for ByteRange
Source§fn from((start, end): (Option<ChunkOffset>, Option<ChunkOffset>)) -> Self
fn from((start, end): (Option<ChunkOffset>, Option<ChunkOffset>)) -> Self
Converts to this type from the input type.
Source§impl From<Range<u64>> for ByteRange
impl From<Range<u64>> for ByteRange
Source§fn from(value: Range<ChunkOffset>) -> Self
fn from(value: Range<ChunkOffset>) -> Self
Converts to this type from the input type.
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more