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§
Sourcefn styled(self) -> Styled<T>
fn styled(self) -> Styled<T>
Converts the self
into a Styled<Self>
value.
Sourcefn attr(self, key: &str, builder: impl StyleAttributeBuilder) -> Styled<T>
fn attr(self, key: &str, builder: impl StyleAttributeBuilder) -> Styled<T>
Adds an attribute.
Sourcefn attr_trans(
self,
key: &str,
value: impl Into<StyleAttributeValue>,
transition: impl Into<StyleTransition>,
) -> Styled<T>
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.