pub struct Spanned<T> { /* private fields */ }Expand description
A value of type T associated with a span in the source text.
Implementations§
Source§impl<T, E> Spanned<Result<T, E>>
impl<T, E> Spanned<Result<T, E>>
Sourcepub fn unzip(self) -> Result<Spanned<T>, Spanned<E>>
pub fn unzip(self) -> Result<Spanned<T>, Spanned<E>>
Unzips an Spanned<Result<T, E>> into a Result<Spanned<T>, Spanned<E>>.
If inner is of the Ok variant this method returns Ok(Spanned { inner: t, .. }.
Otherwise, Err(Spanned { inner: e, .. } is returned. Where t and e represent
the Ok and Err values of the inner result.
Trait Implementations§
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