pub struct Position {
pub offset: usize,
pub line: usize,
pub column: usize,
}
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§
Source§impl 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§
Source§impl Ord for Position
impl Ord for Position
Source§impl PartialOrd for Position
impl PartialOrd for Position
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)