pub trait Control: Send + Sync {
// Required method
fn render<'a>(&self, cx: &'a Cx, input: ControlInput) -> BoxView<'a>;
}Expand description
Renders a field’s input from a ControlInput, using a hidden field for a state that submits
nothing. A detail page shows the value through a Column instead.
struct Color;
impl Control for Color {
fn render<'a>(&self, cx: &'a Cx, input: ControlInput) -> BoxView<'a> {
let attrs = input.attributes(cx);
view! { <input type="color" (attrs)> }.boxed()
}
}
Field::custom(Theme::fields().accent(), Color);Required Methods§
fn render<'a>(&self, cx: &'a Cx, input: ControlInput) -> BoxView<'a>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".