Trait cursive::utils::span::SpannedText [−][src]
pub trait SpannedText { type S: AsRef<IndexedCow>; fn source(&self) -> &str; fn spans(&self) -> &[Self::S]; fn as_ref<'a>(&'a self) -> SpannedTextRef<'a, Self> { ... } }
Describes an object that appears like a SpannedStr
.
Associated Types
type S: AsRef<IndexedCow>
Type of span returned by SpannedText::spans()
.
Required Methods
fn source(&self) -> &str
Returns the source text.
fn spans(&self) -> &[Self::S]
Returns the spans for this text.
Provided Methods
fn as_ref<'a>(&'a self) -> SpannedTextRef<'a, Self>
Returns a SpannedText
by reference.
Implementors
impl<'a, T> SpannedText for &'a SpannedString<T> type S = IndexedSpan<T>;
impl<'a, C: ?Sized> SpannedText for SpannedTextRef<'a, C> where
C: 'a + SpannedText, type S = C::S;impl<'a, T> SpannedText for SpannedStr<'a, T> where
T: 'a, type S = IndexedSpan<T>;