pub struct GitStatusCache { /* private fields */ }Expand description
Fast SQLite-based cache for git status information
Implementations§
Source§impl GitStatusCache
impl GitStatusCache
Sourcepub fn with_ttl<P: Into<PathBuf>>(db_path: P, ttl_minutes: i64) -> Self
pub fn with_ttl<P: Into<PathBuf>>(db_path: P, ttl_minutes: i64) -> Self
Create a git status cache with custom TTL
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize the cache database with required tables
Sourcepub async fn cache_git_status(&self, status: &CachedGitStatus) -> Result<()>
pub async fn cache_git_status(&self, status: &CachedGitStatus) -> Result<()>
Cache git status information
Sourcepub async fn get_git_status(
&self,
repository_name: &str,
) -> Result<Option<CachedGitStatus>>
pub async fn get_git_status( &self, repository_name: &str, ) -> Result<Option<CachedGitStatus>>
Get cached git status if it’s still valid (within TTL)
Sourcepub async fn get_all_git_statuses(&self) -> Result<Vec<CachedGitStatus>>
pub async fn get_all_git_statuses(&self) -> Result<Vec<CachedGitStatus>>
Get all cached git statuses (for batch operations)
Sourcepub async fn cleanup_expired(&self) -> Result<usize>
pub async fn cleanup_expired(&self) -> Result<usize>
Remove expired cache entries
Sourcepub async fn invalidate_repository(&self, repository_name: &str) -> Result<()>
pub async fn invalidate_repository(&self, repository_name: &str) -> Result<()>
Invalidate cache for a specific repository (useful when changes are detected)
Sourcepub async fn get_stats(&self) -> Result<GitCacheStats>
pub async fn get_stats(&self) -> Result<GitCacheStats>
Get cache statistics
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