[−][src]Struct cursive::utils::span::SpannedStr
The immutable, borrowed equivalent of SpannedString
.
Methods
impl<'a, T> SpannedStr<'a, T> where
T: 'a,
[src]
T: 'a,
pub fn new(source: &'a str, spans: &'a [IndexedSpan<T>]) -> Self
[src]
Creates a new SpannedStr
from the given references.
pub fn spans<'b>(&'b self) -> impl Iterator<Item = Span<'a, T>> + 'b where
'a: 'b,
[src]
'a: 'b,
Gives access to the parsed styled spans.
pub fn spans_raw(&self) -> &'a [IndexedSpan<T>]
[src]
Returns a reference to the indexed spans.
pub fn source(&self) -> &'a str
[src]
Returns a reference to the source (non-parsed) string.
pub fn is_empty(&self) -> bool
[src]
Returns true
if self
is empty.
Can be caused by an empty source, or no span.
Trait Implementations
impl<'a, T> SpannedText for SpannedStr<'a, T> where
T: 'a,
[src]
T: 'a,
type S = IndexedSpan<T>
Type of span returned by SpannedText::spans()
.
fn source(&self) -> &str
[src]
fn spans(&self) -> &[IndexedSpan<T>]
[src]
fn as_ref(&self) -> SpannedTextRef<Self>
[src]
Returns a SpannedText
by reference.
impl<'a, T: PartialEq> PartialEq<SpannedStr<'a, T>> for SpannedStr<'a, T>
[src]
fn eq(&self, other: &SpannedStr<'a, T>) -> bool
[src]
fn ne(&self, other: &SpannedStr<'a, T>) -> bool
[src]
impl<'a, T> From<&'a SpannedString<T>> for SpannedStr<'a, T>
[src]
fn from(other: &'a SpannedString<T>) -> Self
[src]
impl<'a, T> Clone for SpannedStr<'a, T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, T: Eq> Eq for SpannedStr<'a, T>
[src]
impl<'a, T: Debug> Debug for SpannedStr<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> Send for SpannedStr<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Sync for SpannedStr<'a, T> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,