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

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

The immutable, borrowed equivalent of SpannedString.

Methods

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

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]

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]

type S = IndexedSpan<T>

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

fn as_ref(&self) -> SpannedTextRef<Self>[src]

Returns a SpannedText by reference.

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

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

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> Sync for SpannedStr<'a, T> where
    T: Sync

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

impl<'a, T> Unpin for SpannedStr<'a, T>

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

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

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T[src]