Struct avantis_utils::db::DatabaseConfig
source · [−]pub struct DatabaseConfig {
pub host: String,
pub user: String,
pub password: String,
pub db_name: String,
pub max_connections: u32,
}Expand description
Standard database config. Designed to be used in config module, one database per config.
Example
let config = DatabaseConfig {
host: "localhost".to_string(),
user: "username".to_string(),
password: "REPLACE_ME".to_string(),
db_name: "my_db".to_string(),
max_connections: 30
};
println!("{:?}", config);
// initialize the pool by calling `config.init_pool().await?`Fields
host: Stringuser: Stringpassword: Stringdb_name: Stringmax_connections: u32Implementations
sourceimpl DatabaseConfig
impl DatabaseConfig
Trait Implementations
sourceimpl Clone for DatabaseConfig
impl Clone for DatabaseConfig
sourcefn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DatabaseConfig
impl Debug for DatabaseConfig
sourceimpl<'de> Deserialize<'de> for DatabaseConfig
impl<'de> Deserialize<'de> for DatabaseConfig
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<DatabaseConfig> for DatabaseConfig
impl PartialEq<DatabaseConfig> for DatabaseConfig
sourcefn eq(&self, other: &DatabaseConfig) -> bool
fn eq(&self, other: &DatabaseConfig) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &DatabaseConfig) -> bool
fn ne(&self, other: &DatabaseConfig) -> bool
This method tests for !=.
impl StructuralPartialEq for DatabaseConfig
Auto Trait Implementations
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more