macro_rules! border { () => { ... }; ($b:ident) => { ... }; ($first:ident,$($other:ident),*) => { ... }; }
Available on crate feature
macros
only.Expand description
Macro that constructs and returns a combination of the Borders
object from TOP, BOTTOM, LEFT
and RIGHT.
When used with NONE you should consider omitting this completely. For ALL you should consider
Block::bordered()
instead.
§Examples
Block::new()
.title("Construct Borders and use them in place")
.borders(border!(TOP, BOTTOM));
border!
can be called with any number of individual sides:
let right_open = border!(TOP, LEFT, BOTTOM);
assert_eq!(right_open, Borders::TOP | Borders::LEFT | Borders::BOTTOM);
Single borders work but using Borders::
directly would be simpler.
assert_eq!(border!(TOP), Borders::TOP);
assert_eq!(border!(ALL), Borders::ALL);
assert_eq!(border!(), Borders::NONE);