pub struct ConfigurationBuilder { /* private fields */ }
Expand description
A builder for creating a Configuration instance.
Implementations§
Source§impl ConfigurationBuilder
impl ConfigurationBuilder
pub fn new<S: Into<String>>(program_name: S, version: S) -> Self
Sourcepub fn with_config(self) -> Self
pub fn with_config(self) -> Self
Initialize configuration from the configuration file. The configuration file is located
in the user’s home directory in a hidden directory named after the program name
(e.g. .rsql
) or in the current working directory if the home directory is not
available. The configuration file is named after the program name with a .toml
extension
(e.g. .rsql.toml
).
If the configuration file does not exist, it is created with the default configuration.
Sourcepub fn with_config_dir<P: Into<PathBuf>>(self, config_dir: P) -> Self
pub fn with_config_dir<P: Into<PathBuf>>(self, config_dir: P) -> Self
Initialize configuration from the configuration file. The configuration file is located
in the user’s home directory in a hidden directory named after the program name
(e.g. .rsql
) or in the current working directory if the home directory is not
available. The configuration file is named after the program name with a .toml
extension
(e.g. .rsql.toml
).
If the configuration file does not exist, it is created with the default configuration.
§Panics
Panics if the configuration file cannot be loaded.
Sourcepub fn with_bail_on_error(self, bail_on_error: bool) -> Self
pub fn with_bail_on_error(self, bail_on_error: bool) -> Self
Set the bail on error to use.
Sourcepub fn with_color(self, color: bool) -> Self
pub fn with_color(self, color: bool) -> Self
Set the color value.
Sourcepub fn with_command_identifier<S: Into<String>>(
self,
command_identifier: S,
) -> Self
pub fn with_command_identifier<S: Into<String>>( self, command_identifier: S, ) -> Self
Set the command identifier value.
Sourcepub fn with_log_level(self, log_level: LevelFilter) -> Self
pub fn with_log_level(self, log_level: LevelFilter) -> Self
Set the log level to use.
Sourcepub fn with_log_dir<P: Into<PathBuf>>(self, log_dir: P) -> Self
pub fn with_log_dir<P: Into<PathBuf>>(self, log_dir: P) -> Self
Set the log directory to use.
Sourcepub fn with_log_rotation(self, log_rotation: Rotation) -> Self
pub fn with_log_rotation(self, log_rotation: Rotation) -> Self
Set the log rotation to use.
Sourcepub fn with_locale<S: Into<String>>(self, locale: S) -> Self
pub fn with_locale<S: Into<String>>(self, locale: S) -> Self
Set the locale to use.
Sourcepub fn with_edit_mode(self, edit_mode: EditMode) -> Self
pub fn with_edit_mode(self, edit_mode: EditMode) -> Self
Set the edit mode to use.
Sourcepub fn with_history(self, history: bool) -> Self
pub fn with_history(self, history: bool) -> Self
Set the history to use.
Sourcepub fn with_history_file<P: Into<PathBuf>>(self, history_file: P) -> Self
pub fn with_history_file<P: Into<PathBuf>>(self, history_file: P) -> Self
Set the history file to use.
Sourcepub fn with_history_limit(self, history_limit: usize) -> Self
pub fn with_history_limit(self, history_limit: usize) -> Self
Set the history limit to use.
Sourcepub fn with_history_ignore_dups(self, history_ignore_dups: bool) -> Self
pub fn with_history_ignore_dups(self, history_ignore_dups: bool) -> Self
Set the history ignore dups to use.
Sourcepub fn with_theme<S: Into<String>>(self, theme: S) -> Self
pub fn with_theme<S: Into<String>>(self, theme: S) -> Self
Set the theme to use.
Sourcepub fn with_results_changes(self, results_changes: bool) -> Self
pub fn with_results_changes(self, results_changes: bool) -> Self
Set the display of rows changed.
Set the display of the results’ footer.
Sourcepub fn with_results_format<S: Into<String>>(self, results_format: S) -> Self
pub fn with_results_format<S: Into<String>>(self, results_format: S) -> Self
Set the results format to use.
Sourcepub fn with_results_header(self, results_header: bool) -> Self
pub fn with_results_header(self, results_header: bool) -> Self
Set the display of the results’ header.
Sourcepub fn with_results_limit(self, results_limit: usize) -> Self
pub fn with_results_limit(self, results_limit: usize) -> Self
Set the limit for the number of results returned.
Sourcepub fn with_results_rows(self, results_rows: bool) -> Self
pub fn with_results_rows(self, results_rows: bool) -> Self
Set the display of rows returned.
Sourcepub fn with_results_timer(self, results_timer: bool) -> Self
pub fn with_results_timer(self, results_timer: bool) -> Self
Set the display of the results’ timer.
pub fn with_smart_completions(self, smart_completions: bool) -> Self
Sourcepub fn build(self) -> Configuration
pub fn build(self) -> Configuration
Trait Implementations§
Source§impl Clone for ConfigurationBuilder
impl Clone for ConfigurationBuilder
Source§fn clone(&self) -> ConfigurationBuilder
fn clone(&self) -> ConfigurationBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConfigurationBuilder
impl Debug for ConfigurationBuilder
Source§impl Default for ConfigurationBuilder
impl Default for ConfigurationBuilder
Source§fn default() -> ConfigurationBuilder
fn default() -> ConfigurationBuilder
Source§impl PartialEq for ConfigurationBuilder
impl PartialEq for ConfigurationBuilder
impl Eq for ConfigurationBuilder
impl StructuralPartialEq for ConfigurationBuilder
Auto Trait Implementations§
impl Freeze for ConfigurationBuilder
impl RefUnwindSafe for ConfigurationBuilder
impl Send for ConfigurationBuilder
impl Sync for ConfigurationBuilder
impl Unpin for ConfigurationBuilder
impl UnwindSafe for ConfigurationBuilder
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more