Selectable

Trait Selectable 

Source
pub trait Selectable {
    // Required methods
    fn is_empty(&self) -> bool;
    fn len(&self) -> usize;
    fn next(&mut self);
    fn prev(&mut self);
    fn index(&self) -> usize;
    fn set_index(&mut self, index: usize);
    fn selected_is_last(&self) -> bool;
}
Expand description

Allow selection of a element and basic navigation. Its implementation is mostly made by the macro crate::impl_selectable which allows to manipulate all sort of content in a common manner. It simplifies a lot the creation of menus for any action and is used everywhere.

Required Methods§

Source

fn is_empty(&self) -> bool

True iff the content is empty

Source

fn len(&self) -> usize

Number of element in content

Source

fn next(&mut self)

Select next element in content

Source

fn prev(&mut self)

Select previous element in content

Source

fn index(&self) -> usize

Current index of selected element. 0 if the content is empty (I know, could be an option)

Source

fn set_index(&mut self, index: usize)

set the index to the value if possible

Source

fn selected_is_last(&self) -> bool

true if the selected element is the last of content

Implementors§

Source§

impl Selectable for OpendalContainer

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for CliApplications

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Completion

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Compresser

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for ContextMenu

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Directory

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Flagged

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for History

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Marks

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Mount

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Picker

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Shortcut

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for TempMarks

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for Trash

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.

Source§

impl Selectable for TuiApplications

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, set_index and selected_is_last.