pub trait TextStorage: TextStorage + Data {
    // Provided methods
    fn add_attributes(
        &self,
        builder: CairoTextLayoutBuilder,
        env: &Env
    ) -> CairoTextLayoutBuilder { ... }
    fn env_update(&self, ctx: &EnvUpdateCtx<'_, '_>) -> bool { ... }
    fn links(&self) -> &[Link] { ... }
}
Expand description

A type that represents text that can be displayed.

Provided Methods§

fn add_attributes( &self, builder: CairoTextLayoutBuilder, env: &Env ) -> CairoTextLayoutBuilder

If this TextStorage object manages style spans, it should implement this method and update the provided builder with its spans, as required.

fn env_update(&self, ctx: &EnvUpdateCtx<'_, '_>) -> bool

This is called whenever the Env changes and should return true if the layout should be rebuilt.

Any additional Link attributes on this text.

If this TextStorage object manages link attributes, it should implement this method and return any attached Links.

Unlike other attributes, links are managed in Druid, not in piet; as such they require a separate API.

Implementations on Foreign Types§

§

impl TextStorage for String

§

impl TextStorage for Arc<String>

§

impl TextStorage for Arc<str>

Implementors§