Struct calyx_utils::GPosIdx
source · [−]pub struct GPosIdx(pub PosIdx);
Expand description
A position index backed by a global PositionTable
Tuple Fields
0: PosIdx
Implementations
sourceimpl GPosIdx
impl GPosIdx
sourcepub fn into_option(self) -> Option<Self>
pub fn into_option(self) -> Option<Self>
Convert the position into an optional.
Returns None
if the position is the unknown position.
sourcepub fn get_line_num(&self) -> (&String, (usize, usize))
pub fn get_line_num(&self) -> (&String, (usize, usize))
returns:
- the name of the file the span is in
- the (inclusive) range of lines within the span
sourcepub fn format_raw<S: AsRef<str>>(&self, err_msg: S) -> String
pub fn format_raw<S: AsRef<str>>(&self, err_msg: S) -> String
Format this position with the error message err_msg
sourcepub fn format<S: AsRef<str>>(&self, err_msg: S) -> String
pub fn format<S: AsRef<str>>(&self, err_msg: S) -> String
Format this position with filename header and the error message err_msg
pub fn get_location(&self) -> (&str, usize, usize)
Trait Implementations
impl Copy for GPosIdx
impl Eq for GPosIdx
impl StructuralEq for GPosIdx
impl StructuralPartialEq for GPosIdx
Auto Trait Implementations
impl RefUnwindSafe for GPosIdx
impl Send for GPosIdx
impl Sync for GPosIdx
impl Unpin for GPosIdx
impl UnwindSafe for GPosIdx
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
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.