pub struct RichTextElementBuilder<'a> { /* private fields */ }Expand description
Builder for RichTextElementConfig.
Implementations§
Source§impl<'a> RichTextElementBuilder<'a>
impl<'a> RichTextElementBuilder<'a>
Sourcepub fn new(
text: OwnedOrRef<'a, str>,
default_config: TextConfigStylePair,
) -> Self
pub fn new( text: OwnedOrRef<'a, str>, default_config: TextConfigStylePair, ) -> Self
Creates a new builder with the provided text and default style/config.
Sourcepub fn add_config(&mut self, config: TextConfigStylePair) -> usize
pub fn add_config(&mut self, config: TextConfigStylePair) -> usize
Adds an override config and returns an index intended for configure_range.
Sourcepub fn configure_range(&mut self, range: Range<usize>, config_index: usize)
pub fn configure_range(&mut self, range: Range<usize>, config_index: usize)
Applies an override config to a text range.
§Panics
Panics if range.end is outside the text length or config_index is not
valid for the current override set.
Sourcepub fn into_config(self) -> RichTextElementConfig<'a>
pub fn into_config(self) -> RichTextElementConfig<'a>
Finalizes the builder into a RichTextElementConfig.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RichTextElementBuilder<'a>
impl<'a> !UnwindSafe for RichTextElementBuilder<'a>
impl<'a> Freeze for RichTextElementBuilder<'a>
impl<'a> Send for RichTextElementBuilder<'a>
impl<'a> Sync for RichTextElementBuilder<'a>
impl<'a> Unpin for RichTextElementBuilder<'a>
impl<'a> UnsafeUnpin for RichTextElementBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
impl<H, TailTarget, Source, Idx> Embed<RenderTList<H, TailTarget>, There<Idx>> for Sourcewhere
TailTarget: IsRenderList,
Source: Embed<TailTarget, Idx>,
Source§fn embed(self) -> RenderTList<H, TailTarget>
fn embed(self) -> RenderTList<H, TailTarget>
Converts
self into Target.