Type Definition druid::text::ArcStr

source ·
pub type ArcStr = Arc<str>;
Expand description

A reference counted string slice.

This is a data-friendly way to represent strings in Druid. Unlike String it cannot be mutated, but unlike String it can be cheaply cloned.

Trait Implementations§

source§

impl<T> From<Key<T>> for ArcStr

source§

fn from(src: Key<T>) -> ArcStr

Converts to this type from the input type.
source§

impl TextStorage for ArcStr

source§

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

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. Read more
source§

impl ValueType for ArcStr

source§

fn try_from_value(value: &Value) -> Result<Self, ValueTypeError>

Attempt to convert the generic Value into this type.