swc_common

Trait Spanned

source
pub trait Spanned {
    // Required method
    fn span(&self) -> Span;

    // Provided methods
    fn span_lo(&self) -> BytePos { ... }
    fn span_hi(&self) -> BytePos { ... }
}
Expand description

§Derive

This trait can be derived with #[derive(Spanned)].

Required Methods§

source

fn span(&self) -> Span

Get span of self.

Provided Methods§

source

fn span_lo(&self) -> BytePos

source

fn span_hi(&self) -> BytePos

Implementations on Foreign Types§

source§

impl<S> Spanned for Option<S>
where S: Spanned,

source§

fn span(&self) -> Span

source§

fn span_lo(&self) -> BytePos

source§

fn span_hi(&self) -> BytePos

source§

impl<S> Spanned for &S
where S: ?Sized + Spanned,

source§

fn span(&self) -> Span

source§

fn span_lo(&self) -> BytePos

source§

fn span_hi(&self) -> BytePos

source§

impl<S> Spanned for Box<S>
where S: ?Sized + Spanned,

source§

fn span(&self) -> Span

source§

fn span_lo(&self) -> BytePos

source§

fn span_hi(&self) -> BytePos

source§

impl<S> Spanned for Rc<S>
where S: ?Sized + Spanned,

source§

fn span(&self) -> Span

source§

fn span_lo(&self) -> BytePos

source§

fn span_hi(&self) -> BytePos

source§

impl<T> Spanned for Cow<'_, T>
where T: Spanned + Clone,

source§

fn span(&self) -> Span

source§

fn span_lo(&self) -> BytePos

source§

fn span_hi(&self) -> BytePos

source§

impl<T> Spanned for Box<T>
where T: Spanned,

Available on crate feature nightly only.
source§

fn span(&self) -> Span

Implementors§

source§

impl Spanned for Comment

source§

impl Spanned for BytePos

source§

impl Spanned for Span

source§

impl<A, B> Spanned for Either<A, B>
where A: Spanned, B: Spanned,

source§

impl<S> Spanned for Arc<S>
where S: ?Sized + Spanned,