#[non_exhaustive]pub enum Format {
Djot,
Markdown,
Xml,
Html,
Asciidoc,
}Expand description
Every format Twig can parse — the input axis, as opposed to Target,
which is where output bytes can go.
#[non_exhaustive] for the same reason Target is: Twig’s parser list
grows (reStructuredText is written and awaiting a registry entry), and a
caller matching on this enum should not have to be recompiled to keep
compiling. Match with a _ arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Djot
Markdown
Xml
Html
Asciidoc
Parsed and rendered, but not serialized: Target::Asciidoc reports
Error::UnsupportedFormat, and no Editor gesture applies to an
AsciiDoc document.
The parser also covers a slice of AsciiDoc rather than all of it — the header, paragraphs, sections, lists, delimited blocks and the inline spans. What it does not implement survives as literal source text rather than failing the parse, so a successful parse is not by itself a claim that the whole document was understood.
Trait Implementations§
impl Copy for Format
impl Eq for Format
Source§impl From<Format> for TwigFormat
impl From<Format> for TwigFormat
Source§impl From<Format> for Target
Total: every input format is also an output target, even the ones with no
serializer yet (converting into XML reports Error::UnsupportedFormat
rather than being unnameable).
impl From<Format> for Target
Total: every input format is also an output target, even the ones with no
serializer yet (converting into XML reports Error::UnsupportedFormat
rather than being unnameable).