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

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,