pub struct Span<T: ?Sized> {
pub item: T,
/* private fields */
}Expand description
Span is used to wrap types which do not implement Spanned in a type that does.
Span is a bit special in that it is intended to be as transparent as possible, that means that it implements a variety of traits in a passthrough fashion, so that the span added to the underlying type does not change its behavior with regards to equality, hashing, ordering, etc. It does however have a Debug implementation that shows the span.
Fields§
§item: TThe underlying item wrapped by this Span
Implementations§
Source§impl<T> Span<T>
impl<T> Span<T>
Sourcepub const fn new(span: SourceSpan, item: T) -> Self
pub const fn new(span: SourceSpan, item: T) -> Self
Construct a new Span from a SourceSpan and a [T]
Trait Implementations§
Source§impl<T: Ord> Ord for Span<T>
impl<T: Ord> Ord for Span<T>
Source§impl<T, U> PartialOrd<Span<U>> for Span<T>where
T: PartialOrd<U>,
U: PartialOrd<T>,
impl<T, U> PartialOrd<Span<U>> for Span<T>where
T: PartialOrd<U>,
U: PartialOrd<T>,
impl<T: Copy> Copy for Span<T>
impl<T: Eq> Eq for Span<T>
impl<T: Send> Send for Span<T>
impl<T: Sync> Sync for Span<T>
Auto Trait Implementations§
impl<T> Freeze for Span<T>
impl<T> RefUnwindSafe for Span<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for Span<T>
impl<T> UnwindSafe for Span<T>where
T: UnwindSafe + ?Sized,
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