pub struct SpanData<Ctx> {
pub range: TextRange,
pub anchor: SpanAnchor,
pub ctx: Ctx,
}Expand description
Spans represent a region of code, used by the IDE to be able link macro inputs and outputs
together. Positions in spans are relative to some SpanAnchor to make them more incremental
friendly.
Fields§
§range: TextRangeThe 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: SpanAnchorThe anchor this span is relative to.
ctx: CtxThe syntax context of the span.
Implementations§
Trait Implementations§
impl<Ctx: Copy> Copy for SpanData<Ctx>
impl<Ctx: Eq> Eq for SpanData<Ctx>
impl<Ctx> StructuralPartialEq for SpanData<Ctx>
Auto Trait Implementations§
impl<Ctx> Freeze for SpanData<Ctx>where
Ctx: Freeze,
impl<Ctx> RefUnwindSafe for SpanData<Ctx>where
Ctx: RefUnwindSafe,
impl<Ctx> Send for SpanData<Ctx>where
Ctx: Send,
impl<Ctx> Sync for SpanData<Ctx>where
Ctx: Sync,
impl<Ctx> Unpin for SpanData<Ctx>where
Ctx: Unpin,
impl<Ctx> UnwindSafe for SpanData<Ctx>where
Ctx: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more