Struct rustpython_ast::Location
source · pub struct Location { /* private fields */ }
Expand description
Sourcecode location.
Implementations§
source§impl Location
impl Location
sourcepub fn new(row: usize, column: usize) -> Location
pub fn new(row: usize, column: usize) -> Location
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>(&self, offset: T) -> Locationwhere
T: TryInto<isize>,
<T as TryInto<isize>>::Error: Debug,
pub fn with_row_offset<T>(&self, offset: T) -> Locationwhere
T: TryInto<isize>,
<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<Location, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Location, <__D as Deserializer<'de>>::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 moresource§impl Serialize for Location
impl Serialize for Location
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more