pub struct Lock {
pub entries: Vec<LockEntry>,
pub firmware: Option<Firmware>,
/* private fields */
}Expand description
Everything a run consumed that can move between one green CI run and the next: the catalog manifests and the firmware bytes.
Fields§
§entries: Vec<LockEntry>Written as [[entry]], one table per manifest.
firmware: Option<Firmware>Implementations§
Source§impl Lock
impl Lock
Sourcepub fn from_run(
catalog: &[(String, String, String)],
firmware: Option<&[u8]>,
rom: Option<&[u8]>,
bootloader: Option<&[u8]>,
partition_table: Option<&[u8]>,
) -> Lock
pub fn from_run( catalog: &[(String, String, String)], firmware: Option<&[u8]>, rom: Option<&[u8]>, bootloader: Option<&[u8]>, partition_table: Option<&[u8]>, ) -> Lock
Build the lock from what a run loaded: catalog holds one
(type_key, version, manifest_text) per entry; the remaining arguments
are the bytes it flashed (application image, mask ROM, bootloader,
partition table), None when absent.
The manifest text is hashed, not its path: text is what behaviour
derives from, while a path is a checkout location that would make the
lock machine-specific. A builtin include_str! manifest and a
directory manifest with identical bytes therefore hash identically.
Entries are sorted by catalog id so the file is canonical.
Sourcepub fn load(path: &Path) -> Result<Lock, String>
pub fn load(path: &Path) -> Result<Lock, String>
Read a lock file. A missing file is an Err like any I/O failure;
absence is not a mismatch, so the caller decides whether to write one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lock
impl<'de> Deserialize<'de> for Lock
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Lock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Lock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Lock
Source§impl Serialize for Lock
impl Serialize for Lock
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Lock
Auto Trait Implementations§
impl Forget for Lock
impl Freeze for Lock
impl Move 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
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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