Macro prettytable::row

source ·
macro_rules! row {
    (($($out:tt)*);) => { ... };
    (($($out:tt)*); $value:expr) => { ... };
    (($($out:tt)*); $value:expr, $($n:tt)*) => { ... };
    (($($out:tt)*); $style:ident -> $value:expr) => { ... };
    (($($out:tt)*); $style:ident -> $value:expr, $($n: tt)*) => { ... };
    ($($content:expr), *) => { ... };
    ($style:ident => $($content:expr), *) => { ... };
    ($style:ident => $($content:expr,) *) => { ... };
    ($($content:tt)*) => { ... };
}
Expand description

This macro simplifies Row creation

The syntax support style spec

Example

// Create a normal row
let row1 = row!["Element 1", "Element 2", "Element 3"];
// Create a row with all cells formatted with red foreground color, yellow background color
// bold, italic, align in the center of the cell
let row2 = row![FrBybic => "Element 1", "Element 2", "Element 3"];
// Create a row with first cell in blue, second one in red, and last one with default style
let row3 = row![Fb->"blue", Fr->"red", "normal"];
// Do something with rows

For details about style specifier syntax, check doc for Cell::style_spec method