pub trait Locatable: Sized {
type Located: Located;
// Required method
fn over(self, span: impl Into<Option<Span>>) -> Self::Located;
}Expand description
Add or set a Span to a type.
Locatable is for Located types that support changing their tracked Span, or for types that
can be turned into Located types. The Locatable::over method is a builder method used to
create a new object with a different Span, and the Located associated type tell the type of
the result.
Example:
let term = term!(* x y).over(span);Locatable can be automatically derived (see the corresponding proc-macro for details).
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".