pub struct Token<'a> { /* private fields */ }
Expand description
Represents a token from a sourcemap
Implementations§
source§impl<'a> Token<'a>
impl<'a> Token<'a>
sourcepub fn get_dst_line(&self) -> u32
pub fn get_dst_line(&self) -> u32
get the destination (minified) line number
sourcepub fn get_dst_col(&self) -> u32
pub fn get_dst_col(&self) -> u32
get the destination (minified) column number
sourcepub fn get_src_line(&self) -> u32
pub fn get_src_line(&self) -> u32
get the source line number
sourcepub fn get_src_col(&self) -> u32
pub fn get_src_col(&self) -> u32
get the source column number
sourcepub fn get_src_id(&self) -> u32
pub fn get_src_id(&self) -> u32
Return the source ID of the token
sourcepub fn get_source(&self) -> Option<&'a str>
pub fn get_source(&self) -> Option<&'a str>
get the source if it exists as string
sourcepub fn has_source(&self) -> bool
pub fn has_source(&self) -> bool
Is there a source for this token?
sourcepub fn get_name_id(&self) -> u32
pub fn get_name_id(&self) -> u32
Return the name ID of the token
sourcepub fn to_tuple(&self) -> (&'a str, u32, u32, Option<&'a str>)
pub fn to_tuple(&self) -> (&'a str, u32, u32, Option<&'a str>)
Converts the token into a debug tuple in the form
(source, src_line, src_col, name)
sourcepub fn get_raw_token(&self) -> RawToken
pub fn get_raw_token(&self) -> RawToken
Get the underlying raw token
sourcepub fn get_source_view(&self) -> Option<&SourceView<'_>>
pub fn get_source_view(&self) -> Option<&SourceView<'_>>
Returns the referenced source view.
Trait Implementations§
source§impl<'a> Ord for Token<'a>
impl<'a> Ord for Token<'a>
source§impl<'a> PartialEq<Token<'a>> for Token<'a>
impl<'a> PartialEq<Token<'a>> for Token<'a>
source§impl<'a> PartialOrd<Token<'a>> for Token<'a>
impl<'a> PartialOrd<Token<'a>> for Token<'a>
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<'a> Copy for Token<'a>
impl<'a> Eq for Token<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Token<'a>
impl<'a> !Send for Token<'a>
impl<'a> !Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> !UnwindSafe for Token<'a>
Blanket Implementations§
source§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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.