pub struct Extents { /* private fields */ }Expand description
Container for active mappings associated with a session.
Extents are stored in compact form (ExtentEntry, 16 bytes) in a boxed slice
sorted by ascending end_logical_offset to support clean O(log N) binary search lookups.
Implementations§
Source§impl Extents
impl Extents
Sourcepub fn encode_extents(extents: &[Extent]) -> Vec<u64>
pub fn encode_extents(extents: &[Extent]) -> Vec<u64>
Encodes a slice of Extents into 64-bit mapping descriptors.
§Panics
Panics if any Extent in extents has a logical_range or device_offset
that is not a multiple of BLOCK_SIZE (4096 bytes).
Sourcepub fn from_encoded(encoded: &[u64]) -> Option<Self>
pub fn from_encoded(encoded: &[u64]) -> Option<Self>
Decodes a sequence of 64-bit mapping descriptors into a compact Extents container.
Returns None if an unknown mapping descriptor type is encountered.
Sourcepub fn iter_extents(&self, start_offset: u64) -> ExtentsIterator<'_> ⓘ
pub fn iter_extents(&self, start_offset: u64) -> ExtentsIterator<'_> ⓘ
Returns an iterator over all extents whose logical range ends after start_offset,
jumping directly to the first overlapping extent in O(log N) time via binary search.
Trait Implementations§
impl Eq for Extents
impl StructuralPartialEq for Extents
Auto Trait Implementations§
impl Freeze for Extents
impl RefUnwindSafe for Extents
impl Send for Extents
impl Sync for Extents
impl Unpin for Extents
impl UnsafeUnpin for Extents
impl UnwindSafe for Extents
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,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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