pub struct Spanned<T> {
pub v: T,
pub span: Range<usize>,
}
Expand description
A value with the span it corresponds to in the source code.
Spans can be detached, this means that they deliberately do not point
into the source code. Such spans are created when manually setting fields
with an empty bibliography or after parsing a file. Detached spans do not
indicate valid index ranges in the source files and must not be used as
such. A spanned item can be checked for detachment by calling
Self::is_detached
.
Fields§
§v: T
The spanned value.
span: Range<usize>
The location in source code of the value.
Implementations§
Trait Implementations§
source§impl<T: PartialEq> PartialEq for Spanned<T>
impl<T: PartialEq> PartialEq for Spanned<T>
impl<T: Eq> Eq for Spanned<T>
impl<T> StructuralEq for Spanned<T>
impl<T> StructuralPartialEq for Spanned<T>
Auto Trait Implementations§
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