pub struct Lockfile {
pub version: u32,
pub created_at: DateTime<Utc>,
pub toolchain: LockedToolchain,
pub plan: LockedPlan,
pub workspace: LockedWorkspace,
pub packages: Vec<LockedPackage>,
}Expand description
The hx.lock lockfile.
Fields§
§version: u32Lockfile format version
created_at: DateTime<Utc>When the lockfile was created/updated
toolchain: LockedToolchainToolchain versions
plan: LockedPlanBuild plan metadata
workspace: LockedWorkspaceWorkspace information (for multi-package projects)
packages: Vec<LockedPackage>Locked packages (external dependencies)
Implementations§
Source§impl Lockfile
impl Lockfile
Sourcepub fn from_file(path: impl AsRef<Path>) -> Result<Self, LockError>
pub fn from_file(path: impl AsRef<Path>) -> Result<Self, LockError>
Parse a lockfile from a file.
Sourcepub fn to_file(&self, path: impl AsRef<Path>) -> Result<(), LockError>
pub fn to_file(&self, path: impl AsRef<Path>) -> Result<(), LockError>
Write the lockfile to a file.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Calculate a fingerprint for the lockfile.
Sourcepub fn add_package(&mut self, pkg: LockedPackage)
pub fn add_package(&mut self, pkg: LockedPackage)
Add a package to the lockfile.
Sourcepub fn set_toolchain(&mut self, ghc: Option<String>, cabal: Option<String>)
pub fn set_toolchain(&mut self, ghc: Option<String>, cabal: Option<String>)
Set the toolchain versions.
Sourcepub fn set_snapshot(&mut self, snapshot: Option<String>)
pub fn set_snapshot(&mut self, snapshot: Option<String>)
Set the Stackage snapshot.
Sourcepub fn set_workspace(&mut self, packages: Vec<WorkspacePackageInfo>)
pub fn set_workspace(&mut self, packages: Vec<WorkspacePackageInfo>)
Set workspace information.
Sourcepub fn is_workspace(&self) -> bool
pub fn is_workspace(&self) -> bool
Check if this is a workspace lockfile.
Sourcepub fn workspace_package_names(&self) -> Vec<&str>
pub fn workspace_package_names(&self) -> Vec<&str>
Get the workspace package names.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lockfile
impl<'de> Deserialize<'de> for Lockfile
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Lockfile
impl RefUnwindSafe for Lockfile
impl Send for Lockfile
impl Sync for Lockfile
impl Unpin for Lockfile
impl UnwindSafe for Lockfile
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