pub struct PatchSection {
pub file_path: String,
pub file_hash: String,
pub edits: Vec<Edit>,
pub warnings: Vec<String>,
}Expand description
One section of a parsed patch: a target file plus its eagerly-parsed edits.
Fields§
§file_path: StringResolved file path from the [PATH#HASH] header.
file_hash: String4-hex snapshot tag (empty when the header omitted one).
edits: Vec<Edit>Parsed line edits for this section’s diff body.
warnings: Vec<String>Warnings emitted during parsing.
Implementations§
Source§impl PatchSection
impl PatchSection
Sourcepub fn parse_diff(diff: &str) -> Result<(Vec<Edit>, Vec<String>), HashlineError>
pub fn parse_diff(diff: &str) -> Result<(Vec<Edit>, Vec<String>), HashlineError>
Re-parse this section’s diff body from diff (convenience for callers
holding a raw body rather than going through split_patch_input).
Trait Implementations§
Source§impl Clone for PatchSection
impl Clone for PatchSection
Source§fn clone(&self) -> PatchSection
fn clone(&self) -> PatchSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PatchSection
impl RefUnwindSafe for PatchSection
impl Send for PatchSection
impl Sync for PatchSection
impl Unpin for PatchSection
impl UnsafeUnpin for PatchSection
impl UnwindSafe for PatchSection
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
Mutably borrows from an owned value. Read more