#[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 from_url(url: &Url) -> Result<AnyConnectOptions, Error>
fn from_url(url: &Url) -> Result<AnyConnectOptions, Error>
Parse the
ConnectOptions
from a URL.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,
) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send + '_>>
fn connect( &self, ) -> Pin<Box<dyn Future<Output = Result<AnyConnection, Error>> + Send + '_>>
Establish a new database connection with the options specified by
self
.Sourceยงfn log_statements(self, level: LevelFilter) -> AnyConnectOptions
fn log_statements(self, level: LevelFilter) -> AnyConnectOptions
Log executed statements with the specified
level
Sourceยงfn log_slow_statements(
self,
level: LevelFilter,
duration: Duration,
) -> AnyConnectOptions
fn log_slow_statements( self, level: LevelFilter, duration: Duration, ) -> AnyConnectOptions
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
Sourceยงimpl FromStr for AnyConnectOptions
impl FromStr for AnyConnectOptions
Sourceยงimpl<'a> TryFrom<&'a AnyConnectOptions> for PgConnectOptions
impl<'a> TryFrom<&'a AnyConnectOptions> for PgConnectOptions
Sourceยงfn try_from(
value: &'a AnyConnectOptions,
) -> Result<PgConnectOptions, <PgConnectOptions as TryFrom<&'a AnyConnectOptions>>::Error>
fn try_from( value: &'a AnyConnectOptions, ) -> Result<PgConnectOptions, <PgConnectOptions as TryFrom<&'a AnyConnectOptions>>::Error>
Performs the conversion.
Sourceยงimpl<'a> TryFrom<&'a AnyConnectOptions> for SqliteConnectOptions
impl<'a> TryFrom<&'a AnyConnectOptions> for SqliteConnectOptions
Sourceยงfn try_from(
opts: &'a AnyConnectOptions,
) -> Result<SqliteConnectOptions, <SqliteConnectOptions as TryFrom<&'a AnyConnectOptions>>::Error>
fn try_from( opts: &'a AnyConnectOptions, ) -> Result<SqliteConnectOptions, <SqliteConnectOptions as TryFrom<&'a AnyConnectOptions>>::Error>
Performs the conversion.
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ยง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