pub struct Span {
pub text: String,
pub style: Style,
pub hyperlink: Option<Arc<str>>,
}Expand description
A run of text with a uniform style.
Spans are concatenated before grapheme segmentation so clusters may cross a span boundary. Keep style boundaries on grapheme-cluster boundaries when predictable per-cluster styling matters.
Fields§
§text: StringPlain text belonging to this span.
style: StyleStyle associated with text in this span.
If a rendered grapheme cluster crosses span boundaries, StyledText
uses the style at the cluster’s first scalar value.
hyperlink: Option<Arc<str>>Sanitized OSC 8 target for this span, when present.
Implementations§
Trait Implementations§
impl Eq for Span
Source§impl From<Span> for StyledText
impl From<Span> for StyledText
Source§fn from(span: Span) -> StyledText
fn from(span: Span) -> StyledText
Converts to this type from the input type.
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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