Trait masonry::text2::TextStorage
source · pub trait TextStorage: 'static {
// Required methods
fn as_str(&self) -> &str;
fn maybe_eq(&self, other: &Self) -> bool;
// Provided methods
fn add_attributes<'b>(
&self,
builder: RangedBuilder<'b, TextBrush, &'b str>
) -> RangedBuilder<'b, TextBrush, &'b str> { ... }
fn links(&self) -> &[Link] { ... }
}
Expand description
Text which can be displayed.
Required Methods§
Provided Methods§
sourcefn add_attributes<'b>(
&self,
builder: RangedBuilder<'b, TextBrush, &'b str>
) -> RangedBuilder<'b, TextBrush, &'b str>
fn add_attributes<'b>( &self, builder: RangedBuilder<'b, TextBrush, &'b str> ) -> RangedBuilder<'b, TextBrush, &'b str>
If this TextStorage
object manages style spans, it should implement
this method and update the provided builder with its spans, as required.
This takes &self
, as we needed to call Self::as_str
to get the value stored in
the RangedBuilder
Object Safety§
This trait is not object safe.