Skip to main content

Lower

Trait Lower 

Source
pub trait Lower: Send + Sync {
    // Required method
    fn lower(
        &self,
        node: NodeRef<'_, Flm>,
        cx: &mut LowerCx<'_>,
        lw: &mut dyn Lowerer,
    ) -> Result<Lowering, LowerError>;
}
Expand description

The implementation of a lowering rule: what to do at a node of the rule’s element.

Implement this trait and register the implementation as part of a LoweringRule. The implementation is registered once and may run over many nodes of many documents in parallel, so it holds only its own configuration and does not modify its own state when it runs. Everything it reads reaches it through the Lowerer it is handed, so every read can be checked against the rule’s declaration.

See crate::stdlib::backends::lowering::rules for the default rules of the structural elements, which implement this trait.

Required Methods§

Source

fn lower( &self, node: NodeRef<'_, Flm>, cx: &mut LowerCx<'_>, lw: &mut dyn Lowerer, ) -> Result<Lowering, LowerError>

Lowers node, a node of this rule’s element, and returns what replaces it.

Read the tables and option types the rule declared through lw, and build the replacement nodes through lw as well, which stages them into cx.

§Errors

Returns LowerError when the rule cannot lower the node: a read it did not declare, an element it did not declare that it produces, a node structure it does not handle. See LowerError for how the lowering stage handles each variant.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Lower for AnnotationLatexRule

Source§

impl Lower for AnnotationRule

Source§

impl Lower for AnnotationTextRule

Source§

impl Lower for AuthorLatexRule

Source§

impl Lower for AuthorRule

Source§

impl Lower for BibliographyRule

Source§

impl Lower for CellsLatexRule

Source§

impl Lower for CellsRule

Source§

impl Lower for CiteLatexRule

Source§

impl Lower for CiteRule

Source§

impl Lower for DefinitionLatexRule

Source§

impl Lower for DefinitionRule

Source§

impl Lower for EmailLatexRule

Source§

impl Lower for EmailRule

Source§

impl Lower for EmitCall

Source§

impl Lower for EnsureMathRule

Source§

impl Lower for EntryLatexRule

Source§

impl Lower for flm_core::stdlib::features::metadata::rules::EntryRule

Source§

impl Lower for flm_core::stdlib::features::toc::rules::EntryRule

Source§

impl Lower for flm_core::stdlib::features::xnotes::EntryRule

Source§

impl Lower for EntryTextRule

Source§

impl Lower for flm_core::math_passthrough::latex::EnvironmentLatexRule

Source§

impl Lower for flm_core::stdlib::features::verbatim::latex::EnvironmentLatexRule

Source§

impl Lower for flm_core::math_passthrough::source::EnvironmentRule

Source§

impl Lower for flm_core::stdlib::features::verbatim::EnvironmentRule

Source§

impl Lower for EqrefLatexRule

Source§

impl Lower for EqrefRule

Source§

impl Lower for ExpandInTree

Source§

impl Lower for FieldRule

Source§

impl Lower for FloatLatexRule

Source§

impl Lower for FloatRule

Source§

impl Lower for HeadingLatexRule

Source§

impl Lower for HeadingRule

Source§

impl Lower for HyperrefLatexRule

Source§

impl Lower for HyperrefRule

Source§

impl Lower for ImageLatexRule

Source§

impl Lower for ImageRule

Source§

impl Lower for InputRule

Source§

impl Lower for InstantiateAtLowering

Source§

impl Lower for ItemRule

Source§

impl Lower for LinkLatexRule

Source§

impl Lower for LinkRule

Source§

impl Lower for ListHtmlRule

Source§

impl Lower for flm_core::stdlib::features::lists::latex::ListLatexRule

Source§

impl Lower for flm_core::stdlib::features::xnotes::latex::ListLatexRule

Source§

impl Lower for ListNotWritten

Source§

impl Lower for flm_core::stdlib::features::lists::ListRule

Source§

impl Lower for flm_core::stdlib::features::toc::rules::ListRule

Source§

impl Lower for flm_core::stdlib::features::xnotes::ListRule

Source§

impl Lower for LiteralLatexRule

Source§

impl Lower for LiteralRule

Source§

impl Lower for MacroLatexRule

Source§

impl Lower for MacroRule

Source§

impl Lower for MarkOfLatexRule

Source§

impl Lower for MarkOfRule

Source§

impl Lower for MathGroupRule

Source§

impl Lower for MathLatexRule

Source§

impl Lower for MathRule

Source§

impl Lower for MetaTextLatexRule

Source§

impl Lower for MetaTextRule

Source§

impl Lower for NameRule

Source§

impl Lower for NoteLatexRule

Source§

impl Lower for NothingRule

Source§

impl Lower for NumberRule

Source§

impl Lower for OpaqueRule

Source§

impl Lower for OutsideRule

Source§

impl Lower for flm_core::stdlib::backends::latex_recomposed::rules::ParagraphRule

Source§

impl Lower for flm_core::stdlib::backends::lowering::rules::ParagraphRule

Source§

impl Lower for ParbreakRule

Source§

impl Lower for PartRule

Source§

impl Lower for PlaceholderLatexRule

Source§

impl Lower for flm_core::stdlib::features::defterm::latex::PointerLatexRule

Source§

impl Lower for flm_core::stdlib::features::xnotes::latex::PointerLatexRule

Source§

impl Lower for flm_core::stdlib::features::defterm::lead_in::PointerRule

Source§

impl Lower for flm_core::stdlib::features::xnotes::PointerRule

Source§

impl Lower for QuoteLatexRule

Source§

impl Lower for QuoteRule

Source§

impl Lower for RefCiteLatexRule

Source§

impl Lower for RefCiteRule

Source§

impl Lower for RefLatexRule

Source§

impl Lower for RefRule

Source§

impl Lower for RelationRule

Source§

impl Lower for RootRule

Source§

impl Lower for SectionRule

Source§

impl Lower for SentenceSpacingLatexRule

Source§

impl Lower for SentenceSpacingRule

Source§

impl Lower for TermLatexRule

Source§

impl Lower for TermRule

Source§

impl Lower for TextLatexRule

Source§

impl Lower for TextRule

Source§

impl Lower for TextStyleLatexRule

Source§

impl Lower for TextStyleRule

Source§

impl Lower for TheoremLatexRule

Source§

impl Lower for TheoremRule

Source§

impl Lower for TitlePointerRule

Source§

impl Lower for TitleTextRule

Source§

impl Lower for UnknownEnvironmentRule

Source§

impl Lower for UnknownMacroRule

Source§

impl Lower for UnprocessedEnvironmentRule

Source§

impl Lower for VerbatimRule

Source§

impl Lower for XnoteHtmlRule

Source§

impl Lower for XnoteLatexRule

Source§

impl Lower for XnoteRenderedRule

Source§

impl Lower for XnoteRule