|
|
@@ -68,14 +68,6 @@ pub struct PutAppendArgs {
|
|
|
pub unique_id: UniqueId,
|
|
|
}
|
|
|
|
|
|
-#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
-pub enum KVError {
|
|
|
- NotLeader,
|
|
|
- Expired,
|
|
|
- TimedOut,
|
|
|
- Conflict,
|
|
|
-}
|
|
|
-
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
pub struct PutAppendReply {
|
|
|
pub result: Result<(), KVError>,
|
|
|
@@ -105,6 +97,14 @@ pub struct KVRaftOptions {
|
|
|
pub max_retry: Option<usize>,
|
|
|
}
|
|
|
|
|
|
+#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
+pub enum KVError {
|
|
|
+ NotLeader,
|
|
|
+ Expired,
|
|
|
+ TimedOut,
|
|
|
+ Conflict,
|
|
|
+}
|
|
|
+
|
|
|
pub trait ValidReply {
|
|
|
fn is_reply_valid(&self) -> bool;
|
|
|
}
|