remote_kvraft.rs 528 B

123456789101112131415161718192021
  1. use async_trait::async_trait;
  2. use crate::common::{
  3. CommitSentinelArgs, CommitSentinelReply, GetArgs, GetReply, PutAppendArgs,
  4. PutAppendReply,
  5. };
  6. #[async_trait]
  7. pub trait RemoteKvraft: Send + Sync + 'static {
  8. async fn get(&self, args: GetArgs) -> std::io::Result<GetReply>;
  9. async fn put_append(
  10. &self,
  11. args: PutAppendArgs,
  12. ) -> std::io::Result<PutAppendReply>;
  13. async fn commit_sentinel(
  14. &self,
  15. args: CommitSentinelArgs,
  16. ) -> std::io::Result<CommitSentinelReply>;
  17. }