TomlExample

Trait TomlExample 

Source
pub trait TomlExample {
    // Required methods
    fn toml_example() -> String;
    fn toml_example_with_prefix(
        label: &str,
        label_format: (&str, &str),
        prefix: &str,
    ) -> String;

    // Provided method
    fn to_toml_example<P: AsRef<Path>>(file_name: P) -> Result<()> { ... }
}

Required Methods§

Source

fn toml_example() -> String

structure to toml example

Source

fn toml_example_with_prefix( label: &str, label_format: (&str, &str), prefix: &str, ) -> String

structure, which is nesting or flatten inside other structure, to a toml example There will be a section {label_format.0}{label}{label_format.1} for the example of struct, and prefix will add # if it is a optional.

Provided Methods§

Source

fn to_toml_example<P: AsRef<Path>>(file_name: P) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§