pub struct Extent { /* private fields */ }Expand description
Represents a logical extent and its physical backing (DeviceExtent).
logical_range boundaries must always be a multiple of BLOCK_SIZE (4096 bytes).
Implementations§
Source§impl Extent
impl Extent
Sourcepub fn logical_range(&self) -> Range<u64> ⓘ
pub fn logical_range(&self) -> Range<u64> ⓘ
Returns the logical range of this extent.
Sourcepub fn device_extent(&self) -> DeviceExtent
pub fn device_extent(&self) -> DeviceExtent
Returns the DeviceExtent backing this logical extent.
Sourcepub fn device_offset(&self) -> Option<u64>
pub fn device_offset(&self) -> Option<u64>
Returns the optional physical device offset of this extent. If None, this extent is sparse.
Sourcepub fn is_sparse(&self) -> bool
pub fn is_sparse(&self) -> bool
Returns true if this extent is sparse (unbacked by physical storage).
Sourcepub fn new(
logical_range: Range<u64>,
device_extent: impl Into<DeviceExtent>,
) -> Self
pub fn new( logical_range: Range<u64>, device_extent: impl Into<DeviceExtent>, ) -> Self
Creates a new Extent.
§Panics
Panics if logical_range.start or logical_range.end is not a multiple of
BLOCK_SIZE (4096 bytes), if logical_range.start > logical_range.end, or if an
InlineTail extent is not a single block.
Trait Implementations§
impl Eq for Extent
impl StructuralPartialEq for Extent
Auto Trait Implementations§
impl Freeze for Extent
impl RefUnwindSafe for Extent
impl Send for Extent
impl Sync for Extent
impl Unpin for Extent
impl UnsafeUnpin for Extent
impl UnwindSafe for Extent
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