pub trait HasConnectionString {
// Required method
fn connection_string(&self) -> String;
}Expand description
Trait for templates that can provide a connection string.
This trait is implemented by templates that represent services with connection endpoints (databases, caches, etc.).
Required Methods§
Sourcefn connection_string(&self) -> String
fn connection_string(&self) -> String
Returns the connection string/URL for connecting to the service.
The format depends on the service type:
- Redis:
redis://[password@]host:port - PostgreSQL:
postgresql://user:password@host:port/database - MySQL:
mysql://user:password@host:port/database - MongoDB:
mongodb://[user:password@]host:port[/database]