pub struct Position {
pub line: usize,
pub offset: usize,
}
Expand description
A two (zero-based) coordinate value representing a location in a buffer.
The offset
field is so named to emphasize that positions point to
locations before/after characters, not characters themselves, in an effort
to avoid fencepost errors.
Fields§
§line: usize
§offset: usize
Implementations§
Trait Implementations§
source§impl AddAssign<Distance> for Position
impl AddAssign<Distance> for Position
source§fn add_assign(&mut self, distance: Distance)
fn add_assign(&mut self, distance: Distance)
Performs the
+=
operation. Read moresource§impl PartialEq for Position
impl PartialEq for Position
source§impl PartialOrd for Position
impl PartialOrd for Position
1.0.0 · source§fn 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 moreimpl Copy 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§
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