Struct regex_syntax::ast::Position [−][src]
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: usize
The absolute offset of this position, starting at 0
from the
beginning of the regular expression pattern string.
line: usize
The line number, starting at 1
.
column: usize
The approximate column number, starting at 1
.
Methods
impl Position
[src]
[−]
impl Position
pub fn new(offset: usize, line: usize, column: usize) -> Position
[src]
[−]
pub fn new(offset: usize, line: usize, column: usize) -> Position
Create a new position with the given information.
offset
is the absolute offset of the position, starting at 0
from
the beginning of the regular expression pattern string.
line
is the line number, starting at 1
.
column
is the approximate column number, starting at 1
.
Trait Implementations
impl Clone for Position
[src]
[+]
impl Clone for Position
impl Copy for Position
[src]
impl Copy for Position
impl Eq for Position
[src]
impl Eq for Position
impl PartialEq for Position
[src]
[+]
impl PartialEq for Position
impl Debug for Position
[src]
[+]
impl Debug for Position
impl Ord for Position
[src]
[+]
impl Ord for Position
impl PartialOrd for Position
[src]
[+]
impl PartialOrd for Position