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
)