pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for constructing a DbkitConfig from individual parameters.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn backend(self, backend: Backend) -> Self
pub fn backend(self, backend: Backend) -> Self
Select the target backend. Defaults to Backend::Postgres.
pub fn host(self, host: &str) -> Self
pub fn port(self, port: u16) -> Self
pub fn database(self, database: &str) -> Self
pub fn user(self, user: &str) -> Self
pub fn password(self, password: &str) -> Self
pub fn pool_size(self, size: usize) -> Self
pub fn connect_timeout_secs(self, secs: u64) -> Self
pub fn idle_timeout_secs(self, secs: u64) -> Self
pub fn auto_create_db(self, enabled: bool) -> Self
pub fn ssl_mode(self, mode: SslMode) -> Self
Sourcepub fn build(self) -> DbkitConfig
pub fn build(self) -> DbkitConfig
Build the config, constructing the connection URL from parts.
For Backend::Sqlite the URL is sqlite://{database}, treating
database as a file path; host/port/auth/SSL are ignored. SQLite users
are usually better served by DbkitConfig::from_url.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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