pub struct SpanWithSource<T> {
pub span: Span,
pub src: T,
}Fields§
§span: SpanThe location within Self::src to refer to.
src: TThe entire source string.
Implementations§
Source§impl<'a> SpanWithSource<&'a str>
impl<'a> SpanWithSource<&'a str>
Sourcepub fn as_str(&self) -> &'a str
pub fn as_str(&self) -> &'a str
Get the str for the string pointed to by Self::span within Self::src.
Source§impl<T: AsRef<str>> SpanWithSource<T>
impl<T: AsRef<str>> SpanWithSource<T>
pub fn contextual_formatter(&self) -> impl '_ + Display
Trait Implementations§
Source§impl<T: Clone> Clone for SpanWithSource<T>
impl<T: Clone> Clone for SpanWithSource<T>
Source§fn clone(&self) -> SpanWithSource<T>
fn clone(&self) -> SpanWithSource<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SpanWithSource<T>
impl<T: Debug> Debug for SpanWithSource<T>
Source§impl<T> Display for SpanWithSource<T>
impl<T> Display for SpanWithSource<T>
Source§impl<T: PartialEq> PartialEq for SpanWithSource<T>
impl<T: PartialEq> PartialEq for SpanWithSource<T>
impl<T> StructuralPartialEq for SpanWithSource<T>
Auto Trait Implementations§
impl<T> Freeze for SpanWithSource<T>where
T: Freeze,
impl<T> RefUnwindSafe for SpanWithSource<T>where
T: RefUnwindSafe,
impl<T> Send for SpanWithSource<T>where
T: Send,
impl<T> Sync for SpanWithSource<T>where
T: Sync,
impl<T> Unpin for SpanWithSource<T>where
T: Unpin,
impl<T> UnwindSafe for SpanWithSource<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more