pub struct Lock {
pub lock_version: u32,
pub generated_by: String,
pub targets: Vec<String>,
pub registry_revision: String,
pub tools: Vec<LockedTool>,
}Expand description
A vanta.lock file.
Fields§
§lock_version: u32§generated_by: String§targets: Vec<String>§registry_revision: String§tools: Vec<LockedTool>One entry per locked tool, serialized as [[tool]].
Implementations§
Source§impl Lock
impl Lock
Sourcepub fn new(generated_by: impl Into<String>, targets: Vec<String>) -> Lock
pub fn new(generated_by: impl Into<String>, targets: Vec<String>) -> Lock
A new, empty lock with the current format version.
Sourcepub fn tool_names(&self) -> BTreeSet<String>
pub fn tool_names(&self) -> BTreeSet<String>
The set of tool names this lock pins.
Sourcepub fn canonical(&self) -> Lock
pub fn canonical(&self) -> Lock
Return a canonicalized clone: tools sorted by name (platform maps are
already sorted by BTreeMap). Determinism keeps VCS diffs minimal.
Sourcepub fn from_toml(src: &str) -> VtaResult<Lock>
pub fn from_toml(src: &str) -> VtaResult<Lock>
Parse a lock from TOML, rejecting a format version newer than supported.
Sourcepub fn write_file(&self, path: &Path) -> VtaResult<()>
pub fn write_file(&self, path: &Path) -> VtaResult<()>
Write the lock file canonically.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lock
impl<'de> Deserialize<'de> for Lock
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
impl StructuralPartialEq for Lock
Auto Trait Implementations§
impl Freeze for Lock
impl RefUnwindSafe for Lock
impl Send for Lock
impl Sync for Lock
impl Unpin for Lock
impl UnsafeUnpin for Lock
impl UnwindSafe for Lock
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