[][src]Trait piet::TextStorage

pub trait TextStorage: 'static {
    fn as_str(&self) -> &str;
}

A type that stores text.

This allows the client to more completely control how text is stored. If you do not care about this, implementations are provided for String, Arc<str>, and Rc<str>.

This has a 'static bound because the inner type will be behind a shared pointer.

Required methods

fn as_str(&self) -> &str

Return the underlying text as a contiguous buffer.

Types that do not store their text as a contiguous buffer (such as ropes or gap buffers) will need to use a wrapper to maintain a separate contiguous buffer as required.

In practice, these types should be using a TextLayout object per paragraph, and in general a separate buffer will be unnecessary.

Loading content...

Trait Implementations

impl Deref for dyn TextStorage[src]

type Target = str

The resulting type after dereferencing.

Implementations on Foreign Types

impl TextStorage for Arc<str>[src]

impl TextStorage for Rc<str>[src]

impl TextStorage for String[src]

impl TextStorage for &'static str[src]

Loading content...

Implementors

Loading content...