pub struct ChunkTreeCache { /* private fields */ }Expand description
Cache of chunk tree mappings for resolving logical to physical addresses.
Keyed by logical start address. Uses a BTreeMap for efficient range lookups.
Implementations§
Source§impl ChunkTreeCache
impl ChunkTreeCache
Sourcepub fn insert(&mut self, mapping: ChunkMapping)
pub fn insert(&mut self, mapping: ChunkMapping)
Insert a chunk mapping into the cache.
Sourcepub fn lookup(&self, logical: u64) -> Option<&ChunkMapping>
pub fn lookup(&self, logical: u64) -> Option<&ChunkMapping>
Look up the chunk mapping that contains the given logical address.
Sourcepub fn resolve(&self, logical: u64) -> Option<u64>
pub fn resolve(&self, logical: u64) -> Option<u64>
Resolve a logical address to a physical byte offset on the first stripe.
For read-only access (like dump-tree), the first stripe is sufficient for single, DUP, and RAID1 profiles. RAID0/5/6/10 would need stripe index calculation, but for the common case this works.
Trait Implementations§
Source§impl Debug for ChunkTreeCache
impl Debug for ChunkTreeCache
Source§impl Default for ChunkTreeCache
impl Default for ChunkTreeCache
Source§fn default() -> ChunkTreeCache
fn default() -> ChunkTreeCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChunkTreeCache
impl RefUnwindSafe for ChunkTreeCache
impl Send for ChunkTreeCache
impl Sync for ChunkTreeCache
impl Unpin for ChunkTreeCache
impl UnsafeUnpin for ChunkTreeCache
impl UnwindSafe for ChunkTreeCache
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