BuiltForm

Struct BuiltForm 

Source
pub struct BuiltForm(/* private fields */);
Expand description

A convenience struct for Forms

This struct exists in order to have Form methods be initializers, while BuiltForm methods consume and return a BuiltForms

This is their only difference, everywhere else, they are functionally identical.

Implementations§

Source§

impl BuiltForm

Source

pub const fn bold(self) -> Self

Applies the bold attribute to this Form

Source

pub const fn dim(self) -> Self

Applies the dim attribute to this Form

Source

pub const fn italic(self) -> Self

Applies the italic attribute to this Form

Source

pub const fn underlined(self) -> Self

Applies the underlined attribute to this Form

Source

pub const fn double_underlined(self) -> Self

Applies the double_underlined attribute to this Form

Source

pub const fn undercurled(self) -> Self

Applies the undercurled attribute to this Form

Source

pub const fn underdashed(self) -> Self

Applies the underdashed attribute to this Form

Source

pub const fn reverse(self) -> Self

Applies the reverse attribute to this Form

Source

pub const fn crossed_out(self) -> Self

Applies the crossed_out attribute to this Form

Source

pub const fn overlined(self) -> Self

Applies the overlined attribute to this Form

Source

pub const fn black(self) -> Self

Turns the foreground of this Form black

Source

pub const fn on_black(self) -> Self

Turns the background of this Form black

Source

pub const fn underline_black(self) -> Self

Turns the underlining of this Form black

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(self) -> Self

Turns the foreground of this Form dark_grey

Source

pub const fn on_dark_grey(self) -> Self

Turns the background of this Form dark_grey

Source

pub const fn underline_dark_grey(self) -> Self

Turns the underlining of this Form dark_grey

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(self) -> Self

Turns the foreground of this Form red

Source

pub const fn on_red(self) -> Self

Turns the background of this Form red

Source

pub const fn underline_red(self) -> Self

Turns the underlining of this Form red

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(self) -> Self

Turns the foreground of this Form dark_red

Source

pub const fn on_dark_red(self) -> Self

Turns the background of this Form dark_red

Source

pub const fn underline_dark_red(self) -> Self

Turns the underlining of this Form dark_red

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(self) -> Self

Turns the foreground of this Form green

Source

pub const fn on_green(self) -> Self

Turns the background of this Form green

Source

pub const fn underline_green(self) -> Self

Turns the underlining of this Form green

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(self) -> Self

Turns the foreground of this Form dark_green

Source

pub const fn on_dark_green(self) -> Self

Turns the background of this Form dark_green

Source

pub const fn underline_dark_green(self) -> Self

Turns the underlining of this Form dark_green

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(self) -> Self

Turns the foreground of this Form yellow

Source

pub const fn on_yellow(self) -> Self

Turns the background of this Form yellow

Source

pub const fn underline_yellow(self) -> Self

Turns the underlining of this Form yellow

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(self) -> Self

Turns the foreground of this Form dark_yellow

Source

pub const fn on_dark_yellow(self) -> Self

Turns the background of this Form dark_yellow

Source

pub const fn underline_dark_yellow(self) -> Self

Turns the underlining of this Form dark_yellow

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(self) -> Self

Turns the foreground of this Form blue

Source

pub const fn on_blue(self) -> Self

Turns the background of this Form blue

Source

pub const fn underline_blue(self) -> Self

Turns the underlining of this Form blue

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(self) -> Self

Turns the foreground of this Form dark_blue

Source

pub const fn on_dark_blue(self) -> Self

Turns the background of this Form dark_blue

Source

pub const fn underline_dark_blue(self) -> Self

Turns the underlining of this Form dark_blue

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(self) -> Self

Turns the foreground of this Form magenta

Source

pub const fn on_magenta(self) -> Self

Turns the background of this Form magenta

Source

pub const fn underline_magenta(self) -> Self

Turns the underlining of this Form magenta

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(self) -> Self

Turns the foreground of this Form dark_magenta

Source

pub const fn on_dark_magenta(self) -> Self

Turns the background of this Form dark_magenta

Source

pub const fn underline_dark_magenta(self) -> Self

Turns the underlining of this Form dark_magenta

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(self) -> Self

Turns the foreground of this Form cyan

Source

pub const fn on_cyan(self) -> Self

Turns the background of this Form cyan

Source

pub const fn underline_cyan(self) -> Self

Turns the underlining of this Form cyan

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(self) -> Self

Turns the foreground of this Form dark_cyan

Source

pub const fn on_dark_cyan(self) -> Self

Turns the background of this Form dark_cyan

Source

pub const fn underline_dark_cyan(self) -> Self

Turns the underlining of this Form dark_cyan

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(self) -> Self

Turns the foreground of this Form white

Source

pub const fn on_white(self) -> Self

Turns the background of this Form white

Source

pub const fn underline_white(self) -> Self

Turns the underlining of this Form white

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(self) -> Self

Turns the foreground of this Form grey

Source

pub const fn on_grey(self) -> Self

Turns the background of this Form grey

Source

pub const fn underline_grey(self) -> Self

Turns the underlining of this Form grey

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 BuiltForm

Source

pub const fn reset(self) -> BuiltForm

Adds the Reset attribute to this Form

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

Source

pub const fn with(self, str: &str) -> Self

Colors the foreground of this Form

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(self, str: &str) -> Self

Colors the background of this Form

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(self, str: &str) -> Self

Colors the underlining of this Form

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".

Methods from Deref<Target = Form>§

Source

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

The foreground color

Source

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

The background color

Source

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

The foreground color

Source

pub fn attrs(&self) -> Attributes

The attributes

Trait Implementations§

Source§

impl Clone for BuiltForm

Source§

fn clone(&self) -> BuiltForm

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 BuiltForm

Source§

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

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

impl Deref for BuiltForm

Source§

type Target = Form

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for BuiltForm

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<BuiltForm> for Form

Source§

fn from(value: BuiltForm) -> Self

Converts to this type from the input type.
Source§

impl Copy for BuiltForm

Auto Trait Implementations§

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<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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.