pub enum StyleType {
Name(String),
Style(Style),
}Expand description
A style, or the name of one to be looked up later. Port of upstream’s
StyleType = Union[str, "Style"] (rich/style.py).
A Span that holds a Name is
resolved when it is rendered, against the theme of the console doing the
rendering — so the same Text printed to two differently
themed consoles comes out in two different colours, as it does upstream.
Resolving eagerly instead would freeze the colours at construction time.
Variants§
Name(String)
A theme key ("repr.number") or a style definition ("bold red"),
resolved by Theme::get_style.
Style(Style)
An already-resolved style.
Implementations§
Trait Implementations§
impl Eq for StyleType
impl StructuralPartialEq for StyleType
Auto Trait Implementations§
impl Freeze for StyleType
impl RefUnwindSafe for StyleType
impl Send for StyleType
impl Sync for StyleType
impl Unpin for StyleType
impl UnsafeUnpin for StyleType
impl UnwindSafe for StyleType
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.