Skip to main content

MenuPresentationExt

Trait MenuPresentationExt 

Source
pub trait MenuPresentationExt<This>{
    // Required methods
    fn menu_items(&self) -> impl Iterator<Item = MenuItem>;
    fn menu_item(
        &self,
        action: ManagerAction,
        verb: impl Into<String>,
    ) -> MenuItem;
    fn cursor_item(&self, verb: impl Into<String>) -> MenuItem;
    fn choice_verb(&self, id: This::Id) -> &'static str;
    fn space_verb(&self) -> String;
}
Expand description

Derives the menu one page offers from the keys it binds and the actions it enables.

Required Methods§

Source

fn menu_items(&self) -> impl Iterator<Item = MenuItem>

States every entry the current page offers, in the order a reader scans them.

Exit closes every menu, because it is the one action every page offers.

Source

fn menu_item(&self, action: ManagerAction, verb: impl Into<String>) -> MenuItem

States one entry naming one action, with the keys the page binds to it.

Source

fn cursor_item(&self, verb: impl Into<String>) -> MenuItem

States the one entry walking a list, which both cursor directions reach.

Source

fn choice_verb(&self, id: This::Id) -> &'static str

Names what the chooser page chooses between for one request.

Source

fn space_verb(&self) -> String

Names what Space would do to the selected entry, whether or not it is offered.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<This> MenuPresentationExt<This> for This

Derives the menu one page offers from the keys it binds and the actions it enables.