pub struct RichText { /* private fields */ }
Expand description
Text with optional style spans.
Implementations§
§impl RichText
impl RichText
pub fn new_with_attributes(
buffer: Arc<str>,
attributes: AttributeSpans
) -> RichText
pub fn new_with_attributes( buffer: Arc<str>, attributes: AttributeSpans ) -> RichText
Create a new RichText
, providing explicit attributes.
pub fn with_attribute(
self,
range: impl RangeBounds<usize>,
attr: Attribute
) -> RichText
pub fn with_attribute( self, range: impl RangeBounds<usize>, attr: Attribute ) -> RichText
Builder-style method for adding an Attribute
to a range of text.
pub fn add_attribute(&mut self, range: impl RangeBounds<usize>, attr: Attribute)
pub fn add_attribute(&mut self, range: impl RangeBounds<usize>, attr: Attribute)
Add an Attribute
to the provided range of text.
Trait Implementations§
§impl TextStorage for RichText
impl TextStorage for RichText
§impl TextStorage for RichText
impl TextStorage for RichText
§fn add_attributes(
&self,
builder: CairoTextLayoutBuilder,
env: &Env
) -> CairoTextLayoutBuilder
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
fn env_update(&self, ctx: &EnvUpdateCtx<'_, '_>) -> bool
This is called whenever the Env changes and should return true
if the layout should be rebuilt.
Auto Trait Implementations§
impl !RefUnwindSafe for RichText
impl !Send for RichText
impl !Sync for RichText
impl Unpin for RichText
impl !UnwindSafe for RichText
Blanket Implementations§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.