#[non_exhaustive]pub enum LineRangeError {
InvalidSpec {
spec: String,
detail: String,
},
InvalidLineNumber {
spec: String,
line: i64,
},
EmptyRange {
spec: String,
},
InvalidRegex {
pattern: String,
detail: String,
},
RegexNoMatch {
pattern: String,
start_line: usize,
},
FuncnameNoMatch {
pattern: String,
start_line: usize,
},
FuncnameInvalidPattern {
pattern: String,
detail: String,
},
FuncnameAtEof {
pattern: String,
},
OutOfRange {
spec: String,
lines: usize,
},
}Expand description
Failure while parsing or resolving a -L line range specification.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidSpec
The spec could not be parsed or had trailing garbage.
InvalidLineNumber
A line number was zero or negative.
EmptyRange
Relative end ,+0 / ,-0 style empty span.
InvalidRegex
POSIX regex compilation failed.
RegexNoMatch
Regex did not match from the anchor line.
Fields
FuncnameNoMatch
:funcname pattern did not match a function header.
FuncnameInvalidPattern
:funcname pattern is invalid.
FuncnameAtEof
:funcname match ended at EOF (Git rejects blaming through EOF for func ranges).
OutOfRange
Resolved range lies outside the file.
Trait Implementations§
Source§impl Debug for LineRangeError
impl Debug for LineRangeError
Source§impl Display for LineRangeError
impl Display for LineRangeError
impl Eq for LineRangeError
Source§impl Error for LineRangeError
impl Error for LineRangeError
1.30.0 · 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()
Source§impl PartialEq for LineRangeError
impl PartialEq for LineRangeError
impl StructuralPartialEq for LineRangeError
Auto Trait Implementations§
impl Freeze for LineRangeError
impl RefUnwindSafe for LineRangeError
impl Send for LineRangeError
impl Sync for LineRangeError
impl Unpin for LineRangeError
impl UnsafeUnpin for LineRangeError
impl UnwindSafe for LineRangeError
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.