pub struct MatchContext {
pub path: String,
pub language: String,
pub rule_id: String,
pub start: usize,
pub finish: usize,
pub line: usize,
pub col: usize,
pub match_text: String,
pub captures: Vec<(String, String)>,
}Expand description
Everything a callback knows about one match.
Fields§
§path: StringThe linted file’s path ("" when the caller has none).
language: StringThe document’s language id ("" when the caller has none).
rule_id: StringThe id of the rule that matched.
start: usizeAbsolute byte offset of the match start.
finish: usizeAbsolute byte offset just past the match.
line: usize1-based line of the match start.
col: usize1-based character column of the match start.
match_text: StringThe text the pattern matched.
captures: Vec<(String, String)>Capture groups: named groups by name, numbered groups as "1",
"2", … (the whole match is match_text).
Implementations§
Trait Implementations§
Source§impl Clone for MatchContext
impl Clone for MatchContext
Auto Trait Implementations§
impl Freeze for MatchContext
impl RefUnwindSafe for MatchContext
impl Send for MatchContext
impl Sync for MatchContext
impl Unpin for MatchContext
impl UnsafeUnpin for MatchContext
impl UnwindSafe for MatchContext
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