pub struct ByteRange { /* private fields */ }Expand description
Non-empty half-open byte range [offset, end_exclusive).
Implementations§
Source§impl ByteRange
impl ByteRange
Sourcepub fn new(offset: u64, length: u64) -> Result<Self>
pub fn new(offset: u64, length: u64) -> Result<Self>
Creates a non-empty range and rejects end-position overflow.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn end_exclusive(self) -> u64
pub const fn end_exclusive(self) -> u64
Returns the exclusive range end. Construction guarantees this addition cannot overflow.
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 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