pub struct StatusUI {}Implementations§
Source§impl StatusUI
impl StatusUI
pub fn parse_template_to_status_line(s: &str) -> Line<'static>
Sourcepub fn span_from_template(inner: &str) -> Span<'static>
pub fn span_from_template(inner: &str) -> Span<'static>
Converts a template string into a Span with colors and modifiers.
The template string format is:
"style1,style2,...:text"- The first valid color token is used as foreground (fg).
- The second valid color token is used as background (bg).
- Remaining tokens are interpreted as modifiers: bold, dim, italic, underlined, slow_blink, rapid_blink, reversed, hidden, crossed_out.
- Empty tokens are ignored.
- Unrecognized tokens are collected and logged once at the end.
§Examples
use matchmaker::ui::StatusUI;
StatusUI::span_from_template("red,bg=blue,bold,italic:Hello");
StatusUI::span_from_template("green,,underlined:World");
StatusUI::span_from_template(",,dim:OnlyDim");Returns a Span with the specified styles applied to the text.
Auto Trait Implementations§
impl Freeze for StatusUI
impl RefUnwindSafe for StatusUI
impl Send for StatusUI
impl Sync for StatusUI
impl Unpin for StatusUI
impl UnsafeUnpin for StatusUI
impl UnwindSafe for StatusUI
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformExt for T
impl<T> TransformExt for T
fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q
fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T
Source§fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T
Example Read more