pub struct Spanned<T> {
pub contents: T,
span: Span,
}
Fields§
§contents: T
§span: Span
Implementations§
Trait Implementations§
Source§impl<T: Hash> Hash for Spanned<T>
Hash-based data structures (HashMap, HashSet) rely on the inverse of Hash
being injective, i.e. x.eq(y) => hash(x, H) == hash(y, H), we hence align
this with the above
impl<T: Hash> Hash for Spanned<T>
Hash-based data structures (HashMap, HashSet) rely on the inverse of Hash being injective, i.e. x.eq(y) => hash(x, H) == hash(y, H), we hence align this with the above
Source§impl<T: Ord> Ord for Spanned<T>
impl<T: Ord> Ord for Spanned<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for Spanned<T>
This is important for tests. Two Spanned objects are equal if their content is equal
They may not have the same span. Use into_span to test for Span being equal specifically
impl<T: PartialEq> PartialEq for Spanned<T>
This is important for tests. Two Spanned objects are equal if their content is equal They may not have the same span. Use into_span to test for Span being equal specifically
Source§impl<T: PartialOrd> PartialOrd for Spanned<T>
impl<T: PartialOrd> PartialOrd for Spanned<T>
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