1use crate::core::{
2 ring::Digest,
3 Node,
4 data_store::{Key, Value}
5};
6
7#[tarpc::service]
8pub trait NodeService {
9 async fn get_node_rpc() -> Node;
11 async fn get_predecessor_rpc() -> Option<Node>;
12 async fn get_successor_rpc() -> Node;
13 async fn get_successor_list_rpc() -> Vec<Node>;
14
15 async fn find_successor_list_rpc(id: Digest) -> Vec<Node>;
17 async fn find_predecessor_rpc(id: Digest) -> Node;
18 async fn closest_preceding_finger_rpc(id: Digest) -> Node;
19 async fn notify_rpc(node: Node);
20 async fn stabilize_rpc();
21
22 async fn get_local_rpc(key: Key) -> Option<Value>;
24 async fn set_local_rpc(key: Key, value: Option<Value>);
25
26 async fn get_rpc(key: Key) -> Option<Value>;
28 async fn set_rpc(key: Key, value: Option<Value>);
29
30 async fn replicate_rpc(key: Key, value: Option<Value>);
32}