pub struct DatabaseConfig {
pub backend: String,
pub memory: MemoryDatabaseConfig,
pub max_connections: u32,
pub min_connections: u32,
pub connect_timeout: Duration,
pub slow_query_threshold: Duration,
}Expand description
Config-driven database backend selection.
Fields§
§backend: StringBackend name looked up in an injected crate::DatabaseRegistry.
memory: MemoryDatabaseConfigIn-memory backend options.
max_connections: u32Maximum number of logical connections in the selected backend.
min_connections: u32Minimum number of idle logical connections to maintain.
connect_timeout: DurationTimeout for establishing a backend connection.
slow_query_threshold: DurationQueries slower than this threshold are reported by backends that support slow-query logging.
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Source§impl Default for DatabaseConfig
impl Default for DatabaseConfig
Source§impl<'de> Deserialize<'de> for DatabaseConfig
impl<'de> Deserialize<'de> for DatabaseConfig
Source§fn 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
Source§impl Serialize for DatabaseConfig
impl Serialize for DatabaseConfig
Source§impl Validate for DatabaseConfig
impl Validate for DatabaseConfig
Auto Trait Implementations§
impl Freeze for DatabaseConfig
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnsafeUnpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
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