Skip to main content

DatabaseUrl

Trait DatabaseUrl 

Source
pub trait DatabaseUrl {
    // Required methods
    fn to_url(&self) -> String;
    fn db_type(&self) -> &'static str;
}
Available on crate feature database only.
Expand description

Trait for database connection URL builders.

Required Methods§

Source

fn to_url(&self) -> String

Build the connection URL string.

Password is included in the URL – use .to_url() only for passing to database drivers, never for logging. Use Display for safe output.

Source

fn db_type(&self) -> &'static str

The database type name (for logging/metrics).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§