pub trait WebComponent: Sized + FromProperties<Self::Properties> {
type Properties: Properties + PartialEq + Debug;
// Required method
fn render(component: Signal<Self>) -> Element;
// Provided methods
fn instance(properties: &Self::Properties) -> Signal<Self> { ... }
fn initialize(&mut self) { ... }
fn id(&self) -> Option<String> { ... }
fn on_mount(&mut self) { ... }
fn on_mount_with_element(&mut self, _element: Element) { ... }
fn update(&mut self, state: Self) { ... }
}Required Associated Types§
type Properties: Properties + PartialEq + Debug
Required Methods§
Provided Methods§
fn instance(properties: &Self::Properties) -> Signal<Self>
fn initialize(&mut self)
fn id(&self) -> Option<String>
fn on_mount(&mut self)
fn on_mount_with_element(&mut self, _element: Element)
fn update(&mut self, state: Self)
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.