Struct regex_syntax::ast::Position
source · [−]Expand description
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
.
Implementations
sourceimpl Position
impl Position
sourcepub fn new(offset: usize, line: usize, column: usize) -> Position
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
sourceimpl Ord for Position
impl Ord for Position
sourceimpl PartialOrd<Position> for Position
impl PartialOrd<Position> for Position
sourcefn partial_cmp(&self, other: &Position) -> Option<Ordering>
fn partial_cmp(&self, other: &Position) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Position
impl Eq for Position
impl StructuralEq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more