pub struct StyledTextSpan {
pub range: Range<usize>,
pub style: TextStyle,
}Expand description
Style override for a UTF-8 byte range in a text layout.
The range must be ordered, lie within the associated text, and use UTF-8 boundaries when submitted to the layout engine. This value type does not validate those invariants itself.
§Examples
use ailloli_ui_core::{Color, FontId, TextStyle};
use ailloli_ui_text::StyledTextSpan;
let span = StyledTextSpan {
range: 0..4,
style: TextStyle::new(FontId::Mono, 14, Color::WHITE),
};
assert_eq!(span.range, 0..4);Fields§
§range: Range<usize>Half-open UTF-8 byte range receiving the override.
style: TextStyleComplete replacement style for the range.
Trait Implementations§
Source§impl Clone for StyledTextSpan
impl Clone for StyledTextSpan
Source§fn clone(&self) -> StyledTextSpan
fn clone(&self) -> StyledTextSpan
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StyledTextSpan
impl Debug for StyledTextSpan
Source§impl PartialEq for StyledTextSpan
impl PartialEq for StyledTextSpan
impl StructuralPartialEq for StyledTextSpan
Auto Trait Implementations§
impl Freeze for StyledTextSpan
impl RefUnwindSafe for StyledTextSpan
impl Send for StyledTextSpan
impl Sync for StyledTextSpan
impl Unpin for StyledTextSpan
impl UnwindSafe for StyledTextSpan
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