pub struct DatabaseConfig {
pub max_connections: u32,
pub pool_size: u32,
pub url: DatabaseLink,
}Fields§
§max_connections: u32§pool_size: u32§url: DatabaseLinkImplementations§
Source§impl DatabaseConfig
impl DatabaseConfig
pub fn new() -> Self
Sourcepub const fn max_connections(&self) -> u32
pub const fn max_connections(&self) -> u32
returns the maximum number of connections
Sourcepub fn url(&self) -> DatabaseUrl
pub fn url(&self) -> DatabaseUrl
returns a reference to the database url
Sourcepub fn with_max_connections(self, max_connections: u32) -> Self
pub fn with_max_connections(self, max_connections: u32) -> Self
consumes the instance to create another with the given maximum number of connections
Sourcepub fn with_pool_size(self, pool_size: u32) -> Self
pub fn with_pool_size(self, pool_size: u32) -> Self
consumes the instance to create another with the given pool size
pub fn with_url(self, url: DatabaseLink) -> Self
Sourcepub fn set_max_connections(&mut self, max_connections: u32)
pub fn set_max_connections(&mut self, max_connections: u32)
update the configured maximum number of connections
Sourcepub fn set_pool_size(&mut self, pool_size: u32)
pub fn set_pool_size(&mut self, pool_size: u32)
update the pool size for the database
Sourcepub fn set_url(&mut self, url: DatabaseLink)
pub fn set_url(&mut self, url: DatabaseLink)
update the database url
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 · 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 DatabaseConfigwhere
DatabaseConfig: Default,
impl<'de> Deserialize<'de> for DatabaseConfigwhere
DatabaseConfig: Default,
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 Display for DatabaseConfig
impl Display for DatabaseConfig
Source§impl Hash for DatabaseConfig
impl Hash for DatabaseConfig
Source§impl Ord for DatabaseConfig
impl Ord for DatabaseConfig
Source§fn cmp(&self, other: &DatabaseConfig) -> Ordering
fn cmp(&self, other: &DatabaseConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DatabaseConfig
impl PartialEq for DatabaseConfig
Source§impl PartialOrd for DatabaseConfig
impl PartialOrd for DatabaseConfig
Source§impl Serialize for DatabaseConfig
impl Serialize for DatabaseConfig
impl Eq for DatabaseConfig
impl StructuralPartialEq 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 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