pub struct DirItem { /* private fields */ }Expand description
A directory in the file index. Shares chunk arena with file paths.
Implementations§
Source§impl DirItem
impl DirItem
pub fn is_overflow(&self) -> bool
Sourcepub fn last_segment_offset(&self) -> u16
pub fn last_segment_offset(&self) -> u16
Byte offset of the last path segment within the directory path.
Sourcepub fn max_access_frecency(&self) -> i32
pub fn max_access_frecency(&self) -> i32
Current max access frecency score.
Sourcepub fn update_frecency_if_larger(&self, score: i32)
pub fn update_frecency_if_larger(&self, score: i32)
Atomically update the directory’s frecency score if the given score is larger. Safe to call from parallel threads.
Sourcepub fn reset_frecency(&self)
pub fn reset_frecency(&self)
Reset frecency to zero (used before full recomputation).
Sourcepub fn relative_path(&self, arena: impl FFFStringStorage) -> String
pub fn relative_path(&self, arena: impl FFFStringStorage) -> String
Relative dir path as owned String (cold path).
Sourcepub fn write_dir_name(&self, arena: ArenaPtr, out: &mut String)
pub fn write_dir_name(&self, arena: ArenaPtr, out: &mut String)
Write the last segment (dirname) of this directory path to out.
Sourcepub fn dir_name(&self, arena: impl FFFStringStorage) -> String
pub fn dir_name(&self, arena: impl FFFStringStorage) -> String
The dirname (last segment) as an owned String. Cold path.
Sourcepub fn absolute_path(
&self,
arena: impl FFFStringStorage,
base_path: &Path,
) -> PathBuf
pub fn absolute_path( &self, arena: impl FFFStringStorage, base_path: &Path, ) -> PathBuf
A path = base_path + “/” + relative. Cold path, allocates.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DirItem
impl RefUnwindSafe for DirItem
impl Send for DirItem
impl Sync for DirItem
impl Unpin for DirItem
impl UnsafeUnpin for DirItem
impl UnwindSafe for DirItem
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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