pub struct Lock {
pub version: u32,
pub skills: Vec<Locked>,
pub agents: Vec<Locked>,
pub extensions: Vec<Locked>,
}Expand description
A chest.lock. [patch] entries never appear in it.
Fields§
§version: u32The format version, 1.
skills: Vec<Locked>The [[skill]] entries.
agents: Vec<Locked>The [[agent]] entries.
extensions: Vec<Locked>The [[extension]] entries.
Implementations§
Source§impl Lock
impl Lock
Sourcepub fn section(&self, section: Section) -> &[Locked]
pub fn section(&self, section: Section) -> &[Locked]
The entries of section. [patch] entries are never locked.
Sourcepub fn parse(text: &str) -> Result<Lock, ChestError>
pub fn parse(text: &str) -> Result<Lock, ChestError>
The lock in text. Fails on unknown keys, on versions other than 1,
and on entry and item names that break the manifest’s name rule or
package paths that replay would refuse, so that no name or path from
the lock leaves the folder it is joined to.
Sourcepub fn to_toml(&self) -> Result<String, ChestError>
pub fn to_toml(&self) -> Result<String, ChestError>
The lock as chest writes it, the same for the same contents: the header, then entries sorted by name, their items by name and their packages by path. A path entry keeps only its name and path, since path entries are never hashed.
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 Eq for Lock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.