[][src]Struct ornament::Text

pub struct Text<F>(_);

A decorated text. This is a collection of TextFragment.

Methods

impl<F> Text<F>[src]

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

Returns the length of the underlying text, without decorations, in bytes.

pub fn render<G>(&self, decorator: G) -> String where
    G: Fn(&TextFragment<F>) -> String
[src]

Converts the decorated text into rich text, using decorator to handle the different faces.

pub fn plain(&self) -> String[src]

Converts the decorated text into plain text, stripping all decorations.

impl<F> Text<F>[src]

pub fn iter(&self) -> TextIterator<F>[src]

Returns an iterator over the text.

Trait Implementations

impl<F: Default> Default for Text<F>[src]

impl<F: Clone> Clone for Text<F>[src]

impl<F: PartialEq> PartialEq<Text<F>> for Text<F>[src]

impl<'a, F> IntoIterator for &'a Text<F>[src]

type Item = &'a TextFragment<F>

The type of the elements being iterated over.

type IntoIter = TextIterator<'a, F>

Which kind of iterator are we turning this into?

impl<F> From<Vec<TextFragment<F>>> for Text<F>[src]

impl<F> From<TextFragment<F>> for Text<F>[src]

impl<'_, F: Default> From<&'_ str> for Text<F>[src]

impl<F: Default> From<String> for Text<F>[src]

impl<F: Debug> Debug for Text<F>[src]

Auto Trait Implementations

impl<F> Unpin for Text<F> where
    F: Unpin

impl<F> Sync for Text<F> where
    F: Sync

impl<F> Send for Text<F> where
    F: Send

impl<F> UnwindSafe for Text<F> where
    F: UnwindSafe

impl<F> RefUnwindSafe for Text<F> where
    F: RefUnwindSafe

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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]