Macro ttygrid::header[][src]

macro_rules! header {
    ($text : tt) => { ... };
    ($text : tt, $priority : tt) => { ... };
}
Expand description

header defines a SafeGridHeader for use with the TTYGrid.

It is variadic and composes of two current options:

  • text by itself as the first position will yield a base header with the text set.
  • a second parameter, optionally provided, will set the priority to a usize.

Examples:

   use ttygrid::header;

   assert_eq!(header!("header").borrow().text(), "header");

   let priority_header = header!("header2", 10);
   assert_eq!(priority_header.borrow().text(), "header2");
   assert_eq!(priority_header.borrow().priority(), 10);

   let name = "foo";
   let priority = 20;
   assert_eq!(header!(name, priority), header!("foo", 20));