pub struct GitStatusCache { /* private fields */ }Expand description
Git status cache for efficient lookups.
Implementations§
Source§impl GitStatusCache
impl GitStatusCache
Sourcepub fn initialize(&mut self, start_path: &Path) -> bool
pub fn initialize(&mut self, start_path: &Path) -> bool
Initialize the cache by discovering and scanning the git repository.
start_path is the directory we are scanning (the subtree root). The
git status query is restricted to that subtree via a pathspec so that
only relevant entries are loaded, keeping memory usage proportional to
the scanned directory rather than the whole repository.
Returns true if a git repository was found and scanned.
Sourcepub fn get_status(&self, path: &Path) -> Option<GitStatus>
pub fn get_status(&self, path: &Path) -> Option<GitStatus>
Get the git status for a path.
Sourcepub fn is_in_repo(&self, path: &Path) -> bool
pub fn is_in_repo(&self, path: &Path) -> bool
Check if the path is within a git repository.
Trait Implementations§
Source§impl Debug for GitStatusCache
impl Debug for GitStatusCache
Source§impl Default for GitStatusCache
impl Default for GitStatusCache
Source§fn default() -> GitStatusCache
fn default() -> GitStatusCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GitStatusCache
impl RefUnwindSafe for GitStatusCache
impl Send for GitStatusCache
impl Sync for GitStatusCache
impl Unpin for GitStatusCache
impl UnsafeUnpin for GitStatusCache
impl UnwindSafe for GitStatusCache
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> 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