use std::future::Future;
use futures_core::Stream;
use crate::client::{
GrantLease, GrantLeaseError, GrantLeaseResponse, KeepAliveError, KeepAliveResponse, LeaseTimeToLive,
LeaseTimeToLiveError, LeaseTimeToLiveResponse, Leases, LeasesError, LeasesResponse, RevokeLease, RevokeLeaseError,
RevokeLeaseResponse,
};
pub trait LeaseDriver {
type GrantFuture: Future<Output = Result<GrantLeaseResponse, GrantLeaseError>> + Send;
type RevokeFuture: Future<Output = Result<RevokeLeaseResponse, RevokeLeaseError>> + Send;
type TimeToLiveFuture<K>: Future<Output = Result<LeaseTimeToLiveResponse<K>, LeaseTimeToLiveError>> + Send;
type LeasesFuture: Future<Output = Result<LeasesResponse, LeasesError>> + Send;
type LeaseKeeper: Stream<Item = Result<KeepAliveResponse, KeepAliveError>> + Send;
fn execute_grant_lease(self, grant: GrantLease<()>) -> Self::GrantFuture;
fn execute_revoke_lease(self, revoke: RevokeLease<()>) -> Self::RevokeFuture;
fn execute_lease_time_to_live<K>(self, op: LeaseTimeToLive<(), K>) -> Self::TimeToLiveFuture<K>;
fn execute_leases(self, op: Leases<()>) -> Self::LeasesFuture;
fn start_lease_keeper(self) -> Self::LeaseKeeper;
}