Crate menu

source ·
Expand description

A basic command-line interface for #![no_std] Rust programs. Peforms zero heap allocation.

Modules

  • The Menu Manager looks after the menu and where we currently are within it.

Structs

  • An Item is a what our menus are made from. Each item has a name which you have to enter to select this item. Each item can also have zero or more parameters, and some optional help text.
  • A Menu is made of one or more Items.
  • This structure handles the menu. You feed it bytes as they are read from the console and it executes menu actions when commands are typed in (followed by Enter).

Enums

  • Describes the ways in which the API can fail
  • Do we enter a sub-menu when this command is entered, or call a specific function?
  • Describes a parameter to the command

Functions

  • Looks for the named parameter in the parameter list of the item, then finds the correct argument.

Type Aliases

  • The type of function we call when we a valid command has been entered.
  • The type of function we call when we enter/exit a menu.