Struct Position
pub struct Position { pub offset: usize, pub line: usize, pub column: usize }
A single position in a regular expression.
A position encodes one half of a span, and include the byte offset, line number and column number.
Fields
offset: usizeThe absolute offset of this position, starting at
0from the beginning of the regular expression pattern string.line: usizeThe line number, starting at
1.column: usizeThe approximate column number, starting at
1.
Implementations
impl Position
fn new(offset: usize, line: usize, column: usize) -> PositionCreate a new position with the given information.
offsetis the absolute offset of the position, starting at0from the beginning of the regular expression pattern string.lineis the line number, starting at1.columnis the approximate column number, starting at1.
Trait Implementations
impl Clone for Position
fn clone(&self) -> Self
impl Copy for Position
impl Debug for Position
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Position
impl Ord for Position
fn cmp(&self, other: &Position) -> Ordering
impl PartialEq for Position
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Position
fn partial_cmp(&self, other: &Position) -> Option<Ordering>