Struct tabled::FormatFrom [−][src]
Expand description
FormatFrom repeatedly uses first possible element from given array unless there’s any elements.
Example
use tabled::{Table, FormatFrom, 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(FormatFrom(vec!["N", "City", "is in Belarus"])))
.to_string();
assert_eq!(table, "+---+---------+---------------+\n\
| N | City | is in Belarus |\n\
+---+---------+---------------+\n\
| 0 | Grodno | true |\n\
+---+---------+---------------+\n\
| 1 | Minsk | true |\n\
+---+---------+---------------+\n\
| 2 | Hamburg | false |\n\
+---+---------+---------------+\n\
| 3 | Brest | true |\n\
+---+---------+---------------+\n");
Tuple Fields
0: Vec<A>