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> PartialOrd for Token<'a>
impl<'a> PartialOrd for Token<'a>
impl<'a> Copy for Token<'a>
impl<'a> Eq for Token<'a>
Auto Trait Implementations§
impl<'a> Freeze for Token<'a>
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<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