mod http;
pub use self::http::{HttpApiClient, HttpApiClientError};
use xaynet_core::{
common::RoundParameters,
mask::Model,
SumDict,
SumParticipantPublicKey,
UpdateSeedDict,
};
#[async_trait]
pub trait ApiClient {
type Error: ::std::fmt::Debug + ::std::error::Error + 'static;
async fn get_round_params(&mut self) -> Result<RoundParameters, Self::Error>;
async fn get_sums(&mut self) -> Result<Option<SumDict>, Self::Error>;
async fn get_seeds(
&mut self,
pk: SumParticipantPublicKey,
) -> Result<Option<UpdateSeedDict>, Self::Error>;
async fn get_mask_length(&mut self) -> Result<Option<u64>, Self::Error>;
async fn get_model(&mut self) -> Result<Option<Model>, Self::Error>;
async fn send_message(&mut self, msg: Vec<u8>) -> Result<(), Self::Error>;
}