pub struct DatabaseConfig {
id: DatabaseId,
is_primary: bool,
connection: Arc<dyn AnyDatabaseConnectionConfig>,
pool_min_size: Option<usize>,
pool_max_size: Option<usize>,
}Expand description
Defines a database to be used by Waveless
Fields§
§id: DatabaseIdUnique identifier of the database.
is_primary: boolIndicates whether this database is primary (no need to set database id on auth, session and role storage).
connection: Arc<dyn AnyDatabaseConnectionConfig>Defines credentials for all database backends.
pool_min_size: Option<usize>Defines the minimum number of simultaneous connections, by default this will be half the pool_max_size.
pool_max_size: Option<usize>Defines the maximum number of simultaneous connections, by default this will be twice the number of available cores.
Implementations§
Source§impl DatabaseConfig
impl DatabaseConfig
pub const fn new( id: DatabaseId, is_primary: bool, connection: Arc<dyn AnyDatabaseConnectionConfig>, pool_min_size: Option<usize>, pool_max_size: Option<usize>, ) -> DatabaseConfig
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub fn id(&self) -> &DatabaseId
pub fn id(&self) -> &DatabaseId
Unique identifier of the database.
Sourcepub fn is_primary(&self) -> &bool
pub fn is_primary(&self) -> &bool
Indicates whether this database is primary (no need to set database id on auth, session and role storage).
Sourcepub fn connection(&self) -> &Arc<dyn AnyDatabaseConnectionConfig>
pub fn connection(&self) -> &Arc<dyn AnyDatabaseConnectionConfig>
Defines credentials for all database backends.
Sourcepub fn pool_min_size(&self) -> &Option<usize>
pub fn pool_min_size(&self) -> &Option<usize>
Defines the minimum number of simultaneous connections, by default this will be half the pool_max_size.
Sourcepub fn pool_max_size(&self) -> &Option<usize>
pub fn pool_max_size(&self) -> &Option<usize>
Defines the maximum number of simultaneous connections, by default this will be twice the number of available cores.
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub fn id_mut(&mut self) -> &mut DatabaseId
pub fn id_mut(&mut self) -> &mut DatabaseId
Unique identifier of the database.
Sourcepub fn is_primary_mut(&mut self) -> &mut bool
pub fn is_primary_mut(&mut self) -> &mut bool
Indicates whether this database is primary (no need to set database id on auth, session and role storage).
Sourcepub fn connection_mut(&mut self) -> &mut Arc<dyn AnyDatabaseConnectionConfig>
pub fn connection_mut(&mut self) -> &mut Arc<dyn AnyDatabaseConnectionConfig>
Defines credentials for all database backends.
Sourcepub fn pool_min_size_mut(&mut self) -> &mut Option<usize>
pub fn pool_min_size_mut(&mut self) -> &mut Option<usize>
Defines the minimum number of simultaneous connections, by default this will be half the pool_max_size.
Sourcepub fn pool_max_size_mut(&mut self) -> &mut Option<usize>
pub fn pool_max_size_mut(&mut self) -> &mut Option<usize>
Defines the maximum number of simultaneous connections, by default this will be twice the number of available cores.
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl PartialEq for DatabaseConfig
impl PartialEq for DatabaseConfig
Auto Trait Implementations§
impl !RefUnwindSafe for DatabaseConfig
impl !UnwindSafe for DatabaseConfig
impl Freeze for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Decode for T
impl<T> Decode for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Encode for T
impl<T> Encode for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more