duat_core::forms

Struct Form

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

A style for text.

Fields§

§style: ContentStyle§finished: bool

Whether or not the Forms colors and attributes should override any that come after.

Implementations§

Source§

impl Form

Source

pub fn with(val: Color) -> BuiltForm

New Form with a colored foreground

Source

pub fn on(val: Color) -> BuiltForm

New Form with a colored background

Source

pub fn underline(val: Color) -> BuiltForm

New Form with a colored underlining

Source

pub fn attribute(val: Attribute) -> BuiltForm

New Form with an attribute

Source

pub fn reset() -> BuiltForm

New Form with the reset attribute

Source

pub fn bold() -> BuiltForm

New Form with the bold attribute

Source

pub fn underlined() -> BuiltForm

New Form with the underlined attribute

Source

pub fn reverse() -> BuiltForm

New Form with the reverse attribute

Source

pub fn dim() -> BuiltForm

New Form with the dim attribute

Source

pub fn italic() -> BuiltForm

New Form with the italic attribute

Source

pub fn negative() -> BuiltForm

New Form with the negative attribute

New Form with the slow_blink attribute

New Form with the rapid_blink attribute

Source

pub fn hidden() -> BuiltForm

New Form with the hidden attribute

Source

pub fn crossed_out() -> BuiltForm

New Form with the crossed_out attribute

Source

pub fn black() -> BuiltForm

New Form with a black foreground

Source

pub fn on_black() -> BuiltForm

New Form with a black background

Source

pub fn underline_black() -> BuiltForm

New Form with a black underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn dark_grey() -> BuiltForm

New Form with a dark_grey foreground

Source

pub fn on_dark_grey() -> BuiltForm

New Form with a dark_grey background

Source

pub fn underline_dark_grey() -> BuiltForm

New Form with a dark_grey underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn red() -> BuiltForm

New Form with a red foreground

Source

pub fn on_red() -> BuiltForm

New Form with a red background

Source

pub fn underline_red() -> BuiltForm

New Form with a red underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn dark_red() -> BuiltForm

New Form with a dark_red foreground

Source

pub fn on_dark_red() -> BuiltForm

New Form with a dark_red background

Source

pub fn underline_dark_red() -> BuiltForm

New Form with a dark_red underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn green() -> BuiltForm

New Form with a green foreground

Source

pub fn on_green() -> BuiltForm

New Form with a green background

Source

pub fn underline_green() -> BuiltForm

New Form with a green underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn dark_green() -> BuiltForm

New Form with a dark_green foreground

Source

pub fn on_dark_green() -> BuiltForm

New Form with a dark_green background

Source

pub fn underline_dark_green() -> BuiltForm

New Form with a dark_green underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn yellow() -> BuiltForm

New Form with a yellow foreground

Source

pub fn on_yellow() -> BuiltForm

New Form with a yellow background

Source

pub fn underline_yellow() -> BuiltForm

New Form with a yellow underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn dark_yellow() -> BuiltForm

New Form with a dark_yellow foreground

Source

pub fn on_dark_yellow() -> BuiltForm

New Form with a dark_yellow background

Source

pub fn underline_dark_yellow() -> BuiltForm

New Form with a dark_yellow underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn blue() -> BuiltForm

New Form with a blue foreground

Source

pub fn on_blue() -> BuiltForm

New Form with a blue background

Source

pub fn underline_blue() -> BuiltForm

New Form with a blue underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn dark_blue() -> BuiltForm

New Form with a dark_blue foreground

Source

pub fn on_dark_blue() -> BuiltForm

New Form with a dark_blue background

Source

pub fn underline_dark_blue() -> BuiltForm

New Form with a dark_blue underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn magenta() -> BuiltForm

New Form with a magenta foreground

Source

pub fn on_magenta() -> BuiltForm

New Form with a magenta background

Source

pub fn underline_magenta() -> BuiltForm

New Form with a magenta underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn dark_magenta() -> BuiltForm

New Form with a dark_magenta foreground

Source

pub fn on_dark_magenta() -> BuiltForm

New Form with a dark_magenta background

Source

pub fn underline_dark_magenta() -> BuiltForm

New Form with a dark_magenta underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn cyan() -> BuiltForm

New Form with a cyan foreground

Source

pub fn on_cyan() -> BuiltForm

New Form with a cyan background

Source

pub fn underline_cyan() -> BuiltForm

New Form with a cyan underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn dark_cyan() -> BuiltForm

New Form with a dark_cyan foreground

Source

pub fn on_dark_cyan() -> BuiltForm

New Form with a dark_cyan background

Source

pub fn underline_dark_cyan() -> BuiltForm

New Form with a dark_cyan underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn white() -> BuiltForm

New Form with a white foreground

Source

pub fn on_white() -> BuiltForm

New Form with a white background

Source

pub fn underline_white() -> BuiltForm

New Form with a white underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn grey() -> BuiltForm

New Form with a grey foreground

Source

pub fn on_grey() -> BuiltForm

New Form with a grey background

Source

pub fn underline_grey() -> BuiltForm

New Form with a grey underlining

Do note that this feature may not be supported in all Uis.

Source

pub fn new() -> BuiltForm

Returns a new Form with a default style

This method actually returns BuiltForm

Source

pub fn finished() -> BuiltForm

Returns a new Form with a default finished style

A finished style is one that cannot be superseded. That is, if this style sets a foreground, while it is active, new styles may not modify the color of the foreground.

Source

pub fn double_underlined() -> BuiltForm

New Form with the double_underlined attribute

Source

pub fn undercurled() -> BuiltForm

New Form with the undercurled attribute

Source

pub fn underdashed() -> BuiltForm

New Form with the underdashed attribute

Trait Implementations§

Source§

impl Clone for Form

Source§

fn clone(&self) -> Form

Returns a copy 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 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 FormFmt 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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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.