pub struct GPosIdx(pub PosIdx);Expand description
A position index backed by a global [PositionTable]
Tuple Fields§
§0: PosIdxImplementations§
Source§impl 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) -> (&str, (usize, usize))
pub fn get_line_num(&self) -> (&str, (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 StructuralPartialEq for GPosIdx
Auto Trait Implementations§
impl Freeze for GPosIdx
impl RefUnwindSafe for GPosIdx
impl Send for GPosIdx
impl Sync for GPosIdx
impl Unpin for GPosIdx
impl UnwindSafe for GPosIdx
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more