pub struct ByteRange { /* private fields */ }Expand description
Half-open byte range [start, end).
Validated on construction: start <= end is an invariant.
Implementations§
Source§impl ByteRange
impl ByteRange
pub fn new(start: ByteOffset, end: ByteOffset) -> Result<Self, Error>
pub fn from_offset_and_len( start: ByteOffset, len: ByteLen, ) -> Result<Self, Error>
pub fn start(self) -> ByteOffset
pub fn end(self) -> ByteOffset
pub fn len(self) -> ByteLen
pub fn is_empty(self) -> bool
pub fn contains(self, offset: ByteOffset) -> bool
pub fn as_u64_range(self) -> Range<u64>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ByteRange
impl<'de> Deserialize<'de> for ByteRange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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