Struct as3_parser::Location
source · pub struct Location { /* private fields */ }
Expand description
Represents a source location. This location includes spanning lines and columns and the reference source.
Implementations§
source§impl Location
impl Location
sourcepub fn with_lines_and_offsets(
source: &Rc<Source>,
first_line_number: usize,
last_line_number: usize,
first_offset: usize,
last_offset: usize
) -> Self
pub fn with_lines_and_offsets( source: &Rc<Source>, first_line_number: usize, last_line_number: usize, first_offset: usize, last_offset: usize ) -> Self
Builds a location.
sourcepub fn with_line_and_offsets(
source: &Rc<Source>,
line_number: usize,
first_offset: usize,
last_offset: usize
) -> Self
pub fn with_line_and_offsets( source: &Rc<Source>, line_number: usize, first_offset: usize, last_offset: usize ) -> Self
Builds a location.
sourcepub fn with_line_and_offset(
source: &Rc<Source>,
line_number: usize,
offset: usize
) -> Self
pub fn with_line_and_offset( source: &Rc<Source>, line_number: usize, offset: usize ) -> Self
Builds a location.
sourcepub fn combine_with(&self, other: Location) -> Self
pub fn combine_with(&self, other: Location) -> Self
Build a location by combining two locations. self
serves as the first location, while other
serves as the
last location.
sourcepub fn combine_with_start_of(&self, other: Location) -> Self
pub fn combine_with_start_of(&self, other: Location) -> Self
Build a location by combining two locations. self
serves as the first location, while the first column and first line
of other
serves as the last location.
sourcepub fn first_line_number(&self) -> usize
pub fn first_line_number(&self) -> usize
First line number, counted from one.
sourcepub fn last_line_number(&self) -> usize
pub fn last_line_number(&self) -> usize
Last line number, counted from one.
pub fn first_offset(&self) -> usize
pub fn last_offset(&self) -> usize
sourcepub fn first_column(&self) -> usize
pub fn first_column(&self) -> usize
Zero based first column of the location in code points.
sourcepub fn last_column(&self) -> usize
pub fn last_column(&self) -> usize
Zero based last column of the location in code points.
pub fn character_count(&self) -> usize
sourcepub fn line_break(&self, other: &Self) -> bool
pub fn line_break(&self, other: &Self) -> bool
Indicates whether a previous location and a next location have a line break in between.
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 for Location
impl PartialEq for Location
source§impl PartialOrd for Location
impl PartialOrd 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 moreimpl Eq for Location
Auto Trait Implementations§
impl !RefUnwindSafe for Location
impl !Send for Location
impl !Sync for Location
impl Unpin for Location
impl !UnwindSafe for Location
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.