Type Alias Span

pub type Span = SpanData<SyntaxContext>;

Aliased Type§

struct Span {
    pub range: TextRange,
    pub anchor: SpanAnchor,
    pub ctx: SyntaxContext,
}

Fields§

§range: TextRange

The text range of this span, relative to the anchor. We need the anchor for incrementality, as storing absolute ranges will require recomputation on every change in a file at all times.

§anchor: SpanAnchor

The anchor this span is relative to.

§ctx: SyntaxContext

The syntax context of the span.

Implementations

§

impl<Ctx> SpanData<Ctx>
where Ctx: Copy,

pub fn eq_ignoring_ctx(self, other: SpanData<Ctx>) -> bool

§

impl SpanData<SyntaxContext>

pub fn cover(self, other: SpanData<SyntaxContext>) -> SpanData<SyntaxContext>

Trait Implementations

§

impl<Ctx> Clone for SpanData<Ctx>
where Ctx: Clone,

§

fn clone(&self) -> SpanData<Ctx>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<Ctx> Debug for SpanData<Ctx>
where Ctx: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for SpanData<SyntaxContext>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<Ctx> Hash for SpanData<Ctx>
where Ctx: Hash,

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<Ctx> PartialEq for SpanData<Ctx>
where Ctx: PartialEq,

§

fn eq(&self, other: &SpanData<Ctx>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<Ctx> Copy for SpanData<Ctx>
where Ctx: Copy,

§

impl<Ctx> Eq for SpanData<Ctx>
where Ctx: Eq,

§

impl<Ctx> StructuralPartialEq for SpanData<Ctx>