syn::spanned

Trait Spanned

Source
pub trait Spanned: Sealed {
    // Required method
    fn span(&self) -> Span;
}
Available on crate features parsing and printing only.
Expand description

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, as well as for Span itself.

See the module documentation for an example.

Required Methods§

Source

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.

Implementors§

Source§

impl Spanned for QSelf

Source§

impl<T: ?Sized + ToTokens> Spanned for T