Struct migrant_lib::config::SettingsFileInitializer [−][src]
Project settings file builder to initialize a new settings file
Implementations
impl SettingsFileInitializer
[src]
pub fn interactive(&mut self, b: bool) -> &mut Self
[src]
Set interactive prompts, default is true
pub fn with_env_defaults(&mut self, b: bool) -> &mut Self
[src]
Default all file values env:<ENV_VAR>
if unspecified
pub fn with_sqlite_options(
&mut self,
options: &SqliteSettingsBuilder
) -> &mut Self
[src]
&mut self,
options: &SqliteSettingsBuilder
) -> &mut Self
Specify Sqlite database options
Example:
use migrant_lib::Config; use migrant_lib::config::SqliteSettingsBuilder; Config::init_in(env::current_dir()?) .with_sqlite_options( SqliteSettingsBuilder::empty() .database_path("/abs/path/to/my.db")?) .initialize()?;
pub fn with_postgres_options(
&mut self,
options: &PostgresSettingsBuilder
) -> &mut Self
[src]
&mut self,
options: &PostgresSettingsBuilder
) -> &mut Self
Specify Postgres database options
Example:
use migrant_lib::Config; use migrant_lib::config::PostgresSettingsBuilder; Config::init_in(env::current_dir()?) .with_postgres_options( PostgresSettingsBuilder::empty() .database_name("my_db") .database_user("me") .database_port(4444)) .initialize()?;
pub fn with_mysql_options(
&mut self,
options: &MySqlSettingsBuilder
) -> &mut Self
[src]
&mut self,
options: &MySqlSettingsBuilder
) -> &mut Self
Specify MySQL database options
Example:
use migrant_lib::Config; use migrant_lib::config::MySqlSettingsBuilder; Config::init_in(env::current_dir()?) .with_mysql_options( MySqlSettingsBuilder::empty() .database_name("my_db") .database_user("me") .database_port(4444)) .initialize()?;
pub fn initialize(&self) -> Result<()>
[src]
Generate a template config file using provided parameters or prompting the user.
If running interactively, the file will be opened for editing and Config::setup
will be run automatically.
Trait Implementations
impl Clone for SettingsFileInitializer
[src]
fn clone(&self) -> SettingsFileInitializer
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SettingsFileInitializer
[src]
Auto Trait Implementations
impl RefUnwindSafe for SettingsFileInitializer
impl Send for SettingsFileInitializer
impl Sync for SettingsFileInitializer
impl Unpin for SettingsFileInitializer
impl UnwindSafe for SettingsFileInitializer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,