Struct prototty_common::MenuInstance [] [src]

pub struct MenuInstance<T: Copy> { /* fields omitted */ }

An instance of a menu, with a selected entry. When a MenuInstance is rendered, the currently-selected entry is rendered using the Menu's selected_info.

Methods

impl<T: Copy> MenuInstance<T>
[src]

[src]

Create a new MenuInstance with the first entry selected. Returns None if the Menu has 0 elements.

[src]

Create a new MenuInstance with the given index selected. Returns None if index >= menu.entries.len().

[src]

Returns a reference to the internal menu

[src]

Consumes the instance, returning its menu

[src]

Returns the current index

[src]

Sets the index, if the specified index < menu.entries.len()

[src]

Select the entry above the current selection, unless the first entry is currently selected.

[src]

Select the entry below the current selection, unless the last entry is currently selected.

[src]

Returns a copy of the currently selected entry's value.

[src]

Feed input into the menu instance, possibly changing the selected entry, cancelling the menu, attempting to exit the program, or finalising the selection.

Trait Implementations

impl<T: Debug + Copy> Debug for MenuInstance<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Clone + Copy> Clone for MenuInstance<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Copy> View<MenuInstance<T>> for DefaultMenuInstanceView
[src]

[src]

Update the cells in grid to describe how a type should be rendered.

impl<T: Copy> ViewSize<MenuInstance<T>> for DefaultMenuInstanceView
[src]

[src]

Returns the size in cells of the rectangle containing a ui element. This allows for the implementation of decorator ui components that render a border around some inner element. Read more

Auto Trait Implementations

impl<T> Send for MenuInstance<T> where
    T: Send

impl<T> Sync for MenuInstance<T> where
    T: Sync