pub(super) struct OffsetTable {
pub(super) offs: Vec<u32>,
pub(super) ids: Vec<EntryId>,
covers_entries: u32,
covers_pool_len: u32,
stale_pairs: u32,
}Expand description
Sorted (pool offset → entry id) table that maps pool-scan hits back to
entries. name_off loses monotonicity after renames (new names append),
so a sorted view is maintained per content generation via the index’s
derived-cache slot — incrementally when possible (Self::extend_from):
pool appends are always at the tail, so a generation step is “copy +
append”, never a re-sort.
Pairs whose entry has since moved its name (in-place dir renames) stay in
the table as stale pairs; the sweep detects them by comparing the
pair’s offset against the entry’s current name_off and skips the
region, exactly like the stale byte gaps it already handles.
Fields§
§offs: Vec<u32>§ids: Vec<EntryId>§covers_entries: u32Entries [0, covers_entries) are represented (possibly stale).
covers_pool_len: u32Pool bytes [0, covers_pool_len) are represented.
stale_pairs: u32Implementations§
Source§impl OffsetTable
impl OffsetTable
pub(super) fn build(idx: &VolumeIndex) -> Self
Sourcepub(super) fn extend_from(idx: &VolumeIndex, prev: Arc<Self>) -> Self
pub(super) fn extend_from(idx: &VolumeIndex, prev: Arc<Self>) -> Self
Extend prev to the current generation without sorting: keep its
pairs (reusing the allocations when the cache held the last Arc,
copying otherwise), then append the pairs past its watermarks.
Appended entries arrive in offset order by construction; in-place
renamed dirs (their name_off jumped past the watermark) are merged
in and their old pairs left behind as stale.
pub(super) const fn len(&self) -> usize
Auto Trait Implementations§
impl Freeze for OffsetTable
impl RefUnwindSafe for OffsetTable
impl Send for OffsetTable
impl Sync for OffsetTable
impl Unpin for OffsetTable
impl UnsafeUnpin for OffsetTable
impl UnwindSafe for OffsetTable
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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