use crate::backend::{self, Backend, Error};
use async_trait::async_trait;
use tokio::net::TcpStream;
pub struct TcpConnector {}
#[async_trait]
impl backend::Connector for TcpConnector {
type Connection = TcpStream;
async fn connect(&self, backend: &Backend) -> Result<Self::Connection, Error> {
TcpStream::connect(backend.address)
.await
.map_err(|e| e.into())
}
async fn is_valid(&self, _conn: &mut Self::Connection) -> Result<(), Error> {
Ok(())
}
}