pub trait HasSourceSpan {
// Required methods
fn source_span(&self) -> Option<&Span>;
fn set_source_span(&mut self, span: Span);
fn unset_source_span(&mut self);
// Provided methods
fn with_source_span(self, ts_span: Span) -> Self
where Self: Sized { ... }
fn has_source_span(&self) -> bool { ... }
}Expand description
This trait is implemented by types that include a source location from which they were parsed.
Required Methods§
fn source_span(&self) -> Option<&Span>
fn set_source_span(&mut self, span: Span)
fn unset_source_span(&mut self)
Provided Methods§
fn with_source_span(self, ts_span: Span) -> Selfwhere
Self: Sized,
fn has_source_span(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".