[][src]Struct cursive::utils::span::SpannedStr

pub struct SpannedStr<'a, T> { /* fields omitted */ }

The immutable, borrowed equivalent of SpannedString.

Implementations

impl<'a, T> SpannedStr<'a, T> where
    T: 'a, 
[src]

pub fn new(source: &'a str, spans: &'a [IndexedSpan<T>]) -> SpannedStr<'a, T>[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]

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> Clone for SpannedStr<'a, T>[src]

impl<'a, T> Debug for SpannedStr<'a, T> where
    T: Debug
[src]

impl<'a, T> Eq for SpannedStr<'a, T> where
    T: Eq
[src]

impl<'a, T> From<&'a SpannedString<T>> for SpannedStr<'a, T>[src]

impl<'a, T> PartialEq<SpannedStr<'a, T>> for SpannedStr<'a, T> where
    T: PartialEq<T>, 
[src]

impl<'a, T> SpannedText for SpannedStr<'a, T> where
    T: 'a, 
[src]

type S = IndexedSpan<T>

Type of span returned by SpannedText::spans().

impl<'a, T> StructuralEq for SpannedStr<'a, T>[src]

impl<'a, T> StructuralPartialEq for SpannedStr<'a, T>[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for SpannedStr<'a, T> where
    T: RefUnwindSafe
[src]

impl<'a, T> Send for SpannedStr<'a, T> where
    T: Sync
[src]

impl<'a, T> Sync for SpannedStr<'a, T> where
    T: Sync
[src]

impl<'a, T> Unpin for SpannedStr<'a, T>[src]

impl<'a, T> UnwindSafe for SpannedStr<'a, T> where
    T: RefUnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> With for T[src]