annotate_toml_table

Function annotate_toml_table 

Source
pub fn annotate_toml_table<T>(
    table: &mut Table,
    is_root: bool,
) -> Result<(), ConfigError>
Expand description

Annotates a TOML Table with documentation extracted from a struct T that implements the Documented and DocumentedFields traits.

This adds documentation comments above each key in the table based on field-level documentation, and optionally includes the struct-level documentation if is_root is false.

§Arguments

  • table - Mutable reference to the TOML table to annotate.
  • is_root - Whether this table is the root; root tables don’t get container-level doc comments.

§Returns

Returns Ok(()) if successful, or a ConfigError if a TOML item is unexpectedly None.