pub struct Lockfile {
pub version: u32,
pub packages: HashMap<String, LockfileEntry>,
}Expand description
Lockfile structure (otter.lock)
Fields§
§version: u32Lockfile format version
packages: HashMap<String, LockfileEntry>Locked packages
Implementations§
Source§impl Lockfile
impl Lockfile
pub fn new() -> Self
Sourcepub fn load(path: &Path) -> Result<Self, LockfileError>
pub fn load(path: &Path) -> Result<Self, LockfileError>
Load lockfile from path
Sourcepub fn is_locked(&self, name: &str, version: &str) -> bool
pub fn is_locked(&self, name: &str, version: &str) -> bool
Check if a package is locked at a specific version
Sourcepub fn get_version(&self, name: &str) -> Option<&str>
pub fn get_version(&self, name: &str) -> Option<&str>
Get locked version for a package
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