pub struct PatchManifest {
pub manifest_version: u32,
pub r2smt_version: String,
pub binary: String,
pub binary_sha256_before: String,
pub binary_sha256_after: String,
pub backup_path: String,
pub operations: Vec<PatchRecord>,
}Expand description
Durable record of an r2SMT patch session.
Fields§
§manifest_version: u32Schema version (currently MANIFEST_VERSION).
r2smt_version: Stringr2SMT version that produced the manifest.
binary: StringDisplay path of the patched binary at apply-time.
binary_sha256_before: StringSHA-256 of the binary before any patch was applied.
binary_sha256_after: StringSHA-256 of the binary after all operations completed.
backup_path: StringAbsolute path of the backup created before patching.
operations: Vec<PatchRecord>Operations applied, in execution order.
Implementations§
Source§impl PatchManifest
impl PatchManifest
Sourcepub const DEFAULT_FILE_NAME: &'static str = "r2smt.manifest.json"
pub const DEFAULT_FILE_NAME: &'static str = "r2smt.manifest.json"
Default file name r2SMT uses to persist a manifest next to its binary.
Sourcepub fn write_to(&self, path: impl AsRef<Path>) -> Result<()>
pub fn write_to(&self, path: impl AsRef<Path>) -> Result<()>
Write the manifest to path as pretty-printed JSON.
§Errors
Propagates I/O and serialisation failures.
Sourcepub fn read_from(path: impl AsRef<Path>) -> Result<Self>
pub fn read_from(path: impl AsRef<Path>) -> Result<Self>
Load a manifest from path.
Refuses to deserialize manifests with a version r2SMT does not understand so old binaries cannot corrupt newer patches.
§Errors
Returns Error::Parse if the file is missing, malformed, or
written by a future schema version.
Trait Implementations§
Source§impl Clone for PatchManifest
impl Clone for PatchManifest
Source§fn clone(&self) -> PatchManifest
fn clone(&self) -> PatchManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more