pub enum Token {
Blank {
line_num: u32,
},
EnvelopeBegin {
line_num: u32,
},
EnvelopeEnd {
line_num: u32,
},
Abort {
line_num: u32,
},
Header {
line_num: u32,
path: String,
file_hash: Option<String>,
},
Op {
line_num: u32,
target: BlockTarget,
},
PayloadLiteral {
line_num: u32,
text: String,
},
Raw {
line_num: u32,
text: String,
},
}Expand description
One classified line of patch text.
Variants§
Blank
An empty line.
EnvelopeBegin
*** Begin Patch — envelope start, consumed.
EnvelopeEnd
*** End Patch — envelope end, terminates parsing.
Abort
*** Abort — truncation sentinel, terminates parsing.
Header
[PATH] or [PATH#HASH] section header.
Fields
Op
A hunk header verb + target.
Fields
§
target: BlockTargetParsed verb and target of the hunk header.
PayloadLiteral
A +TEXT body row.
Fields
Raw
Anything else (contamination check happens downstream).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
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