pub trait Exporter<'buf> {
// Required methods
fn export(
input: &str,
conf: ConfigOptions,
) -> Result<String, Vec<ExportError>>;
fn export_buf<'inp, T: Write>(
input: &'inp str,
buf: &'buf mut T,
conf: ConfigOptions,
) -> Result<(), Vec<ExportError>>;
fn export_tree<T: Write>(
parsed: &Parser<'_>,
buf: &'buf mut T,
conf: ConfigOptions,
) -> Result<(), Vec<ExportError>>;
}
Expand description
Trait for exporter implementations
Exporting backends must implement this trait.
Required Methods§
Sourcefn export(input: &str, conf: ConfigOptions) -> Result<String, Vec<ExportError>>
fn export(input: &str, conf: ConfigOptions) -> Result<String, Vec<ExportError>>
Writes the AST generated from the input into a String
.
Sourcefn export_buf<'inp, T: Write>(
input: &'inp str,
buf: &'buf mut T,
conf: ConfigOptions,
) -> Result<(), Vec<ExportError>>
fn export_buf<'inp, T: Write>( input: &'inp str, buf: &'buf mut T, conf: ConfigOptions, ) -> Result<(), Vec<ExportError>>
Writes the AST generated from the input into a buffer that implements Write
.
fn export_tree<T: Write>( parsed: &Parser<'_>, buf: &'buf mut T, conf: ConfigOptions, ) -> Result<(), Vec<ExportError>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.