Skip to main content

GeneratedDoc

Trait GeneratedDoc 

pub trait GeneratedDoc {
    // Required methods
    fn path(&self) -> &'static str;
    fn label(&self) -> &'static str;
    fn render(&self) -> Result<String, Error>;

    // Provided method
    fn framing(&self) -> Framing { ... }
}
Expand description

One generated documentation region.

Adding a generator is this trait plus one line in generate_all::generators.

Required Methods§

fn path(&self) -> &'static str

Where the output lives, relative to the repository root.

fn label(&self) -> &'static str

The pragma label. Output is written between <!-- Begin auto-generated {label} --> and <!-- End … -->.

Under Framing::WholeFile no pragma is written, and the label is used only in diagnostics.

fn render(&self) -> Result<String, Error>

The content between the pragmas.

§Errors

Whatever the generator cannot determine from the code it reads. Errors are fatal in every mode: a generator that cannot determine the truth must not emit a guess.

Provided Methods§

fn framing(&self) -> Framing

Whether the output is spliced into a hand-written page or is the file.

Defaults to Framing::Pragmas.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§