#[non_exhaustive]pub struct AnyConnectOptions {
pub database_url: Url,
pub log_settings: LogSettings,
}
Expand description
Opaque options for connecting to a database. These may only be constructed by parsing from a connection url.
postgres://postgres:password@localhost/database
mysql://root:password@localhost/database
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.database_url: Url
§log_settings: LogSettings
Trait Implementations§
source§impl Clone for AnyConnectOptions
impl Clone for AnyConnectOptions
source§fn clone(&self) -> AnyConnectOptions
fn clone(&self) -> AnyConnectOptions
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 ConnectOptions for AnyConnectOptions
impl ConnectOptions for AnyConnectOptions
type Connection = AnyConnection
source§fn to_url_lossy(&self) -> Url
fn to_url_lossy(&self) -> Url
Get a connection URL that may be used to connect to the same database as this
ConnectOptions
. Read moresource§fn connect(&self) -> BoxFuture<'_, Result<AnyConnection, Error>>
fn connect(&self) -> BoxFuture<'_, Result<AnyConnection, Error>>
Establish a new database connection with the options specified by
self
.source§fn log_statements(self, level: LevelFilter) -> Self
fn log_statements(self, level: LevelFilter) -> Self
Log executed statements with the specified
level
source§fn log_slow_statements(self, level: LevelFilter, duration: Duration) -> Self
fn log_slow_statements(self, level: LevelFilter, duration: Duration) -> Self
Log executed statements with a duration above the specified
duration
at the specified level
.source§fn disable_statement_logging(self) -> Self
fn disable_statement_logging(self) -> Self
Entirely disables statement logging (both slow and regular).
source§impl Debug for AnyConnectOptions
impl Debug for AnyConnectOptions
Auto Trait Implementations§
impl Freeze for AnyConnectOptions
impl RefUnwindSafe for AnyConnectOptions
impl Send for AnyConnectOptions
impl Sync for AnyConnectOptions
impl Unpin for AnyConnectOptions
impl UnwindSafe for AnyConnectOptions
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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