doublecrypt_core/
proto.rs1#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct Request {
24 #[prost(uint64, tag = "1")]
25 pub request_id: u64,
26 #[prost(oneof = "request::Command", tags = "2, 3, 4, 5")]
27 pub command: ::core::option::Option<request::Command>,
28}
29
30pub mod request {
31 #[derive(Clone, PartialEq, ::prost::Oneof)]
32 pub enum Command {
33 #[prost(message, tag = "2")]
34 ReadBlock(super::ReadBlockRequest),
35 #[prost(message, tag = "3")]
36 WriteBlock(super::WriteBlockRequest),
37 #[prost(message, tag = "4")]
38 Sync(super::SyncRequest),
39 #[prost(message, tag = "5")]
40 GetInfo(super::GetInfoRequest),
41 }
42}
43
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct ReadBlockRequest {
46 #[prost(uint64, tag = "1")]
47 pub block_id: u64,
48}
49
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct WriteBlockRequest {
52 #[prost(uint64, tag = "1")]
53 pub block_id: u64,
54 #[prost(bytes = "vec", tag = "2")]
55 pub data: Vec<u8>,
56}
57
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct SyncRequest {}
60
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct GetInfoRequest {}
63
64#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct Response {
68 #[prost(uint64, tag = "1")]
69 pub request_id: u64,
70 #[prost(oneof = "response::Result", tags = "2, 3, 4, 5, 6")]
71 pub result: ::core::option::Option<response::Result>,
72}
73
74pub mod response {
75 #[derive(Clone, PartialEq, ::prost::Oneof)]
76 pub enum Result {
77 #[prost(message, tag = "2")]
78 ReadBlock(super::ReadBlockResponse),
79 #[prost(message, tag = "3")]
80 WriteBlock(super::WriteBlockResponse),
81 #[prost(message, tag = "4")]
82 Sync(super::SyncResponse),
83 #[prost(message, tag = "5")]
84 GetInfo(super::GetInfoResponse),
85 #[prost(message, tag = "6")]
86 Error(super::ErrorResponse),
87 }
88}
89
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct ReadBlockResponse {
92 #[prost(bytes = "vec", tag = "1")]
93 pub data: Vec<u8>,
94}
95
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct WriteBlockResponse {}
98
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct SyncResponse {}
101
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct GetInfoResponse {
104 #[prost(uint32, tag = "1")]
105 pub block_size: u32,
106 #[prost(uint64, tag = "2")]
107 pub total_blocks: u64,
108}
109
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct ErrorResponse {
112 #[prost(int32, tag = "1")]
113 pub code: i32,
114 #[prost(string, tag = "2")]
115 pub message: String,
116}