[][src]Trait syn::spanned::Spanned

pub trait Spanned: Sealed {
    fn span(&self) -> Span;
}

A trait that can provide the Span of the complete contents of a syntax tree node.

This trait is automatically implemented for all types that implement ToTokens from the quote crate. It is sealed and cannot be implemented outside of the Syn crate other than by implementing ToTokens.

See the module documentation for an example.

This trait is available if Syn is built with both the "parsing" and "printing" features.

Required methods

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree node, or Span::call_site() if this node is empty.

Loading content...

Implementors

impl<T> Spanned for T where
    T: ToTokens
[src]

Loading content...