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
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
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>
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 moreimpl 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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