use std::{future::Future, io::Result, time::Duration};
use libipld::Cid;
use crate::{account::MNSAccount, fs::IpldFS};
pub trait SyncClient {
type Sync<'cx>: Future<Output = Result<()>> + Send + Unpin + 'cx
where
Self: 'cx;
fn sync<'cx, 'a, FS: IpldFS>(
&'a mut self,
cid: Cid,
from: MNSAccount,
fs: &'cx mut FS,
) -> Self::Sync<'cx>
where
'a: 'cx;
}
pub trait SyncServer {
fn run_once<FS: IpldFS>(&mut self, fs: &mut FS, timeout: Duration) -> Result<()>;
}