Struct reedline::HistoryMenu
source · [−]pub struct HistoryMenu { /* private fields */ }
Expand description
Struct to store the menu style Context menu definition
Implementations
sourceimpl HistoryMenu
impl HistoryMenu
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_page_size(self, page_size: usize) -> Self
pub fn with_page_size(self, page_size: usize) -> Self
Menu builder with page size
sourcepub fn with_selection_char(self, selection_char: char) -> Self
pub fn with_selection_char(self, selection_char: char) -> Self
Menu builder with row char
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 Default for HistoryMenu
impl Default for HistoryMenu
sourceimpl Menu for HistoryMenu
impl Menu for HistoryMenu
sourcefn can_partially_complete(
&mut self,
_values_updated: bool,
_line_buffer: &mut LineBuffer,
_history: &dyn History,
_completer: &dyn Completer
) -> bool
fn can_partially_complete(
&mut self,
_values_updated: bool,
_line_buffer: &mut LineBuffer,
_history: &dyn History,
_completer: &dyn Completer
) -> bool
The history 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,
history: &dyn History,
_completer: &dyn Completer
)
fn update_values(
&mut self,
line_buffer: &mut LineBuffer,
history: &dyn History,
_completer: &dyn Completer
)
Collecting the value from the history to be shown in the menu
sourcefn get_values(&self) -> &[(Span, String)]
fn get_values(&self) -> &[(Span, String)]
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,
history: &dyn History,
completer: &dyn Completer,
painter: &Painter
)
fn update_working_details(
&mut self,
line_buffer: &mut LineBuffer,
history: &dyn History,
completer: &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 HistoryMenu
impl Send for HistoryMenu
impl Sync for HistoryMenu
impl Unpin for HistoryMenu
impl UnwindSafe for HistoryMenu
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