Skip to main content

ElementFactory

Trait ElementFactory 

Source
pub trait ElementFactory: Send + Sync {
    // Required method
    fn build(
        &self,
        name: &str,
        props: Props,
        children: Vec<Cached>,
    ) -> Box<dyn Component>;
}
Expand description

Builds the component behind an unknown element tag.

Required Methods§

Source

fn build( &self, name: &str, props: Props, children: Vec<Cached>, ) -> Box<dyn Component>

Builds an element for name, parsed properties, and retained children.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> ElementFactory for F
where F: Fn(&str, Props, Vec<Cached>) -> Box<dyn Component> + Send + Sync,