tank_core/connection.rs
1use crate::{Driver, Executor, Result, Transaction};
2use std::{borrow::Cow, future::Future};
3
4pub trait Connection: Executor {
5 /// Create a connection pool with at least one connection established to the given URL
6 fn connect(
7 url: Cow<'static, str>,
8 ) -> impl Future<Output = Result<<Self::Driver as Driver>::Connection>>;
9
10 fn begin(&mut self) -> impl Future<Output = Result<impl Transaction<'_>>>;
11}