pub struct Builder { /* private fields */ }
Expand description
Configuration builder
Implementations§
Source§impl Builder
impl Builder
pub fn new() -> Builder
Sourcepub fn max_history_size(self, max_size: usize) -> Builder
pub fn max_history_size(self, max_size: usize) -> Builder
Set the maximum length for the history.
Sourcepub fn history_ignore_dups(self, yes: bool) -> Builder
pub fn history_ignore_dups(self, yes: bool) -> Builder
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) -> Builder
pub fn history_ignore_space(self, yes: bool) -> Builder
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) -> Builder
pub fn completion_type(self, completion_type: CompletionType) -> Builder
Set completion_type
.
Sourcepub fn completion_prompt_limit(self, completion_prompt_limit: usize) -> Builder
pub fn completion_prompt_limit(self, completion_prompt_limit: usize) -> Builder
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: i32) -> Builder
pub fn keyseq_timeout(self, keyseq_timeout_ms: i32) -> Builder
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) -> Builder
pub fn auto_add_history(self, yes: bool) -> Builder
Tell if lines are automatically added to the history.
By default, they are not.
Sourcepub fn color_mode(self, color_mode: ColorMode) -> Builder
pub fn color_mode(self, color_mode: ColorMode) -> Builder
Forces colorization on or off.
By default, colorization is on except if stdout is not a tty.
Sourcepub fn output_stream(self, stream: OutputStreamType) -> Builder
pub fn output_stream(self, stream: OutputStreamType) -> Builder
Whether to use stdout or stderr.
Be default, use stdout
pub fn build(self) -> Config
Trait Implementations§
Source§impl Configurer for Builder
impl Configurer for Builder
fn config_mut(&mut self) -> &mut Config
Source§fn set_max_history_size(&mut self, max_size: usize)
fn set_max_history_size(&mut self, max_size: usize)
Source§fn set_history_ignore_dups(&mut self, yes: bool)
fn set_history_ignore_dups(&mut self, yes: bool)
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
.