pub struct ColorSpec {
pub(crate) fg_color: Option<Color>,
pub(crate) bg_color: Option<Color>,
pub(crate) bold: bool,
pub(crate) intense: bool,
pub(crate) underline: bool,
pub(crate) dimmed: bool,
pub(crate) italic: bool,
pub(crate) reset: bool,
pub(crate) strikethrough: bool,
}
Expand description
A color specification.
Fields§
§fg_color: Option<Color>
§bg_color: Option<Color>
§bold: bool
§intense: bool
§underline: bool
§dimmed: bool
§italic: bool
§reset: bool
§strikethrough: bool
Implementations§
Source§impl ColorSpec
impl ColorSpec
Sourcepub fn bold(&self) -> bool
pub fn bold(&self) -> bool
Get whether this is bold or not.
Note that the bold setting has no effect in a Windows console.
Sourcepub fn set_bold(&mut self, yes: bool) -> &mut ColorSpec
pub fn set_bold(&mut self, yes: bool) -> &mut ColorSpec
Set whether the text is bolded or not.
Note that the bold setting has no effect in a Windows console.
Sourcepub fn dimmed(&self) -> bool
pub fn dimmed(&self) -> bool
Get whether this is dimmed or not.
Note that the dimmed setting has no effect in a Windows console.
Sourcepub fn set_dimmed(&mut self, yes: bool) -> &mut ColorSpec
pub fn set_dimmed(&mut self, yes: bool) -> &mut ColorSpec
Set whether the text is dimmed or not.
Note that the dimmed setting has no effect in a Windows console.
Sourcepub fn italic(&self) -> bool
pub fn italic(&self) -> bool
Get whether this is italic or not.
Note that the italic setting has no effect in a Windows console.
Sourcepub fn set_italic(&mut self, yes: bool) -> &mut ColorSpec
pub fn set_italic(&mut self, yes: bool) -> &mut ColorSpec
Set whether the text is italicized or not.
Note that the italic setting has no effect in a Windows console.
Sourcepub fn underline(&self) -> bool
pub fn underline(&self) -> bool
Get whether this is underline or not.
Note that the underline setting has no effect in a Windows console.
Sourcepub fn set_underline(&mut self, yes: bool) -> &mut ColorSpec
pub fn set_underline(&mut self, yes: bool) -> &mut ColorSpec
Set whether the text is underlined or not.
Note that the underline setting has no effect in a Windows console.
Sourcepub fn strikethrough(&self) -> bool
pub fn strikethrough(&self) -> bool
Get whether this is strikethrough or not.
Note that the strikethrough setting has no effect in a Windows console.
Sourcepub fn set_strikethrough(&mut self, yes: bool) -> &mut ColorSpec
pub fn set_strikethrough(&mut self, yes: bool) -> &mut ColorSpec
Set whether the text is strikethrough or not.
Note that the strikethrough setting has no effect in a Windows console.
Sourcepub fn reset(&self) -> bool
pub fn reset(&self) -> bool
Get whether reset is enabled or not.
reset is enabled by default. When disabled and using ANSI escape
sequences, a “reset” code will be emitted every time a ColorSpec
’s
settings are applied.
Note that the reset setting has no effect in a Windows console.
Sourcepub fn set_reset(&mut self, yes: bool) -> &mut ColorSpec
pub fn set_reset(&mut self, yes: bool) -> &mut ColorSpec
Set whether to reset the terminal whenever color settings are applied.
reset is enabled by default. When disabled and using ANSI escape
sequences, a “reset” code will be emitted every time a ColorSpec
’s
settings are applied.
Typically this is useful if callers have a requirement to more scrupulously manage the exact sequence of escape codes that are emitted when using ANSI for colors.
Note that the reset setting has no effect in a Windows console.
Sourcepub fn intense(&self) -> bool
pub fn intense(&self) -> bool
Get whether this is intense or not.
On Unix-like systems, this will output the ANSI escape sequence that will print a high-intensity version of the color specified.
On Windows systems, this will output the ANSI escape sequence that will print a brighter version of the color specified.
Sourcepub fn set_intense(&mut self, yes: bool) -> &mut ColorSpec
pub fn set_intense(&mut self, yes: bool) -> &mut ColorSpec
Set whether the text is intense or not.
On Unix-like systems, this will output the ANSI escape sequence that will print a high-intensity version of the color specified.
On Windows systems, this will output the ANSI escape sequence that will print a brighter version of the color specified.
Trait Implementations§
impl Eq for ColorSpec
impl StructuralPartialEq for ColorSpec
Auto Trait Implementations§
impl DynSend for ColorSpec
impl DynSync for ColorSpec
impl Freeze for ColorSpec
impl RefUnwindSafe for ColorSpec
impl Send for ColorSpec
impl Sync for ColorSpec
impl Unpin for ColorSpec
impl UnwindSafe for ColorSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
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§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
key
and return true
if they are equal.Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 15 bytes