Trait DocumentedStruct

Source
pub trait DocumentedStruct {
    // Required methods
    fn struct_docs() -> Vec<&'static str>;
    fn field_types() -> Vec<&'static str>;
    fn field_names() -> Vec<&'static str>;
    fn field_docs() -> Vec<Vec<&'static str>>;

    // Provided method
    fn commented_fields() -> Result<String, Box<dyn Error>> { ... }
}

Required Methods§

Source

fn struct_docs() -> Vec<&'static str>

Returns all docstrings of the struct itself

Source

fn field_types() -> Vec<&'static str>

Returns all struct field types, ex. Option<String>

Source

fn field_names() -> Vec<&'static str>

Returns all struct field names

Source

fn field_docs() -> Vec<Vec<&'static str>>

Returns all docstrings of each field, each line is a separate string

Provided Methods§

Source

fn commented_fields() -> Result<String, Box<dyn Error>>

Returns formatted string showing types of each field and comments above it, the format is very similar to raw rust

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§