#[non_exhaustive]pub struct Style {
pub role: Option<Role>,
pub fg: Option<Color>,
pub bold: bool,
pub italic: bool,
pub underline: bool,
pub dim: bool,
pub hyperlink: Option<String>,
}Expand description
Text decorations a segment may layer over its theme color. role
is the role the segment wants; fg is an explicit color override
that wins over role. hyperlink carries an OSC 8 URL that
crate::layout::runs_to_ansi wraps around the run’s text when
the terminal advertises hyperlink support. bg lives in the spec
but isn’t wired through.
Not Copy — hyperlink carries an owned String.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.role: Option<Role>§fg: Option<Color>§bold: bool§italic: bool§underline: bool§dim: bool§hyperlink: Option<String>Implementations§
Source§impl Style
impl Style
Sourcepub fn with_hyperlink(self, url: impl Into<String>) -> Self
pub fn with_hyperlink(self, url: impl Into<String>) -> Self
Chainable: attach an OSC 8 URL to this style. The link emits
only when the terminal advertises hyperlink support; capable
terminals render the run as a clickable link to url. An
empty url folds to None, matching the plugin-output path
— emitting \x1b]8;;\x1b\\ would wrap text in a link to
nothing.
Trait Implementations§
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.