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§
Sourcefn struct_docs() -> Vec<&'static str>
fn struct_docs() -> Vec<&'static str>
Returns all docstrings of the struct itself
Sourcefn field_types() -> Vec<&'static str>
fn field_types() -> Vec<&'static str>
Returns all struct field types, ex. Option<String>
Sourcefn field_names() -> Vec<&'static str>
fn field_names() -> Vec<&'static str>
Returns all struct field names
Sourcefn field_docs() -> Vec<Vec<&'static str>>
fn field_docs() -> Vec<Vec<&'static str>>
Returns all docstrings of each field, each line is a separate string
Provided Methods§
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.