Skip to content
Clone
91691cd
13 lines 514 B Rust
//! patch Operation method trait for the module.
use crate::patch::types::{ApplyResult, ParsedPatch, Patch};
/// Operation trait for the patch module.
pub trait PatchOps {
/// Generate a unified diff patch.
fn patch_generate(&self, base: &str, head: &str) -> Result<Patch, crate::Error>;
/// Parse a patch.
fn patch_parse(&self, content: &str) -> Result<ParsedPatch, crate::Error>;
/// Apply a patch.
fn patch_apply(&self, patch: &str, base: &str) -> Result<ApplyResult, crate::Error>;
}