pub struct LockfileManager { /* private fields */ }Expand description
Lockfile manager for ggen.lock with performance optimizations
Implementations§
Source§impl LockfileManager
impl LockfileManager
Sourcepub fn new(project_dir: &Path) -> Self
pub fn new(project_dir: &Path) -> Self
Create a new lockfile manager
§Examples
use ggen_core::lockfile::LockfileManager;
use std::path::Path;
let manager = LockfileManager::new(Path::new("."));
assert_eq!(manager.lockfile_path(), Path::new("./ggen.lock"));Sourcepub fn lockfile_path(&self) -> &Path
pub fn lockfile_path(&self) -> &Path
Get the lockfile path
§Examples
use ggen_core::lockfile::LockfileManager;
use std::path::Path;
let manager = LockfileManager::new(Path::new("."));
let path = manager.lockfile_path();
assert!(path.ends_with("ggen.lock"));Sourcepub fn upsert(
&self,
pack_id: &str,
version: &str,
sha256: &str,
source: &str,
) -> Result<()>
pub fn upsert( &self, pack_id: &str, version: &str, sha256: &str, source: &str, ) -> Result<()>
Add or update a pack in the lockfile
Sourcepub fn upsert_with_pqc(
&self,
pack_id: &str,
version: &str,
sha256: &str,
source: &str,
pqc_signature: Option<String>,
pqc_pubkey: Option<String>,
) -> Result<()>
pub fn upsert_with_pqc( &self, pack_id: &str, version: &str, sha256: &str, source: &str, pqc_signature: Option<String>, pqc_pubkey: Option<String>, ) -> Result<()>
Add or update a pack in the lockfile with PQC signature
Sourcepub fn is_installed(&self, pack_id: &str) -> Result<bool>
pub fn is_installed(&self, pack_id: &str) -> Result<bool>
Check if a pack is installed
Sourcepub fn installed_packs(&self) -> Result<BTreeMap<String, LockEntry>>
pub fn installed_packs(&self) -> Result<BTreeMap<String, LockEntry>>
Get installed packs as a map for quick lookup FMEA Fix: Use BTreeMap for deterministic iteration order
Sourcepub fn stats(&self) -> Result<LockfileStats>
pub fn stats(&self) -> Result<LockfileStats>
Get lockfile statistics
Sourcepub fn upsert_bulk(
&self,
packs: &[(String, String, String, String)],
) -> Result<()>
pub fn upsert_bulk( &self, packs: &[(String, String, String, String)], ) -> Result<()>
Upsert multiple packs in parallel OPTIMIZATION 1.1: Parallel manifest loading for bulk operations (2-4x speedup)
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear dependency cache (useful for testing or when cache becomes stale)
Sourcepub fn cache_stats(&self) -> (usize, usize)
pub fn cache_stats(&self) -> (usize, usize)
Get cache statistics
Trait Implementations§
Source§impl Clone for LockfileManager
impl Clone for LockfileManager
Source§fn clone(&self) -> LockfileManager
fn clone(&self) -> LockfileManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LockfileManager
impl RefUnwindSafe for LockfileManager
impl Send for LockfileManager
impl Sync for LockfileManager
impl Unpin for LockfileManager
impl UnwindSafe for LockfileManager
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request