Form

Struct Form 

Source
pub struct Form {
    pub style: ContentStyle,
}
Expand description

A style for text.

Fields§

§style: ContentStyle

The actual style that is applied

Implementations§

Source§

impl Form

Source

pub const fn bold() -> BuiltForm

New Form with the bold attribute

Source

pub const fn dim() -> BuiltForm

New Form with the dim attribute

Source

pub const fn italic() -> BuiltForm

New Form with the italic attribute

Source

pub const fn underlined() -> BuiltForm

New Form with the underlined attribute

Source

pub const fn double_underlined() -> BuiltForm

New Form with the double_underlined attribute

Source

pub const fn undercurled() -> BuiltForm

New Form with the undercurled attribute

Source

pub const fn underdashed() -> BuiltForm

New Form with the underdashed attribute

Source

pub const fn reverse() -> BuiltForm

New Form with the reverse attribute

Source

pub const fn crossed_out() -> BuiltForm

New Form with the crossed_out attribute

Source

pub const fn black() -> BuiltForm

New Form with a black foreground

Source

pub const fn on_black() -> BuiltForm

New Form with a black background

Source

pub const fn underline_black() -> BuiltForm

New Form with a black underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn dark_grey() -> BuiltForm

New Form with a dark_grey foreground

Source

pub const fn on_dark_grey() -> BuiltForm

New Form with a dark_grey background

Source

pub const fn underline_dark_grey() -> BuiltForm

New Form with a dark_grey underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn red() -> BuiltForm

New Form with a red foreground

Source

pub const fn on_red() -> BuiltForm

New Form with a red background

Source

pub const fn underline_red() -> BuiltForm

New Form with a red underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn dark_red() -> BuiltForm

New Form with a dark_red foreground

Source

pub const fn on_dark_red() -> BuiltForm

New Form with a dark_red background

Source

pub const fn underline_dark_red() -> BuiltForm

New Form with a dark_red underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn green() -> BuiltForm

New Form with a green foreground

Source

pub const fn on_green() -> BuiltForm

New Form with a green background

Source

pub const fn underline_green() -> BuiltForm

New Form with a green underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn dark_green() -> BuiltForm

New Form with a dark_green foreground

Source

pub const fn on_dark_green() -> BuiltForm

New Form with a dark_green background

Source

pub const fn underline_dark_green() -> BuiltForm

New Form with a dark_green underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn yellow() -> BuiltForm

New Form with a yellow foreground

Source

pub const fn on_yellow() -> BuiltForm

New Form with a yellow background

Source

pub const fn underline_yellow() -> BuiltForm

New Form with a yellow underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn dark_yellow() -> BuiltForm

New Form with a dark_yellow foreground

Source

pub const fn on_dark_yellow() -> BuiltForm

New Form with a dark_yellow background

Source

pub const fn underline_dark_yellow() -> BuiltForm

New Form with a dark_yellow underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn blue() -> BuiltForm

New Form with a blue foreground

Source

pub const fn on_blue() -> BuiltForm

New Form with a blue background

Source

pub const fn underline_blue() -> BuiltForm

New Form with a blue underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn dark_blue() -> BuiltForm

New Form with a dark_blue foreground

Source

pub const fn on_dark_blue() -> BuiltForm

New Form with a dark_blue background

Source

pub const fn underline_dark_blue() -> BuiltForm

New Form with a dark_blue underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn magenta() -> BuiltForm

New Form with a magenta foreground

Source

pub const fn on_magenta() -> BuiltForm

New Form with a magenta background

Source

pub const fn underline_magenta() -> BuiltForm

New Form with a magenta underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn dark_magenta() -> BuiltForm

New Form with a dark_magenta foreground

Source

pub const fn on_dark_magenta() -> BuiltForm

New Form with a dark_magenta background

Source

pub const fn underline_dark_magenta() -> BuiltForm

New Form with a dark_magenta underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn cyan() -> BuiltForm

New Form with a cyan foreground

Source

pub const fn on_cyan() -> BuiltForm

New Form with a cyan background

Source

pub const fn underline_cyan() -> BuiltForm

New Form with a cyan underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn dark_cyan() -> BuiltForm

New Form with a dark_cyan foreground

Source

pub const fn on_dark_cyan() -> BuiltForm

New Form with a dark_cyan background

Source

pub const fn underline_dark_cyan() -> BuiltForm

New Form with a dark_cyan underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn white() -> BuiltForm

New Form with a white foreground

Source

pub const fn on_white() -> BuiltForm

New Form with a white background

Source

pub const fn underline_white() -> BuiltForm

New Form with a white underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source

pub const fn grey() -> BuiltForm

New Form with a grey foreground

Source

pub const fn on_grey() -> BuiltForm

New Form with a grey background

Source

pub const fn underline_grey() -> BuiltForm

New Form with a grey underlining

Do note that this feature may not be supported in all Uis, for example, various terminals don’t support this feature, since it is a part of the kitty protocol, and hasn’t been universally accepted yet.

Ui: crate::ui::traits::RawUi

Source§

impl Form

Source

pub const fn new() -> BuiltForm

Returns a new Form with a default style

This method actually returns BuiltForm

Source

pub const fn reset() -> BuiltForm

Returns a new Form with the Reset attribute

In Duat, the Reset attribute should remove only other Attributes, not any of the colors in use.

Source

pub const fn with(str: &str) -> BuiltForm

New Form with a colored foreground

This function accepts three color formats:

  • A hexcode, like "#abcdef", capitalization is ignored;
  • Three rgb values, like "rgb 123 456 789";
  • Three hsl values, like "hsl {hue} {sat} {lit}", where {hue}, {sat} and {lit} can either be a number from 0..255, or a percentage, followed by '%', e.g. "hsl 234 50% 42".
Source

pub const fn on(str: &str) -> BuiltForm

New Form with a colored background

This function accepts three color formats:

  • A hexcode, like "#abcdef", capitalization is ignored;
  • Three rgb values, like "rgb 123 456 789";
  • Three hsl values, like "hsl {hue} {sat} {lit}", where {hue}, {sat} and {lit} can either be a number from 0..255, or a percentage, followed by '%', e.g. "hsl 234 50% 42".
Source

pub const fn underline(str: &str) -> BuiltForm

New Form with a colored underlining

This function accepts three color formats:

  • A hexcode, like "#abcdef", capitalization is ignored;
  • Three rgb values, like "rgb 123 456 789";
  • Three hsl values, like "hsl {hue} {sat} {lit}", where {hue}, {sat} and {lit} can either be a number from 0..255, or a percentage, followed by '%', e.g. "hsl 234 50% 42".
Source

pub const fn fg(&self) -> Option<Color>

The foreground color

Source

pub const fn bg(&self) -> Option<Color>

The background color

Source

pub const fn ul(&self) -> Option<Color>

The foreground color

Source

pub const fn attrs(&self) -> Attributes

The attributes

Trait Implementations§

Source§

impl Clone for Form

Source§

fn clone(&self) -> Form

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Form

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<BuiltForm> for Form

Source§

fn from(value: BuiltForm) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Form

Source§

fn eq(&self, other: &Form) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Form

Source§

impl Eq for Form

Source§

impl StructuralPartialEq for Form

Auto Trait Implementations§

§

impl Freeze for Form

§

impl RefUnwindSafe for Form

§

impl Send for Form

§

impl Sync for Form

§

impl Unpin for Form

§

impl UnwindSafe for Form

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.