pub struct TerminalMenuItem { /* private fields */ }

Implementations§

Get the name of the terminal-menu item.

Set a color to print the item in.

Example
use terminal_menu::{menu, label, scroll};
use crossterm::style::Color;
let menu = menu(vec![
    label("Colorize me").colorize(Color::Magenta),
    scroll("Me too!", vec!["foo", "bar"]).colorize(Color::Green)
]);
Examples found in repository?
examples/colors.rs (line 14)
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
fn main() {
    use terminal_menu::*;

    // see the crossterm crate for all the color options
    use crossterm::style::Color;

    let menu = menu(vec![

        label("COLOR!"),
        label("Red").colorize(Color::Red),
        label("Green").colorize(Color::Green),
        label("Blue").colorize(Color::Blue),

        // selected item is always cyan
        button("Cyan")
    ]);
    run(&menu);
}

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.