pub(super) struct DirPathsPool {
paths: Vec<Option<Box<[u8]>>>,
covers_entries: usize,
topo_generation: u64,
}Expand description
Memoized full paths for every directory, for one name pool. Only built
when the query contains path terms — and split per pool so a query only
pays for the pool(s) it reads (nearly all path queries are folded).
Entry paths are memo[parent] + name.
Across generations a memo extends incrementally as long as no existing
directory was renamed or moved (dir_topology_generation): appends
never change old dir paths, so new dirs just memoize on top. A topology
change rebuilds from scratch — dir renames are rare and the alternative
(subtree invalidation) is not worth its complexity.
Fields§
§paths: Vec<Option<Box<[u8]>>>§covers_entries: usizeEntries [0, covers_entries) are memoized.
topo_generation: u64The dir-topology generation this memo is valid for.
Implementations§
Source§impl DirPathsPool
impl DirPathsPool
fn name_of(idx: &VolumeIndex, id: EntryId, folded: bool) -> &[u8] ⓘ
Sourcefn extend(idx: &VolumeIndex, pool: Self, folded: bool) -> Self
fn extend(idx: &VolumeIndex, pool: Self, folded: bool) -> Self
Extend pool to the current generation: memoize only the appended
dirs. Their parents were live entries when pushed (lower id or
root), so one increasing-id pass resolves every prefix. Falls back
to a full build when a dir was renamed/moved (paths of arbitrary
descendants changed) — the normal policy switch, not a degradation.
Sourcefn build(idx: &VolumeIndex, folded: bool) -> Self
fn build(idx: &VolumeIndex, folded: bool) -> Self
Level-order parallel build: a directory’s path depends only on its parent’s (one level up), so each depth level fans out across cores.
fn parent_prefix(&self, parent: EntryId) -> &[u8] ⓘ
fn bytes(&self) -> u64
Trait Implementations§
Source§impl From<DirPathsLower> for DirPathsPool
impl From<DirPathsLower> for DirPathsPool
Source§fn from(m: DirPathsLower) -> Self
fn from(m: DirPathsLower) -> Self
Source§impl From<DirPathsOrig> for DirPathsPool
impl From<DirPathsOrig> for DirPathsPool
Source§fn from(m: DirPathsOrig) -> Self
fn from(m: DirPathsOrig) -> Self
Auto Trait Implementations§
impl Freeze for DirPathsPool
impl RefUnwindSafe for DirPathsPool
impl Send for DirPathsPool
impl Sync for DirPathsPool
impl Unpin for DirPathsPool
impl UnsafeUnpin for DirPathsPool
impl UnwindSafe for DirPathsPool
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