Trait druid::text::TextStorage
source · pub trait TextStorage: PietTextStorage + Data {
// Provided methods
fn add_attributes(
&self,
builder: PietTextLayoutBuilder,
env: &Env
) -> PietTextLayoutBuilder { ... }
fn env_update(&self, ctx: &EnvUpdateCtx<'_, '_>) -> bool { ... }
fn links(&self) -> &[Link] { ... }
}
Expand description
A type that represents text that can be displayed.
Provided Methods§
sourcefn add_attributes(
&self,
builder: PietTextLayoutBuilder,
env: &Env
) -> PietTextLayoutBuilder
fn add_attributes( &self, builder: PietTextLayoutBuilder, env: &Env ) -> PietTextLayoutBuilder
If this TextStorage object manages style spans, it should implement this method and update the provided builder with its spans, as required.
sourcefn env_update(&self, ctx: &EnvUpdateCtx<'_, '_>) -> bool
fn env_update(&self, ctx: &EnvUpdateCtx<'_, '_>) -> bool
This is called whenever the Env changes and should return true if the layout should be rebuilt.