pub trait HasPosition {
// Required method
fn position(&self) -> Position;
// Provided method
fn offset(&self) -> u32 { ... }
}Expand description
A trait for types that have a single, defined source position.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl HasPosition for Position
impl<T: HasSpan> HasPosition for T
A blanket implementation that allows any HasSpan type to also be treated
as a HasPosition type, using the span’s start as its position.