Skip to main content

CustomNodeFactory

Trait CustomNodeFactory 

Source
pub trait CustomNodeFactory {
    // Required methods
    fn tags(&self) -> &'static [&'static str];
    fn create(
        &self,
        tag: &str,
        ctx: &CustomNodeContext<'_>,
    ) -> Option<Arc<dyn CustomNode>>;
}
Expand description

Constructs a CustomNode for a given HTML tag.

Required Methods§

Source

fn tags(&self) -> &'static [&'static str]

The tags this factory can construct (drives CUSTOM_TAGS).

Source

fn create( &self, tag: &str, ctx: &CustomNodeContext<'_>, ) -> Option<Arc<dyn CustomNode>>

Builds a node for tag, or None if the tag is not handled here.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§