Attribute Macro bitbar::main

source · []
#[main]
Expand description

Annotate your main function with this.

  • It can optionally take an argument of type bitbar::Flavor.
  • It must return a member of the bitbar::MainOutput trait.
  • It can be a fn or an async fn. In the latter case, tokio’s threaded runtime will be used. (This requires the tokio feature, which is on by default.)

The main attribute optionally takes the following parameter:

  • commands can be set to a list of subcommand names (in parentheses) which will be used if the binary is called with command-line parameters.
  • fallback_command can be set to a function name (in quotes) which will be used if the binary is called with command-line parameters and the first parameter does not match any subcommand.
  • error_template_image can be set to a path (relative to the current file) to a PNG file which will be used as the template image for the menu when displaying an error.