pub struct RdSourceMap { /* private fields */ }Expand description
Exact source spans for one parsed Rd document snapshot.
A map is valid only with the RdDocument snapshot returned by the same
parse call. Lookups use canonical paths exactly: there is no ancestor
fallback. Spans are minimal covering syntactic extents in the original
source, not decoded-leaf substring maps. Maps are producer-specific and
are not available for RDS-lowered or manually constructed ASTs. A map does
not provide ancestor fallback, multiple origins, or transformation
inheritance; delimiters discarded while canonicalizing the AST are not
represented as separate entries.
Implementations§
Source§impl RdSourceMap
impl RdSourceMap
Sourcepub fn span(&self, path: &RdAstPath) -> Option<&SourceSpan>
pub fn span(&self, path: &RdAstPath) -> Option<&SourceSpan>
Returns the exact span for a node or present option at path.
Trait Implementations§
Source§impl Clone for RdSourceMap
impl Clone for RdSourceMap
Auto Trait Implementations§
impl Freeze for RdSourceMap
impl RefUnwindSafe for RdSourceMap
impl Send for RdSourceMap
impl Sync for RdSourceMap
impl Unpin for RdSourceMap
impl UnsafeUnpin for RdSourceMap
impl UnwindSafe for RdSourceMap
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