pub struct TextSpan {
pub text: String,
pub style: TextStyle,
}Expand description
Owned text fragment paired with its intended style.
In the current renderer, only the first span’s style is applied to the concatenated string.
§Examples
use ailloli_ui_core::{Color, FontId, TextStyle};
use ailloli_ui_widgets::text::TextSpan;
let span = TextSpan { text: "hello".into(), style: TextStyle::new(FontId::Ui, 14, Color::WHITE) };
assert_eq!(span.text, "hello");Fields§
§text: StringOwned UTF-8 fragment; empty spans are allowed.
style: TextStyleRequested span style; currently ignored for non-first spans.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextSpan
impl RefUnwindSafe for TextSpan
impl Send for TextSpan
impl Sync for TextSpan
impl Unpin for TextSpan
impl UnwindSafe for TextSpan
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.