Struct rustpython_compiler_core::Location
source · pub struct Location { /* private fields */ }
Expand description
Sourcecode location.
Implementations§
source§impl Location
impl Location
sourcepub fn new(row: usize, column: usize) -> Self
pub fn new(row: usize, column: usize) -> Self
Creates a new Location object at the given row and column.
Example
use rustpython_compiler_core::Location;
let loc = Location::new(10, 10);
pub fn reset(&mut self)
pub fn go_right(&mut self)
pub fn go_left(&mut self)
pub fn newline(&mut self)
pub fn with_col_offset<T: TryInto<isize>>(&self, offset: T) -> Selfwhere
<T as TryInto<isize>>::Error: Debug,
pub fn with_row_offset<T: TryInto<isize>>(&self, offset: T) -> Selfwhere
<T as TryInto<isize>>::Error: Debug,
Trait Implementations§
source§impl<'de> Deserialize<'de> for Location
impl<'de> Deserialize<'de> for Location
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 Location
impl Ord for Location
source§impl PartialEq<Location> for Location
impl PartialEq<Location> for Location
source§impl PartialOrd<Location> for Location
impl PartialOrd<Location> for Location
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