Trait StructTable

Source
pub trait StructTable {
    // Required method
    fn data<O: StructTableOptions>(&self, config: &O) -> Vec<Option<String>>;

    // Provided methods
    fn class_headers<O: StructTableOptions>(_config: &O) -> Option<Vec<String>> { ... }
    fn instance_headers<O: StructTableOptions>(
        &self,
        _config: &O,
    ) -> Option<Vec<String>> { ... }
    fn status(&self) -> Option<String> { ... }
}
Expand description

Trait for building tables out of structures

Required Methods§

Source

fn data<O: StructTableOptions>(&self, config: &O) -> Vec<Option<String>>

Return vector of selected fields as Option<String>

Provided Methods§

Source

fn class_headers<O: StructTableOptions>(_config: &O) -> Option<Vec<String>>

Return Vector of table headers (attribute titles to be returned) that are not instance specific (i.e. struct)

Source

fn instance_headers<O: StructTableOptions>( &self, _config: &O, ) -> Option<Vec<String>>

Return Vector of table headers (attribute titles to be returned) from the instance that are instance specific (i.e. HashMap)

Source

fn status(&self) -> Option<String>

Return structure status property

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§