Expand description
Styled table rendering for Oxur tools
Provides a flexible table builder with TOML-based theming for terminal output.
§Examples
§Basic Usage
use oxur_cli::table::{OxurTable, Tabled};
#[derive(Tabled)]
struct Employee {
#[tabled(rename = "Name")]
name: String,
#[tabled(rename = "Age")]
age: u32,
#[tabled(rename = "Role")]
role: String,
}
let employees = vec![
Employee { name: "Alice".into(), age: 30, role: "Engineer".into() },
Employee { name: "Bob".into(), age: 25, role: "Designer".into() },
];
let table = OxurTable::new(employees).render();
println!("{}", table);§With Title and Footer
use oxur_cli::table::{OxurTable, Tabled};
#[derive(Tabled)]
struct Row {
#[tabled(rename = "ID")]
id: u32,
#[tabled(rename = "Name")]
name: String,
}
let data = vec![
Row { id: 1, name: "Alice".into() },
Row { id: 2, name: "Bob".into() },
];
let table = OxurTable::new(data)
.with_title("USER LIST")
.with_footer()
.render();
println!("{}", table);Re-exports§
pub use config::TableStyleConfig;
Modules§
Structs§
- Builder
- Builder creates a
Tablefrom dynamic data set. - Cell
- Cell denotes a particular cell on a
Table. - Oxur
Table - A themed table builder for terminal output
- Tabled
Color - Color represents a color which can be set to things like
Border,PaddingandMargin.
Traits§
- Tabled
- Tabled a trait responsible for providing a header fields and a row fields.