[][src]Trait html2md::TagHandlerFactory

pub trait TagHandlerFactory {
    fn instantiate(&self) -> Box<dyn TagHandler>;
}

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

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

Loading content...

Implementors

Loading content...