pub struct Tracer { /* private fields */ }
Expand description
Data structure that records information for token tracing
Implementations§
source§impl Tracer
impl Tracer
sourcepub fn register_source_code(
&mut self,
token: Option<Token>,
origin: Origin,
source_code: &str
) -> KeyRange
pub fn register_source_code( &mut self, token: Option<Token>, origin: Origin, source_code: &str ) -> KeyRange
Registers source code with the tracer.
The returned KeyRange should be used to assign Keys to the tokens that are lexed from the referenced source code. The tracer assumes that the first key is assigned to token corresponding to the first UTF-8 character in their source code, the second key to the second UTF-8 character, and so on.
sourcepub fn trace(
&self,
token: Token,
cs_name_interner: &CsNameInterner
) -> SourceCodeTrace
pub fn trace( &self, token: Token, cs_name_interner: &CsNameInterner ) -> SourceCodeTrace
Return a trace for the provided token.
pub fn trace_end_of_input(&self) -> SourceCodeTrace
Trait Implementations§
source§impl<'de> Deserialize<'de> for Tracer
impl<'de> Deserialize<'de> for Tracer
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Tracer
impl Send for Tracer
impl Sync for Tracer
impl Unpin for Tracer
impl UnwindSafe for Tracer
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