pub struct Spanned<T> {
pub span: Span,
pub item: T,
}
Expand description
A wrapper type that attaches a Span to a value
Fields
span: Span
item: T
Implementations
Trait Implementations
sourceimpl<'de, T> Deserialize<'de> for Spanned<T> where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Spanned<T> where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T: Ord> Ord for Spanned<T>
impl<T: Ord> Ord for Spanned<T>
sourceimpl<T: PartialOrd> PartialOrd<Spanned<T>> for Spanned<T>
impl<T: PartialOrd> PartialOrd<Spanned<T>> for Spanned<T>
sourcefn partial_cmp(&self, other: &Spanned<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &Spanned<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<T: PrettyDebug> PrettyDebug for Spanned<T>
impl<T: PrettyDebug> PrettyDebug for Spanned<T>
fn pretty(&self) -> DebugDocBuilder
fn to_doc(&self) -> DebugDoc
fn pretty_doc(
&self
) -> Doc<'static, BoxDoc<'static, ShellAnnotation>, ShellAnnotation>
fn pretty_builder(&self) -> DocBuilder<'static, BoxAllocator, ShellAnnotation>
sourcefn display(&self) -> String
fn display(&self) -> String
A convenience method that prints out the document without colors in 70 columns. Generally, you should use plain_string or colored_string if possible, but display() can be useful for trace lines and things like that, where you don’t have control over the terminal. Read more
fn plain_string(&self, width: usize) -> String
fn colored_string(&self, width: usize) -> String
impl<T: Copy> Copy 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more