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