pub struct IndexedSpan<T> {
pub content: IndexedCow,
pub attr: T,
pub width: usize,
}
Expand description
An indexed span with an associated attribute.
Fields
content: IndexedCow
Content of the span.
attr: T
Attribute applied to the span.
width: usize
Width of the text for this span.
Implementations
sourceimpl<T> IndexedSpan<T>
impl<T> IndexedSpan<T>
sourcepub fn resolve<'a>(&'a self, source: &'a str) -> Span<'a, T>where
T: 'a,
pub fn resolve<'a>(&'a self, source: &'a str) -> Span<'a, T>where
T: 'a,
Resolve the span to a string slice and an attribute.
sourcepub fn resolve_mut<'a>(&'a mut self, source: &'a str) -> SpanMut<'a, T>where
T: 'a,
pub fn resolve_mut<'a>(&'a mut self, source: &'a str) -> SpanMut<'a, T>where
T: 'a,
Resolve the span to a string slice and a mutable attribute.
sourcepub fn as_ref_mut(&mut self) -> IndexedSpanRefMut<'_, T>
pub fn as_ref_mut(&mut self) -> IndexedSpanRefMut<'_, T>
Returns a reference struct to only access mutation of the attribute.
sourcepub fn simple_borrowed(content: &str, attr: T) -> IndexedSpan<T>
pub fn simple_borrowed(content: &str, attr: T) -> IndexedSpan<T>
Returns a single indexed span around the entire text.
sourcepub fn simple_owned(content: String, attr: T) -> IndexedSpan<T>
pub fn simple_owned(content: String, attr: T) -> IndexedSpan<T>
Returns a single owned indexed span around the entire text.
Trait Implementations
sourceimpl<T> AsRef<IndexedCow> for IndexedSpan<T>
impl<T> AsRef<IndexedCow> for IndexedSpan<T>
sourcefn as_ref(&self) -> &IndexedCow
fn as_ref(&self) -> &IndexedCow
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<T> Clone for IndexedSpan<T>where
T: Clone,
impl<T> Clone for IndexedSpan<T>where
T: Clone,
sourcefn clone(&self) -> IndexedSpan<T>
fn clone(&self) -> IndexedSpan<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T> Debug for IndexedSpan<T>where
T: Debug,
impl<T> Debug for IndexedSpan<T>where
T: Debug,
sourceimpl<T> Hash for IndexedSpan<T>where
T: Hash,
impl<T> Hash for IndexedSpan<T>where
T: Hash,
sourceimpl<T> PartialEq<IndexedSpan<T>> for IndexedSpan<T>where
T: PartialEq<T>,
impl<T> PartialEq<IndexedSpan<T>> for IndexedSpan<T>where
T: PartialEq<T>,
sourcefn eq(&self, other: &IndexedSpan<T>) -> bool
fn eq(&self, other: &IndexedSpan<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl<T> Eq for IndexedSpan<T>where
T: Eq,
impl<T> StructuralEq for IndexedSpan<T>
impl<T> StructuralPartialEq for IndexedSpan<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for IndexedSpan<T>where
T: RefUnwindSafe,
impl<T> Send for IndexedSpan<T>where
T: Send,
impl<T> Sync for IndexedSpan<T>where
T: Sync,
impl<T> Unpin for IndexedSpan<T>where
T: Unpin,
impl<T> UnwindSafe for IndexedSpan<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more