Enum tuirealm::Attribute

source ·
pub enum Attribute {
Show 32 variants Alignment, Background, Borders, Color, Content, Dataset, Direction, Disabled, Display, Focus, FocusStyle, Foreground, Height, HighlightedStr, HighlightedColor, InputLength, InputType, Layout, Palette, Rewind, Shape, Scroll, ScrollStep, Style, Text, TextAlign, TextProps, TextWrap, Title, Value, Width, Custom(&'static str),
}
Expand description

Describes a “selector” to query an attribute on props. The selector must identify uniquely an attribute in the properties. Check each attribute documentation to see how they’re supposed to be used, but remember that when implementing a component, you’re free to use each attribute as you prefer!

Variants§

§

Alignment

Layout alignment

§

Background

Background color or style

§

Borders

Borders styles

§

Color

Main color

§

Content

Component content. Generic purpose

§

Dataset

Dataset of component; should be associated to AttrValue::Dataset

§

Direction

Component layout direction

§

Disabled

Describes whether the component is disabled (e.g. an Input)

§

Display

Whether to display or not the component. This should be reserved to hide components. As shown in stdlib and in example, its value should be AttrValue::Flag and should be checked on top of the view() method to choose whether to or not to render the component.

§

Focus

Reserved for tracking focus on component. You should not implement focus by yourself, since it’s already read/written by the active() and blur() methods on view/application. When implementing a component, its value should be read-only. The value is always AttrValue::Flag

§

FocusStyle

Should be used to use a different style from default when component is not enabled.

§

Foreground

Foreground color or style

§

Height

Height size. Useful when building layouts or containers

§

HighlightedStr

String to prepend to highlighted items in list or other

§

HighlightedColor

Color to apply to highlighted items

§

InputLength

Maximum input length for input fields

§

InputType

Input type for input fields

§

Layout

Defines a layout

§

Palette

A map of colors for complex components

§

Rewind

Intended to decide whether to rewind when reaching boundaries on list/tables

§

Shape

Intended to store a AttrValue::Shape

§

Scroll

Should be used to choose whether to make list interactive (scrollable) or not

§

ScrollStep

Intended as scroll step for fast scroll, for example when using PageUp

§

Style

Component style

§

Text

Component text content

§

TextAlign

Text align

§

TextProps

Text properties

§

TextWrap

Whether to wrap text (or how)

§

Title

Component box title

§

Value

A generic component value

§

Width

Component width; useful when using containers or layouts

§

Custom(&'static str)

A user defined property

Trait Implementations§

source§

impl Clone for Attribute

source§

fn clone(&self) -> Attribute

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 Attribute

source§

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

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

impl Hash for Attribute

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Attribute

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Attribute

source§

fn partial_cmp(&self, other: &Attribute) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Attribute

source§

impl Eq for Attribute

source§

impl StructuralPartialEq for Attribute

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<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<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,

§

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>,

§

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>,

§

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.