Struct tabled::Format [−][src]
Expand description
Format a structure which modifies a Grid
Example
use tabled::{Table, Format, Row, Modify}; let data = vec![ (0, "Grodno", true), (1, "Minsk", true), (2, "Hamburg", false), (3, "Brest", true), ]; let table = Table::new(&data) .with(Modify::new(Row(1..)).with(Format(|s| { format!(": {} :", s) }))) .to_string(); assert_eq!(table, "+-------+-------------+-----------+\n\ | i32 | &str | bool |\n\ +-------+-------------+-----------+\n\ | : 0 : | : Grodno : | : true : |\n\ +-------+-------------+-----------+\n\ | : 1 : | : Minsk : | : true : |\n\ +-------+-------------+-----------+\n\ | : 2 : | : Hamburg : | : false : |\n\ +-------+-------------+-----------+\n\ | : 3 : | : Brest : | : true : |\n\ +-------+-------------+-----------+\n");
Trait Implementations
Auto Trait Implementations
impl<F> RefUnwindSafe for Format<F> where
F: RefUnwindSafe,
impl<F> UnwindSafe for Format<F> where
F: UnwindSafe,