Skip to main content

kdb_connection/
connection.rs

1use crate::prelude::*;
2
3mod private
4{
5    pub trait Connection {}
6}
7
8pub(crate) use private::Connection as ConnectionPrivate;
9
10/// Base trait for kDB Connection
11pub trait Connection: ConnectionPrivate + Clone + Sync + Send
12{
13    fn is_connected(&self) -> impl std::future::Future<Output = bool>;
14    fn execute_query<TQuery>(
15        &self,
16        query: TQuery,
17    ) -> Result<impl std::future::Future<Output = Result<dbc::Result>>>
18    where
19        TQuery: TryInto<dbc::Query>,
20        crate::Error: From<<TQuery as TryInto<dbc::Query>>::Error>;
21}