pub struct ProjectIndex { /* private fields */ }Expand description
Index of all imported projects.
Implementations§
Source§impl ProjectIndex
impl ProjectIndex
Sourcepub fn add(&mut self, meta: ProjectMeta)
pub fn add(&mut self, meta: ProjectMeta)
Add a project to the index.
Sourcepub fn remove(&mut self, project_id: &str) -> Option<ProjectMeta>
pub fn remove(&mut self, project_id: &str) -> Option<ProjectMeta>
Remove a project from the index.
Sourcepub fn get(&self, project_id: &str) -> Option<&ProjectMeta>
pub fn get(&self, project_id: &str) -> Option<&ProjectMeta>
Get a project by ID.
Supports both full UUID and short ID prefix (minimum 4 characters).
Sourcepub fn get_mut(&mut self, project_id: &str) -> Option<&mut ProjectMeta>
pub fn get_mut(&mut self, project_id: &str) -> Option<&mut ProjectMeta>
Get a mutable project by ID.
Supports both full UUID and short ID prefix (minimum 4 characters).
Sourcepub fn get_by_path(&self, path: &Path) -> Option<&ProjectMeta>
pub fn get_by_path(&self, path: &Path) -> Option<&ProjectMeta>
Get a project by path.
The input path is canonicalized before lookup to ensure consistent matching.
Sourcepub fn contains_path(&self, path: &Path) -> bool
pub fn contains_path(&self, path: &Path) -> bool
Check if a project with the given path exists.
The input path is canonicalized before lookup.
Sourcepub fn list(&self) -> Vec<&ProjectMeta>
pub fn list(&self) -> Vec<&ProjectMeta>
List all projects, sorted by last accessed (most recent first).
Sourcepub fn list_by_import_date(&self) -> Vec<&ProjectMeta>
pub fn list_by_import_date(&self) -> Vec<&ProjectMeta>
List projects by import date (newest first).
Sourcepub fn search_by_name(&self, pattern: &str) -> Vec<&ProjectMeta>
pub fn search_by_name(&self, pattern: &str) -> Vec<&ProjectMeta>
Search projects by name pattern.
Search projects by tags.
Sourcepub fn rebuild_path_index(&mut self)
pub fn rebuild_path_index(&mut self)
Rebuild the by_path index (call after deserialization).
Sourcepub fn cleanup_dead_servers(&mut self) -> usize
pub fn cleanup_dead_servers(&mut self) -> usize
Cleanup all dead server PIDs.
Checks each project’s server_pid and clears it if the process is no longer running. Returns the number of projects that were cleaned up.
Sourcepub fn total_lines(&self) -> usize
pub fn total_lines(&self) -> usize
Get total lines of code across all projects.
Sourcepub fn total_files(&self) -> usize
pub fn total_files(&self) -> usize
Get total file count across all projects.
Trait Implementations§
Source§impl Clone for ProjectIndex
impl Clone for ProjectIndex
Source§fn clone(&self) -> ProjectIndex
fn clone(&self) -> ProjectIndex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectIndex
impl Debug for ProjectIndex
Source§impl Default for ProjectIndex
impl Default for ProjectIndex
Source§fn default() -> ProjectIndex
fn default() -> ProjectIndex
Source§impl<'de> Deserialize<'de> for ProjectIndex
impl<'de> Deserialize<'de> for ProjectIndex
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProjectIndex
impl RefUnwindSafe for ProjectIndex
impl Send for ProjectIndex
impl Sync for ProjectIndex
impl Unpin for ProjectIndex
impl UnsafeUnpin for ProjectIndex
impl UnwindSafe for ProjectIndex
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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