Struct castle_input_cursor::Position
source · pub struct Position {
pub line_number: NonZeroU32,
pub column_number: NonZeroU32,
}
Expand description
A position in the source code.
Stores both the column number and the line number.
Note that spans are of the form [begining, end) i.e. that the begining position is inclusive and the end position is exclusive. See test check_positions from syntax/lexer/tests.rs for an example.
Fields§
§line_number: NonZeroU32
Line number.
column_number: NonZeroU32
Column number.
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