pub struct MixedText { /* private fields */ }Expand description
MixedText is a component that renders a text string containing a mix of styles.
If you want to render a text string with a single style, use the Text component instead.
§Example
element! {
View(
border_style: BorderStyle::Round,
border_color: Color::Blue,
width: 30,
) {
MixedText(align: TextAlign::Center, contents: vec![
MixedTextContent::new("Hello, world!").color(Color::Red).weight(Weight::Bold),
MixedTextContent::new(" Lorem ipsum odor amet, consectetuer adipiscing elit.").color(Color::Green),
])
}
}Trait Implementations§
Source§impl Component for MixedText
impl Component for MixedText
Source§type Props<'a> = MixedTextProps
type Props<'a> = MixedTextProps
The type of properties that the component accepts.
Source§fn new(_props: &Self::Props<'_>) -> Self
fn new(_props: &Self::Props<'_>) -> Self
Creates a new instance of the component from a set of properties.
Source§fn update(
&mut self,
props: &mut Self::Props<'_>,
_hooks: Hooks<'_, '_>,
updater: &mut ComponentUpdater<'_, '_, '_>,
)
fn update( &mut self, props: &mut Self::Props<'_>, _hooks: Hooks<'_, '_>, updater: &mut ComponentUpdater<'_, '_, '_>, )
Invoked whenever the properties of the component or layout may have changed.
Source§fn draw(&mut self, drawer: &mut ComponentDrawer<'_>)
fn draw(&mut self, drawer: &mut ComponentDrawer<'_>)
Invoked to draw the component.
Auto Trait Implementations§
impl Freeze for MixedText
impl RefUnwindSafe for MixedText
impl Send for MixedText
impl Sync for MixedText
impl Unpin for MixedText
impl UnsafeUnpin for MixedText
impl UnwindSafe for MixedText
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