pub trait MarkupBackend: Send + Sync {
// Required methods
fn id(&self) -> BackendId;
fn decode(
&self,
input: &str,
opts: &MarkupDecodeOptions,
) -> Result<(MarkupDoc, MarkupFidelity), MarkupError>;
fn encode(
&self,
doc: &MarkupDoc,
opts: &MarkupEncodeOptions,
) -> Result<(String, MarkupFidelity), MarkupError>;
}Expand description
A concrete markup reader/writer behind a runtime codec id.
Required Methods§
Sourcefn decode(
&self,
input: &str,
opts: &MarkupDecodeOptions,
) -> Result<(MarkupDoc, MarkupFidelity), MarkupError>
fn decode( &self, input: &str, opts: &MarkupDecodeOptions, ) -> Result<(MarkupDoc, MarkupFidelity), MarkupError>
Decode backend source text into the shared markup document IR.
Sourcefn encode(
&self,
doc: &MarkupDoc,
opts: &MarkupEncodeOptions,
) -> Result<(String, MarkupFidelity), MarkupError>
fn encode( &self, doc: &MarkupDoc, opts: &MarkupEncodeOptions, ) -> Result<(String, MarkupFidelity), MarkupError>
Encode the shared markup document IR into backend source text.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".