Struct rocket_contrib::databases::DatabaseConfig
source · pub struct DatabaseConfig<'a> {
pub url: &'a str,
pub pool_size: u32,
pub extras: BTreeMap<String, Value>,
}
Expand description
A structure representing a particular database configuration.
For the following configuration:
[global.databases.my_database]
url = "postgres://root:root@localhost/my_database"
pool_size = 10
certs = "sample_cert.pem"
key = "key.pem"
The following structure would be generated after calling
database_config
("my_database", &config)
:
ⓘ
DatabaseConfig {
url: "dummy_db.sqlite",
pool_size: 10,
extras: {
"certs": String("certs.pem"),
"key": String("key.pem"),
},
}
Fields§
§url: &'a str
The connection URL specified in the Rocket configuration.
pool_size: u32
The size of the pool to be initialized. Defaults to the number of Rocket workers.
extras: BTreeMap<String, Value>
Any extra options that are included in the configuration, excluding the url and pool_size.
Trait Implementations§
source§impl<'a> Clone for DatabaseConfig<'a>
impl<'a> Clone for DatabaseConfig<'a>
source§fn clone(&self) -> DatabaseConfig<'a>
fn clone(&self) -> DatabaseConfig<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for DatabaseConfig<'a>
impl<'a> Debug for DatabaseConfig<'a>
source§impl<'a> PartialEq for DatabaseConfig<'a>
impl<'a> PartialEq for DatabaseConfig<'a>
impl<'a> StructuralPartialEq for DatabaseConfig<'a>
Auto Trait Implementations§
impl<'a> Freeze for DatabaseConfig<'a>
impl<'a> RefUnwindSafe for DatabaseConfig<'a>
impl<'a> Send for DatabaseConfig<'a>
impl<'a> Sync for DatabaseConfig<'a>
impl<'a> Unpin for DatabaseConfig<'a>
impl<'a> UnwindSafe for DatabaseConfig<'a>
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more