pub struct PatternSetError { /* private fields */ }Expand description
The glob in a PatternSet::new list that failed to compile.
use ferralk_glob::{PatternOptions, PatternSet};
let globs = ["**/*.rs", "src/[a-z*"];
let error = PatternSet::new(globs, PatternOptions::walker()).expect_err("the class is never closed");
assert_eq!(globs[error.index()], "src/[a-z*");
// The byte offset points into that glob, as for `Pattern::compile`.
assert_eq!(error.pattern_error().offset(), 4);Implementations§
Source§impl PatternSetError
impl PatternSetError
Sourcepub const fn index(&self) -> usize
pub const fn index(&self) -> usize
The position of the failed glob in the list given to
PatternSet::new.
Sourcepub const fn pattern_error(&self) -> &PatternError
pub const fn pattern_error(&self) -> &PatternError
The compile error of that glob, with its byte offset into it.
Trait Implementations§
Source§impl Clone for PatternSetError
impl Clone for PatternSetError
Source§impl Debug for PatternSetError
impl Debug for PatternSetError
Source§impl Display for PatternSetError
impl Display for PatternSetError
impl Eq for PatternSetError
Source§impl Error for PatternSetError
impl Error for PatternSetError
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 PatternSetError
impl PartialEq for PatternSetError
impl StructuralPartialEq for PatternSetError
Auto Trait Implementations§
impl Freeze for PatternSetError
impl RefUnwindSafe for PatternSetError
impl Send for PatternSetError
impl Sync for PatternSetError
impl Unpin for PatternSetError
impl UnsafeUnpin for PatternSetError
impl UnwindSafe for PatternSetError
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