pub struct ListMenu { /* private fields */ }
Expand description
Struct to store the menu style Context menu definition
Implementations
sourceimpl ListMenu
impl ListMenu
sourcepub fn with_text_style(self, text_style: Style) -> Self
pub fn with_text_style(self, text_style: Style) -> Self
Menu builder with new value for text style
sourcepub fn with_selected_text_style(self, selected_text_style: Style) -> Self
pub fn with_selected_text_style(self, selected_text_style: Style) -> Self
Menu builder with new value for text style
sourcepub fn with_description_text_style(self, description_text_style: Style) -> Self
pub fn with_description_text_style(self, description_text_style: Style) -> Self
Menu builder with new value for description style
sourcepub fn with_page_size(self, page_size: usize) -> Self
pub fn with_page_size(self, page_size: usize) -> Self
Menu builder with new page size
sourcepub fn with_only_buffer_difference(self, only_buffer_difference: bool) -> Self
pub fn with_only_buffer_difference(self, only_buffer_difference: bool) -> Self
Menu builder with new only buffer difference
sourceimpl ListMenu
impl ListMenu
sourcepub fn with_marker(self, marker: String) -> Self
pub fn with_marker(self, marker: String) -> Self
Menu builder with menu marker
sourcepub fn with_max_entry_lines(self, max_lines: u16) -> Self
pub fn with_max_entry_lines(self, max_lines: u16) -> Self
Menu builder with max entry lines
Trait Implementations
sourceimpl Menu for ListMenu
impl Menu for ListMenu
sourcefn can_quick_complete(&self) -> bool
fn can_quick_complete(&self) -> bool
There is no use for quick complete for the menu
sourcefn can_partially_complete(
&mut self,
_values_updated: bool,
_line_buffer: &mut LineBuffer,
_completer: &mut dyn Completer
) -> bool
fn can_partially_complete(
&mut self,
_values_updated: bool,
_line_buffer: &mut LineBuffer,
_completer: &mut dyn Completer
) -> bool
The menu should not try to auto complete to avoid comparing all registered values
Selects what type of event happened with the menu
sourcefn update_values(
&mut self,
line_buffer: &mut LineBuffer,
completer: &mut dyn Completer
)
fn update_values(
&mut self,
line_buffer: &mut LineBuffer,
completer: &mut dyn Completer
)
Collecting the value from the completer to be shown in the menu
sourcefn get_values(&self) -> &[Suggestion]
fn get_values(&self) -> &[Suggestion]
Gets values from cached values that will be displayed in the menu
sourcefn replace_in_buffer(&self, line_buffer: &mut LineBuffer)
fn replace_in_buffer(&self, line_buffer: &mut LineBuffer)
The buffer gets cleared with the actual value
Calculates the real required lines for the menu considering how many lines wrap the terminal and if an entry is larger than the remaining lines
Creates the menu representation as a string which will be painted by the painter
sourcefn update_working_details(
&mut self,
line_buffer: &mut LineBuffer,
completer: &mut dyn Completer,
painter: &Painter
)
fn update_working_details(
&mut self,
line_buffer: &mut LineBuffer,
completer: &mut dyn Completer,
painter: &Painter
)
The working details of a menu are values that could change based on the menu conditions before it being printed, such as the number or size of columns, etc. In this function should be defined how the menu event is treated since it is called just before painting the menu Read more
Auto Trait Implementations
impl RefUnwindSafe for ListMenu
impl Send for ListMenu
impl Sync for ListMenu
impl Unpin for ListMenu
impl UnwindSafe for ListMenu
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more