[][src]Struct cursive::views::TextContentRef

pub struct TextContentRef { /* fields omitted */ }

A reference to the text content.

This can be deref'ed into a StyledString.

This keeps the content locked. Do not store this!

Methods from Deref<Target = StyledString>

pub fn spans(&self) -> impl Iterator<Item = Span<T>>[src]

Gives access to the parsed styled spans.

pub fn spans_raw(&self) -> &[IndexedSpan<T>][src]

Returns a reference to the indexed spans.

pub fn source(&self) -> &str[src]

Returns a reference to the source string.

This is the non-parsed string.

pub fn is_empty(&self) -> bool[src]

Returns true if self is empty.

pub fn width(&self) -> usize[src]

Returns the width taken by this string.

This is the sum of the width of each span.

Trait Implementations

impl Deref for TextContentRef[src]

type Target = StyledString

The resulting type after dereferencing.

Auto Trait Implementations

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[src]

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.