pub struct Position {
pub line: u32,
pub character: u32,
}
Expand description
Position in a text document expressed as zero-based line and character offset. A position is between two characters like an ‘insert’ cursor in a editor.
Fields§
§line: u32
Line position in a document (zero-based).
character: u32
Character offset on a line in a document (zero-based). The meaning of this
offset is determined by the negotiated PositionEncodingKind
.
If the character value is greater than the line length it defaults back to the line length.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Position
impl Ord for Position
source§impl PartialEq<Position> for Position
impl PartialEq<Position> for Position
source§impl PartialOrd<Position> for Position
impl PartialOrd<Position> 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 more