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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)