Skip to main content

StyleExt

Trait StyleExt 

Source
pub trait StyleExt: Sized {
    // Provided method
    fn apply(self, f: impl FnOnce(Self) -> Self) -> Self { ... }
}
Expand description

Apply an element transform — notably a style! block — to any styled element: div().apply(style! { … }).

Provided Methods§

Source

fn apply(self, f: impl FnOnce(Self) -> Self) -> Self

Run f on self and return the result. style! produces exactly the FnOnce(Self) -> Self this expects.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Styled> StyleExt for T