Struct Effects
pub struct Effects(/* private field */);
A set of text effects
Examples
let effects = BOLD | UNDERLINE;
Implementations
impl Effects
const BOLD: Self = _;const DIMMED: Self = _;const ITALIC: Self = _;Not widely supported. Sometimes treated as inverse or blink
const UNDERLINE: Self = _;Style extensions exist for Kitty, VTE, mintty and iTerm2.
const DOUBLE_UNDERLINE: Self = _;const CURLY_UNDERLINE: Self = _;const DOTTED_UNDERLINE: Self = _;const DASHED_UNDERLINE: Self = _;const BLINK: Self = _;const INVERT: Self = _;Swap foreground and background colors; inconsistent emulation
const HIDDEN: Self = _;const STRIKETHROUGH: Self = _;Characters legible but marked as if for deletion. Not supported in Terminal.app
const fn new() -> SelfNo effects enabled
Examples
let effects = new;const fn is_plain(self) -> boolCheck if no effects are enabled
Examples
let effects = new; assert!; let effects = BOLD | UNDERLINE; assert!;const fn contains(self, other: Effects) -> boolReturns
trueif all of the effects inotherare contained withinself.Examples
let effects = BOLD | UNDERLINE; assert!; let effects = new; assert!;const fn insert(self, other: Effects) -> SelfInserts the specified effects in-place.
Examples
let effects = new.insert; assert!; let effects = new.insert; assert!;const fn remove(self, other: Effects) -> SelfRemoves the specified effects in-place.
Examples
let effects = .remove; assert!; assert!;const fn clear(self) -> SelfReset all effects in-place
let effects = .clear; assert!; assert!;const fn set(self, other: Self, enable: bool) -> SelfEnable or disable the specified effects depending on the passed value.
Examples
let effects = new.set; assert!;fn iter(self) -> EffectIterIterate over enabled effects
fn render(self) -> impl Display + CopyRender the ANSI code
Trait Implementations
impl BitOr for Effects
type Output = Effects;fn bitor(self, rhs: Self) -> Self
impl BitOrAssign for Effects
fn bitor_assign(&mut self, other: Self)
impl Clone for Effects
fn clone(&self) -> Effects
impl Copy for Effects
impl Debug for Effects
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for Effects
fn default() -> Effects
impl Eq for Effects
impl Hash for Effects
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Effects
fn cmp(&self, other: &Effects) -> Ordering
impl PartialEq for Effects
fn eq(&self, other: &Effects) -> bool
impl PartialOrd for Effects
fn partial_cmp(&self, other: &Effects) -> Option<Ordering>
impl StructuralPartialEq for Effects
impl Sub for Effects
type Output = Effects;fn sub(self, other: Self) -> Self
impl SubAssign for Effects
fn sub_assign(&mut self, other: Self)
Auto Trait Implementations
impl Freeze for Effects
impl RefUnwindSafe for Effects
impl Send for Effects
impl Sync for Effects
impl Unpin for Effects
impl UnsafeUnpin for Effects
impl UnwindSafe for Effects
Blanket Implementations
impl<T> Any for Effects
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Effects
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Effects
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Effects
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Effects
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Effects
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Effects
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Effects
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Effects
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>