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§
Source§impl<'de, T> Deserialize<'de> for Spanned<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Spanned<T>where
T: Deserialize<'de>,
Source§fn 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
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: PartialOrd> PartialOrd for Spanned<T>
impl<T: PartialOrd> PartialOrd for Spanned<T>
Source§impl<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>
Source§fn 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.
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> StructuralPartialEq 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