pub struct Spanned<T> {
pub value: T,
pub range: TextRange,
}Expand description
A value paired with the source range that produced it.
Spans let editor-facing consumers connect recovered model values back to the original source text without exposing Tree-sitter nodes.
let spanned = achitek_source::Spanned {
value: "name",
range: achitek_source::TextRange::default(),
};
assert_eq!(spanned.as_ref(), &"name");Fields§
§value: TRecovered model value.
range: TextRangeSource range that produced the value.
Implementations§
Trait Implementations§
impl<T: Eq> Eq for Spanned<T>
impl<T: PartialEq> StructuralPartialEq for Spanned<T>
Auto Trait Implementations§
impl<T> Forget for Spanned<T>
impl<T> Freeze for Spanned<T>where
T: Freeze,
impl<T> Move for Spanned<T>
impl<T> RefUnwindSafe for Spanned<T>where
T: RefUnwindSafe,
impl<T> Send for Spanned<T>where
T: Send,
impl<T> Sync for Spanned<T>where
T: Sync,
impl<T> Unpin for Spanned<T>where
T: Unpin,
impl<T> UnsafeUnpin for Spanned<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Spanned<T>where
T: 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