use super::{
SyncBlobManifest, SyncBlobRegistration, SyncHistoryResponse, SyncPushRequest, SyncPushResponse,
SyncRepositoryPullResponse, SyncSnapshotRowPage, SyncTransportBounds, SyncTransportFuture,
};
#[allow(
dead_code,
reason = "the connected cache is read-only, while protocol transports retain authority write operations"
)]
pub trait SyncTransport: SyncTransportBounds {
fn active_account_id(&self) -> &str;
fn push<'a>(
&'a self,
request: &'a SyncPushRequest,
) -> SyncTransportFuture<'a, SyncPushResponse>;
fn pull(
&self,
after: Option<u64>,
limit: usize,
) -> SyncTransportFuture<'_, SyncRepositoryPullResponse>;
fn pull_now(
&self,
after: Option<u64>,
limit: usize,
) -> SyncTransportFuture<'_, SyncRepositoryPullResponse> {
self.pull(after, limit)
}
fn snapshot_rows<'a>(
&'a self,
branch_id: &'a str,
head_commit_id: &'a str,
continuation: Option<&'a str>,
limit: usize,
) -> SyncTransportFuture<'a, SyncSnapshotRowPage>;
fn history<'a>(
&'a self,
head: &'a str,
limit: usize,
) -> SyncTransportFuture<'a, SyncHistoryResponse>;
fn get_blobs<'a>(
&'a self,
blob_ids: &'a [String],
) -> SyncTransportFuture<'a, Vec<SyncBlobManifest>>;
fn register_blob<'a>(
&'a self,
manifest: &'a SyncBlobManifest,
) -> SyncTransportFuture<'a, SyncBlobRegistration>;
fn get_chunk<'a>(&'a self, chunk_id: &'a str) -> SyncTransportFuture<'a, Option<Vec<u8>>>;
fn put_chunk<'a>(&'a self, chunk_id: &'a str, bytes: &'a [u8]) -> SyncTransportFuture<'a, ()>;
}