pub enum HashlineError {
Parse {
line: u32,
msg: String,
},
NotFound {
path: String,
},
MissingSnapshotTag(String),
UnseenLines(String),
Mismatch {
detail: String,
expected: String,
actual: String,
},
DuplicateCanonicalPath {
path: String,
},
NoOp {
path: String,
},
LineOutOfBounds {
line: u32,
total: usize,
},
Io(Error),
}Expand description
The umbrella error type for the hashline crate.
Structured errors raised across the parser, tokenizer, patcher, and recovery paths. Defined here (per the omp-adoption design §3.10) so the lower-level tokenizer/parser can reference it without an extra module.
Variants§
Parse
A patch grammar / structural parse error at a given line.
Fields
NotFound
File does not exist.
MissingSnapshotTag(String)
Section omitted the mandatory snapshot tag (omp missingSnapshotTagMessage).
UnseenLines(String)
An anchored edit referenced unseen lines (omp unseenLinesMessage).
Mismatch
Snapshot tag mismatch with live content (omp MismatchError).
Fields
DuplicateCanonicalPath
Multiple sections resolve to the same canonical path.
NoOp
Edits resulted in no net change.
LineOutOfBounds
Anchor line out of bounds for the file.
Fields
Io(Error)
Underlying I/O error.
Implementations§
Source§impl HashlineError
impl HashlineError
Trait Implementations§
Source§impl Debug for HashlineError
impl Debug for HashlineError
Source§impl Display for HashlineError
impl Display for HashlineError
Source§impl Error for HashlineError
impl Error for HashlineError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for HashlineError
impl !UnwindSafe for HashlineError
impl Freeze for HashlineError
impl Send for HashlineError
impl Sync for HashlineError
impl Unpin for HashlineError
impl UnsafeUnpin for HashlineError
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