TabularRow

Trait TabularRow 

Source
pub trait TabularRow {
    // Required method
    fn to_row(&self) -> Vec<String>;
}
Expand description

Trait for types that can be converted to a row of strings.

This trait is automatically implemented by #[derive(TabularRow)]. It provides optimized row extraction without JSON serialization.

§Example

use standout::tabular::TabularRow;

#[derive(TabularRow)]
struct Task {
    id: String,
    title: String,
    status: String,
}

let task = Task {
    id: "TSK-001".to_string(),
    title: "Implement feature".to_string(),
    status: "pending".to_string(),
};

let row: Vec<String> = task.to_row();
assert_eq!(row, vec!["TSK-001", "Implement feature", "pending"]);

Required Methods§

Source

fn to_row(&self) -> Vec<String>

Converts this instance to a row of string values.

Implementors§