Struct cranelift_isle::lexer::Pos
source · [−]Expand description
A source position.
Fields
file: usize
This source position’s file.
Indexes into Lexer::filenames
early in the compiler pipeline, and
later into TypeEnv::filenames
once we get into semantic analysis.
offset: usize
This source position’s byte offset in the file.
line: usize
This source position’s line number in the file.
col: usize
This source position’s column number in the file.
Implementations
sourceimpl Pos
impl Pos
sourcepub fn pretty_print(&self, filenames: &[Arc<str>]) -> String
pub fn pretty_print(&self, filenames: &[Arc<str>]) -> String
Print this source position as file.isle:12:34
.
sourcepub fn pretty_print_line(&self, filenames: &[Arc<str>]) -> String
pub fn pretty_print_line(&self, filenames: &[Arc<str>]) -> String
Print this source position as file.isle line 12
.
sourcepub fn pretty_print_with_filename(&self, filename: &str) -> String
pub fn pretty_print_with_filename(&self, filename: &str) -> String
As above for pretty_print
, but with the specific filename
already provided.
Trait Implementations
sourceimpl Ord for Pos
impl Ord for Pos
sourceimpl PartialOrd<Pos> for Pos
impl PartialOrd<Pos> for Pos
sourcefn partial_cmp(&self, other: &Pos) -> Option<Ordering>
fn partial_cmp(&self, other: &Pos) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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
impl Copy for Pos
impl Eq for Pos
impl StructuralEq for Pos
impl StructuralPartialEq for Pos
Auto Trait Implementations
impl RefUnwindSafe for Pos
impl Send for Pos
impl Sync for Pos
impl Unpin for Pos
impl UnwindSafe for Pos
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more