LineFilter

Trait LineFilter 

Source
pub trait LineFilter {
    // Required methods
    fn is_in_comment(&self, line: &str, pattern_pos: usize) -> bool;
    fn is_in_string(&self, line: &str, pattern_pos: usize) -> bool;
}
Expand description

Trait for language-specific line filtering

Required Methods§

Source

fn is_in_comment(&self, line: &str, pattern_pos: usize) -> bool

Check if a position in a line is inside a comment

§Arguments
  • line - The full line of text
  • pattern_pos - Byte position where the pattern starts (0-indexed)
§Returns

true if the pattern is definitely inside a comment, false otherwise

Source

fn is_in_string(&self, line: &str, pattern_pos: usize) -> bool

Check if a position in a line is inside a string literal

§Arguments
  • line - The full line of text
  • pattern_pos - Byte position where the pattern starts (0-indexed)
§Returns

true if the pattern is definitely inside a string literal, false otherwise

Implementors§