Skip to main content

UpdateFileDiff

Struct UpdateFileDiff 

Source
pub struct UpdateFileDiff {
    pub role: String,
    pub esp_path: String,
    pub current_sha256: Option<String>,
    pub current_error: Option<String>,
    pub fresh_sha256: Option<String>,
    pub fresh_error: Option<String>,
    pub would_change: bool,
}
Expand description

Per-file diff row between what’s currently on the stick’s ESP and what a fresh mkusb / direct-install flash would write. One row per canonical ESP destination (see direct_install::ESP_DEST_*).

Semantics of the hash/error pairs:

  • current_sha256 is None when the ESP file couldn’t be read (file absent, mtype missing, permission denied); in that case current_error carries the operator-facing reason.
  • fresh_sha256 is None when the host-side source couldn’t be hashed (package not installed, kernel glob missed, etc); fresh_error carries the reason.
  • would_change is the Phase-1 verdict the operator cares about: true only when both hashes are present AND they differ. When either hash is absent the comparison is inconclusive and would_change is false — the operator sees the error field and knows the answer isn’t “yes it would change”, it’s “we couldn’t tell”.

Added in UPDATE_SCHEMA_VERSION = 2 (Phase 1 of #181).

Fields§

§role: String

Role in the signed chain: shim, grub, grub_cfg_boot, grub_cfg_ubuntu, kernel, initrd. One entry per canonical destination (the two grub.cfg targets get separate rows because mkusb.sh writes both).

§esp_path: String

Destination path on the ESP, e.g. /EFI/BOOT/BOOTX64.EFI (no :: mtools prefix — stripped for consumers that want an operator-readable path).

§current_sha256: Option<String>

Lowercase hex sha256 of the file currently on the stick’s ESP. None when unreadable.

§current_error: Option<String>

Operator-readable error explaining why current_sha256 is absent. None when the read succeeded.

§fresh_sha256: Option<String>

Lowercase hex sha256 of what a fresh flash would install. None when the host-side source couldn’t be hashed.

§fresh_error: Option<String>

Operator-readable error explaining why fresh_sha256 is absent. None when the hash succeeded.

§would_change: bool

true when both hashes are present and differ. false when they match, OR when either hash is absent (see struct docs for the rationale).

Trait Implementations§

Source§

impl Clone for UpdateFileDiff

Source§

fn clone(&self) -> UpdateFileDiff

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UpdateFileDiff

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for UpdateFileDiff

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for UpdateFileDiff

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for UpdateFileDiff

Source§

fn eq(&self, other: &UpdateFileDiff) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for UpdateFileDiff

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for UpdateFileDiff

Source§

impl StructuralPartialEq for UpdateFileDiff

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,