pub struct Spanned<T> {
pub value: T,
pub span: Span,
}Expand description
A value with source span information.
This struct wraps a value along with the source location (offset and length) where it was parsed from. This is useful for error reporting that can point back to the original source.
Fields§
§value: TThe wrapped value.
span: SpanThe source span (offset and length).
Implementations§
Trait Implementations§
impl<T: Eq> Eq for Spanned<T>
Auto Trait Implementations§
impl<T> Freeze for Spanned<T>where
T: Freeze,
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> 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