pub struct PrivateLockFile {
pub version: u32,
pub agents: Vec<LockedResource>,
pub snippets: Vec<LockedResource>,
pub commands: Vec<LockedResource>,
pub scripts: Vec<LockedResource>,
pub mcp_servers: Vec<LockedResource>,
pub hooks: Vec<LockedResource>,
pub skills: Vec<LockedResource>,
}Expand description
Private lockfile tracking user-level dependencies.
This file is gitignored and contains full LockedResource entries for
dependencies that came from agpm.private.toml. It works alongside
agpm.lock to provide full reproducibility while keeping team lockfiles
deterministic.
Uses the same array-based format as agpm.lock for consistency.
Fields§
§version: u32Lockfile format version
agents: Vec<LockedResource>Private agents
snippets: Vec<LockedResource>Private snippets
commands: Vec<LockedResource>Private commands
scripts: Vec<LockedResource>Private scripts
mcp_servers: Vec<LockedResource>Private MCP servers
hooks: Vec<LockedResource>Private hooks
skills: Vec<LockedResource>Private skills
Implementations§
Source§impl PrivateLockFile
impl PrivateLockFile
Sourcepub fn load(project_dir: &Path) -> Result<Option<Self>>
pub fn load(project_dir: &Path) -> Result<Option<Self>>
Load private lockfile from disk.
Returns Ok(None) if the file doesn’t exist (no private resources).
§Example
use agpm_cli::lockfile::private_lock::PrivateLockFile;
use std::path::Path;
let project_dir = Path::new(".");
match PrivateLockFile::load(project_dir)? {
Some(lock) => println!("Loaded {} private resources", lock.total_resources()),
None => println!("No private lockfile found"),
}Sourcepub fn save(&self, project_dir: &Path) -> Result<()>
pub fn save(&self, project_dir: &Path) -> Result<()>
Save private lockfile to disk.
Deletes the file if the lockfile is empty (no private resources).
§Example
use agpm_cli::lockfile::private_lock::PrivateLockFile;
use std::path::Path;
let lock = PrivateLockFile::new();
lock.save(Path::new("."))?;Sourcepub fn total_resources(&self) -> usize
pub fn total_resources(&self) -> usize
Count total number of private resources.
Sourcepub fn all_resources(&self) -> Vec<&LockedResource>
pub fn all_resources(&self) -> Vec<&LockedResource>
Get all resources from the private lockfile.
Sourcepub fn from_resources(resources: Vec<LockedResource>) -> Self
pub fn from_resources(resources: Vec<LockedResource>) -> Self
Create a private lockfile from a vector of private resources.
Filters and distributes resources into appropriate type vectors.
Trait Implementations§
Source§impl Clone for PrivateLockFile
impl Clone for PrivateLockFile
Source§fn clone(&self) -> PrivateLockFile
fn clone(&self) -> PrivateLockFile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrivateLockFile
impl Debug for PrivateLockFile
Source§impl Default for PrivateLockFile
impl Default for PrivateLockFile
Source§impl<'de> Deserialize<'de> for PrivateLockFile
impl<'de> Deserialize<'de> for PrivateLockFile
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>,
Source§impl PartialEq for PrivateLockFile
impl PartialEq for PrivateLockFile
Source§impl Serialize for PrivateLockFile
impl Serialize for PrivateLockFile
impl StructuralPartialEq for PrivateLockFile
Auto Trait Implementations§
impl Freeze for PrivateLockFile
impl RefUnwindSafe for PrivateLockFile
impl Send for PrivateLockFile
impl Sync for PrivateLockFile
impl Unpin for PrivateLockFile
impl UnwindSafe for PrivateLockFile
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> 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>
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