html2md

Trait TagHandlerFactory

Source
pub trait TagHandlerFactory {
    // Required method
    fn instantiate(&self) -> Box<dyn TagHandler>;
}
Expand description

Tag handler factory. This class is required in providing proper custom tag parsing capabilities to users of this library.

The problem with directly providing tag handlers is that they’re not stateless. Once tag handler is parsing some tag, it holds data, such as start position, indent etc. The only way to create fresh tag handler for each tag is to provide a factory like this one.

Required Methods§

Source

fn instantiate(&self) -> Box<dyn TagHandler>

Implementors§