pub struct Builder { /* private fields */ }
Expand description
Configuration builder
Implementations§
source§impl Builder
impl Builder
sourcepub fn max_history_size(self, max_size: usize) -> Result<Self>
pub fn max_history_size(self, max_size: usize) -> Result<Self>
Set the maximum length for the history.
sourcepub fn history_ignore_dups(self, yes: bool) -> Result<Self>
pub fn history_ignore_dups(self, yes: bool) -> Result<Self>
Tell if lines which match the previous history entry are saved or not in the history list.
By default, they are ignored.
sourcepub fn history_ignore_space(self, yes: bool) -> Self
pub fn history_ignore_space(self, yes: bool) -> Self
Tell if lines which begin with a space character are saved or not in the history list.
By default, they are saved.
sourcepub fn completion_type(self, completion_type: CompletionType) -> Self
pub fn completion_type(self, completion_type: CompletionType) -> Self
Set completion_type
.
sourcepub fn completion_prompt_limit(self, completion_prompt_limit: usize) -> Self
pub fn completion_prompt_limit(self, completion_prompt_limit: usize) -> Self
The number of possible completions that determines when the user is asked whether the list of possibilities should be displayed.
sourcepub fn keyseq_timeout(self, keyseq_timeout_ms: Option<u16>) -> Self
pub fn keyseq_timeout(self, keyseq_timeout_ms: Option<u16>) -> Self
Timeout for ambiguous key sequences in milliseconds.
Currently, it is used only to distinguish a single ESC from an ESC
sequence.
After seeing an ESC key, wait at most keyseq_timeout_ms
for another
byte.
sourcepub fn auto_add_history(self, yes: bool) -> Self
pub fn auto_add_history(self, yes: bool) -> Self
Tell if lines are automatically added to the history.
By default, they are not.
sourcepub fn bell_style(self, bell_style: BellStyle) -> Self
pub fn bell_style(self, bell_style: BellStyle) -> Self
Set bell style: beep, flash or nothing.
sourcepub fn color_mode(self, color_mode: ColorMode) -> Self
pub fn color_mode(self, color_mode: ColorMode) -> Self
Forces colorization on or off.
By default, colorization is on except if stdout is not a TTY.
sourcepub fn behavior(self, behavior: Behavior) -> Self
pub fn behavior(self, behavior: Behavior) -> Self
Whether to use stdio or not
By default, stdio is used.
sourcepub fn check_cursor_position(self, yes: bool) -> Self
pub fn check_cursor_position(self, yes: bool) -> Self
Check if cursor position is at leftmost before displaying prompt.
By default, we don’t check.
sourcepub fn indent_size(self, indent_size: usize) -> Self
pub fn indent_size(self, indent_size: usize) -> Self
Indentation size
By default, 2
sourcepub fn bracketed_paste(self, enabled: bool) -> Self
pub fn bracketed_paste(self, enabled: bool) -> Self
Enable or disable bracketed paste on unix platform
By default, it’s enabled.
sourcepub fn enable_signals(self, enable_signals: bool) -> Self
pub fn enable_signals(self, enable_signals: bool) -> Self
Enable or disable signals in termios
By default, it’s disabled.
Trait Implementations§
source§impl Configurer for Builder
impl Configurer for Builder
source§fn config_mut(&mut self) -> &mut Config
fn config_mut(&mut self) -> &mut Config
Config
accessor.source§fn set_max_history_size(&mut self, max_size: usize) -> Result<()>
fn set_max_history_size(&mut self, max_size: usize) -> Result<()>
source§fn set_history_ignore_dups(&mut self, yes: bool) -> Result<()>
fn set_history_ignore_dups(&mut self, yes: bool) -> Result<()>
source§fn set_history_ignore_space(&mut self, yes: bool)
fn set_history_ignore_space(&mut self, yes: bool)
source§fn set_completion_type(&mut self, completion_type: CompletionType)
fn set_completion_type(&mut self, completion_type: CompletionType)
completion_type
.source§fn set_completion_prompt_limit(&mut self, completion_prompt_limit: usize)
fn set_completion_prompt_limit(&mut self, completion_prompt_limit: usize)
source§fn set_keyseq_timeout(&mut self, keyseq_timeout_ms: Option<u16>)
fn set_keyseq_timeout(&mut self, keyseq_timeout_ms: Option<u16>)
source§fn set_edit_mode(&mut self, edit_mode: EditMode)
fn set_edit_mode(&mut self, edit_mode: EditMode)
source§fn set_auto_add_history(&mut self, yes: bool)
fn set_auto_add_history(&mut self, yes: bool)
source§fn set_bell_style(&mut self, bell_style: BellStyle)
fn set_bell_style(&mut self, bell_style: BellStyle)
source§fn set_color_mode(&mut self, color_mode: ColorMode)
fn set_color_mode(&mut self, color_mode: ColorMode)
source§fn set_behavior(&mut self, behavior: Behavior)
fn set_behavior(&mut self, behavior: Behavior)
source§fn set_tab_stop(&mut self, tab_stop: usize)
fn set_tab_stop(&mut self, tab_stop: usize)
source§fn set_check_cursor_position(&mut self, yes: bool)
fn set_check_cursor_position(&mut self, yes: bool)
source§fn set_indent_size(&mut self, size: usize)
fn set_indent_size(&mut self, size: usize)
source§fn enable_bracketed_paste(&mut self, enabled: bool)
fn enable_bracketed_paste(&mut self, enabled: bool)
source§fn set_enable_signals(&mut self, enable_signals: bool)
fn set_enable_signals(&mut self, enable_signals: bool)
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)