pub trait DirectiveFactory:
Sized
+ Debug
+ Clone
+ PartialEq
+ 'static {
// Required methods
fn open(
reader: &mut Reader<'_>,
info: &TagInfo<'_>,
) -> Result<Self, SyntaxError>;
fn render(
&self,
ctx: &mut (dyn Context + 'static),
nodes: &[Node],
branches: &[Element],
) -> Result<String, Box<dyn RuntimeError>>;
// Provided methods
fn branch(
_tags: &[TagInfo<'_>],
_info: &TagInfo<'_>,
) -> Result<(), SyntaxError> { ... }
fn close(
&mut self,
_reader: &mut Reader<'_>,
_info: &TagInfo<'_>,
) -> Result<(), SyntaxError> { ... }
}Required Methods§
fn open( reader: &mut Reader<'_>, info: &TagInfo<'_>, ) -> Result<Self, SyntaxError>
fn render( &self, ctx: &mut (dyn Context + 'static), nodes: &[Node], branches: &[Element], ) -> Result<String, Box<dyn RuntimeError>>
Provided Methods§
fn branch(_tags: &[TagInfo<'_>], _info: &TagInfo<'_>) -> Result<(), SyntaxError>
fn close( &mut self, _reader: &mut Reader<'_>, _info: &TagInfo<'_>, ) -> Result<(), SyntaxError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".