Struct reedline::ListMenu

source ·
pub struct ListMenu { /* private fields */ }
Expand description

Struct to store the menu style Context menu definition

Implementations§

source§

impl ListMenu

source

pub fn with_page_size(self, page_size: usize) -> Self

Menu builder with new page size

source

pub fn with_max_entry_lines(self, max_lines: u16) -> Self

Menu builder with max entry lines

Trait Implementations§

source§

impl Default for ListMenu

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Menu for ListMenu

source§

fn settings(&self) -> &MenuSettings

Menu settings

source§

fn is_active(&self) -> bool

Deactivates context menu

source§

fn can_quick_complete(&self) -> bool

There is no use for quick complete for the menu

source§

fn can_partially_complete( &mut self, _values_updated: bool, _editor: &mut Editor, _completer: &mut dyn Completer ) -> bool

The menu should not try to auto complete to avoid comparing all registered values

source§

fn menu_event(&mut self, event: MenuEvent)

Selects what type of event happened with the menu

source§

fn update_values(&mut self, editor: &mut Editor, completer: &mut dyn Completer)

Collecting the value from the completer to be shown in the menu

source§

fn get_values(&self) -> &[Suggestion]

Gets values from cached values that will be displayed in the menu

source§

fn replace_in_buffer(&self, editor: &mut Editor)

The buffer gets cleared with the actual value

source§

fn menu_required_lines(&self, terminal_columns: u16) -> u16

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

source§

fn menu_string(&self, _available_lines: u16, use_ansi_coloring: bool) -> String

Creates the menu representation as a string which will be painted by the painter

source§

fn min_rows(&self) -> u16

Minimum rows that should be displayed by the menu

source§

fn update_working_details( &mut self, editor: &mut Editor, 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
source§

fn name(&self) -> &str

Menu name
source§

fn indicator(&self) -> &str

Menu indicator
source§

fn set_cursor_pos(&mut self, _pos: (u16, u16))

Sets the position of the cursor (currently only required by the IDE menu)
source§

impl MenuBuilder for ListMenu

source§

fn settings_mut(&mut self) -> &mut MenuSettings

Get mutable MenuSettings required for the builder functions
source§

fn with_name(self, name: &str) -> Self

Menu builder with new name
source§

fn with_text_style(self, color: Style) -> Self

Menu builder with new value for text style
source§

fn with_selected_text_style(self, color: Style) -> Self

Menu builder with new value for selected text style
source§

fn with_description_text_style(self, color: Style) -> Self

Menu builder with new value for description style
source§

fn with_match_text_style(self, color: Style) -> Self

Menu builder with new value for match style This is the style of the part of the input text, the suggestions are based on
source§

fn with_selected_match_text_style(self, color: Style) -> Self

Menu builder with new value for selected match style This is the style of the part of the input text, the suggestions are based on
source§

fn with_marker(self, marker: &str) -> Self

Menu builder with new value for marker
source§

fn with_only_buffer_difference(self, only_buffer_difference: bool) -> Self

Menu builder with new value for only_buffer_difference

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.