Struct ConfigurationBuilder

Source
pub struct ConfigurationBuilder { /* private fields */ }
Expand description

A builder for creating a Configuration instance.

Implementations§

Source§

impl ConfigurationBuilder

Source

pub fn new<S: Into<String>>(program_name: S, version: S) -> Self

Source

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.

Source

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.

Source

pub fn with_bail_on_error(self, bail_on_error: bool) -> Self

Set the bail on error to use.

Source

pub fn with_color(self, color: bool) -> Self

Set the color value.

Source

pub fn with_command_identifier<S: Into<String>>( self, command_identifier: S, ) -> Self

Set the command identifier value.

Source

pub fn with_echo(self, echo: EchoMode) -> Self

Set the echo value.

Source

pub fn with_log_level(self, log_level: LevelFilter) -> Self

Set the log level to use.

Source

pub fn with_log_dir<P: Into<PathBuf>>(self, log_dir: P) -> Self

Set the log directory to use.

Source

pub fn with_log_rotation(self, log_rotation: Rotation) -> Self

Set the log rotation to use.

Source

pub fn with_locale<S: Into<String>>(self, locale: S) -> Self

Set the locale to use.

Source

pub fn with_edit_mode(self, edit_mode: EditMode) -> Self

Set the edit mode to use.

Source

pub fn with_history(self, history: bool) -> Self

Set the history to use.

Source

pub fn with_history_file<P: Into<PathBuf>>(self, history_file: P) -> Self

Set the history file to use.

Source

pub fn with_history_limit(self, history_limit: usize) -> Self

Set the history limit to use.

Source

pub fn with_history_ignore_dups(self, history_ignore_dups: bool) -> Self

Set the history ignore dups to use.

Source

pub fn with_theme<S: Into<String>>(self, theme: S) -> Self

Set the theme to use.

Source

pub fn with_results_changes(self, results_changes: bool) -> Self

Set the display of rows changed.

Set the display of the results’ footer.

Source

pub fn with_results_format<S: Into<String>>(self, results_format: S) -> Self

Set the results format to use.

Source

pub fn with_results_header(self, results_header: bool) -> Self

Set the display of the results’ header.

Source

pub fn with_results_limit(self, results_limit: usize) -> Self

Set the limit for the number of results returned.

Source

pub fn with_results_rows(self, results_rows: bool) -> Self

Set the display of rows returned.

Source

pub fn with_results_timer(self, results_timer: bool) -> Self

Set the display of the results’ timer.

Source

pub fn with_smart_completions(self, smart_completions: bool) -> Self

Source

pub fn build(self) -> Configuration

Build a Configuration instance.

§Panics

Panics if the log file appender cannot be created.

Trait Implementations§

Source§

impl Clone for ConfigurationBuilder

Source§

fn clone(&self) -> ConfigurationBuilder

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigurationBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ConfigurationBuilder

Source§

fn default() -> ConfigurationBuilder

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

impl PartialEq for ConfigurationBuilder

Source§

fn eq(&self, other: &ConfigurationBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ConfigurationBuilder

Source§

impl StructuralPartialEq for ConfigurationBuilder

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> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T