Skip to main content

OffsetTable

Struct OffsetTable 

Source
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: u32

Entries [0, covers_entries) are represented (possibly stale).

§covers_pool_len: u32

Pool bytes [0, covers_pool_len) are represented.

§stale_pairs: u32

Implementations§

Source§

impl OffsetTable

Source

pub(super) fn build(idx: &VolumeIndex) -> Self

Source

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.

Source

pub(super) const fn len(&self) -> usize

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more