Trait Styleable

Source
pub trait Styleable<T> {
    // Required methods
    fn styled(self) -> Styled<T>;
    fn class(self, class: impl AsRef<str>) -> Styled<T>;
    fn attr(self, key: &str, builder: impl StyleAttributeBuilder) -> Styled<T>;
    fn attr_trans(
        self,
        key: &str,
        value: impl Into<StyleAttributeValue>,
        transition: impl Into<StyleTransition>,
    ) -> Styled<T>;
}
Expand description

A trait for adding style attributes to a value.

Required Methods§

Source

fn styled(self) -> Styled<T>

Converts the self into a Styled<Self> value.

Source

fn class(self, class: impl AsRef<str>) -> Styled<T>

Adds a class.

Source

fn attr(self, key: &str, builder: impl StyleAttributeBuilder) -> Styled<T>

Adds an attribute.

Source

fn attr_trans( self, key: &str, value: impl Into<StyleAttributeValue>, transition: impl Into<StyleTransition>, ) -> Styled<T>

Adds an attribute with a transition.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Styleable<T> for Styled<T>

Source§

impl<T> Styleable<T> for T