[][src]Struct kas_text::Text

pub struct Text<T: FormattableText> { /* fields omitted */ }

Text, prepared for display in a given enviroment

This struct is composed of three parts: an Environment, a representation of the FormattableText being displayed, and a TextDisplay object.

Most Functionality is implemented via the TextApi and TextApiExt traits.

Implementations

impl<T: FormattableText> Text<T>[src]

pub fn new(env: Environment, text: T) -> Self[src]

Construct from an environment and a text model

This struct must be made ready for usage by calling Text::prepare.

pub fn new_single(text: T) -> Self[src]

Construct from a default environment (single-line) and text

The environment is default-constructed, with line-wrapping turned off (see Environment::flags doc).

pub fn new_multi(text: T) -> Self[src]

Construct from a default environment (multi-line) and text

The environment is default-constructed (line-wrap on).

pub fn clone_text(&self) -> T where
    T: Clone
[src]

Clone the formatted text

pub fn take_text(self) -> T[src]

Extract text object, discarding the rest

pub fn text(&self) -> &T[src]

Access the formattable text object

pub fn set_text(&mut self, text: T)[src]

Set the text

One must call Text::prepare afterwards.

Trait Implementations

impl<T: FormattableText> AsMut<TextDisplay> for Text<T>[src]

impl<T: FormattableText> AsRef<TextDisplay> for Text<T>[src]

impl<T: Clone + FormattableText> Clone for Text<T>[src]

impl<T: Debug + FormattableText> Debug for Text<T>[src]

impl<T: FormattableText + Default> Default for Text<T>[src]

impl<T: EditableText> EditableTextApi for Text<T>[src]

impl<T: FormattableText> TextApi for Text<T>[src]

Auto Trait Implementations

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

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

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

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

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

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> 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.