Skip to main content

apply_patch_file

Function apply_patch_file 

Source
pub fn apply_patch_file(
    patch_path: impl AsRef<Path>,
    install_root: impl AsRef<Path>,
) -> ApplyResult<()>
Expand description

One-shot: open patch_path and apply every chunk to install_root with all defaults.

Equivalent to:

let reader = zipatch_rs::open_patch(patch_path)?;
zipatch_rs::ApplyConfig::new(install_root).apply_patch(reader)?;

The returned ApplyResult surfaces parsing failures as ApplyError::Parse and apply-side failures as their respective ApplyError variants, so a single match arm covers both layers.

Use the two-step form (open_patch + ApplyConfig::apply_patch) when you need to install an ApplyObserver, a apply::CheckpointSink, a custom apply::Vfs, a non-default Platform, or to reuse one ApplySession across multiple patches.

§Errors

Returns the first failure surfaced by either layer:

§Example

zipatch_rs::apply_patch_file(
    "H2017.07.11.0000.0000a.patch",
    "/opt/ffxiv/game",
).unwrap();