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§
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.