Skip to main content

Located

Trait Located 

Source
pub trait Located {
    // Required method
    fn span(&self) -> Option<Span>;
}
Expand description

Types that track a Span.

Located is a small trait to get a Span from types that track span information. The Span is returned in an Option because even types that track spans very precisely may not have such information available in the first place, probably when constructed by hand instead of being parsed.

Located can be automatically derived (see the corresponding proc-macro for details).

Required Methods§

Source

fn span(&self) -> Option<Span>

Gets the Span tracked by the type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Located for Option<Span>

Source§

fn span(&self) -> Option<Span>

Implementors§

Source§

impl<'a> Located for Identifier<'a>

Source§

impl<T> Located for Loc<T>