pub struct Span<'a, Link = ()> {
pub text: Cow<'a, str>,
pub size: Option<Pixels>,
pub line_height: Option<LineHeight>,
pub font: Option<Font>,
pub color: Option<Color>,
pub link: Option<Link>,
pub highlight: Option<Highlight>,
pub padding: Padding,
pub underline: bool,
pub strikethrough: bool,
}Expand description
A span of text.
Fields§
§text: Cow<'a, str>The Fragment of text.
size: Option<Pixels>§line_height: Option<LineHeight>The LineHeight of the Span.
font: Option<Font>§color: Option<Color>§link: Option<Link>The link of the Span.
highlight: Option<Highlight>§padding: Padding§underline: boolWhether the Span should be underlined or not.
strikethrough: boolWhether the Span should be struck through or not.
Implementations§
Source§impl<'a, Link> Span<'a, Link>
impl<'a, Link> Span<'a, Link>
Sourcepub fn new(fragment: impl IntoFragment<'a>) -> Span<'a, Link>
pub fn new(fragment: impl IntoFragment<'a>) -> Span<'a, Link>
Creates a new Span of text with the given text fragment.
Sourcepub fn line_height(self, line_height: impl Into<LineHeight>) -> Span<'a, Link>
pub fn line_height(self, line_height: impl Into<LineHeight>) -> Span<'a, Link>
Sets the LineHeight of the Span.
Sourcepub fn font_maybe(self, font: Option<impl Into<Font>>) -> Span<'a, Link>
pub fn font_maybe(self, font: Option<impl Into<Font>>) -> Span<'a, Link>
Sets the font of the Span, if any.
Sourcepub fn link_maybe(self, link: Option<impl Into<Link>>) -> Span<'a, Link>
pub fn link_maybe(self, link: Option<impl Into<Link>>) -> Span<'a, Link>
Sets the link of the Span, if any.
Sourcepub fn background(self, background: impl Into<Background>) -> Span<'a, Link>
pub fn background(self, background: impl Into<Background>) -> Span<'a, Link>
Sets the Background of the Span.
Sourcepub fn background_maybe(
self,
background: Option<impl Into<Background>>,
) -> Span<'a, Link>
pub fn background_maybe( self, background: Option<impl Into<Background>>, ) -> Span<'a, Link>
Sets the Background of the Span, if any.
Sourcepub fn padding(self, padding: impl Into<Padding>) -> Span<'a, Link>
pub fn padding(self, padding: impl Into<Padding>) -> Span<'a, Link>
It only affects the background and border of the
Span, currently.
Sourcepub fn underline(self, underline: bool) -> Span<'a, Link>
pub fn underline(self, underline: bool) -> Span<'a, Link>
Sets whether the Span should be underlined or not.
Sourcepub fn strikethrough(self, strikethrough: bool) -> Span<'a, Link>
pub fn strikethrough(self, strikethrough: bool) -> Span<'a, Link>
Sets whether the Span should be struck through or not.
Trait Implementations§
Source§impl<'a, Link, Message, Theme> FromIterator<Span<'a, Link>> for Rich<'a, Link, Message, Theme>
impl<'a, Link, Message, Theme> FromIterator<Span<'a, Link>> for Rich<'a, Link, Message, Theme>
Auto Trait Implementations§
impl<'a, Link> Freeze for Span<'a, Link>
impl<'a, Link> RefUnwindSafe for Span<'a, Link>where
Option<Link>: RefUnwindSafe,
impl<'a, Link> Send for Span<'a, Link>
impl<'a, Link> Sync for Span<'a, Link>
impl<'a, Link> Unpin for Span<'a, Link>
impl<'a, Link> UnsafeUnpin for Span<'a, Link>where
Option<Link>: UnsafeUnpin,
impl<'a, Link> UnwindSafe for Span<'a, Link>where
Option<Link>: UnwindSafe,
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