pub struct Position {
pub line: u32,
pub character: u32,
}Expand description
A 1-based MCP position taken as input by Translator::handle_* methods.
Kept distinct from Position2D (which carries an output position back
to the caller) so passing a position into a handler always goes through a
named-field struct literal (Position { line, character }) instead of two
adjacent bare u32 arguments – a call site that swaps line and
character no longer compiles instead of silently sending a wrong
position to the LSP server (#322).
Fields§
§line: u32Line number (1-based).
character: u32Character offset (1-based).
Trait Implementations§
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 UnsafeUnpin 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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.