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: 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: Ctx
The 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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