diff --git a/Makefile b/Makefile
index 3d0e996..4450130 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-PROTOC_GEN_TS_PATH=${HOME}/npm_modules/bin/protoc-gen-ts
+PROTOC_GEN_TS_PATH=${HOME}/.npm_modules/bin/protoc-gen-ts
.PHONY: proto
proto: proto-gen tidy
@@ -59,6 +59,8 @@ install:
npm install -g grpc-tools
python3 -m pip install grpcio-tools
bash .script/protoc-js.sh
+ cargo install protobuf-codegen
+ cargo install grpcio-compiler
# protocol buffer generation targets
@@ -98,6 +100,14 @@ gen-file:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/file.proto
+ # generate rust bindings (file)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/file.proto
gen-util:
# generate golang bindings (util)
@@ -134,6 +144,15 @@ gen-util:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/util.proto
+ # generate rust bindings (util)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/util.proto
+
gen-node:
# generate golang bindings (node)
@@ -156,7 +175,7 @@ gen-node:
-I=${GOPATH}/src \
--ts_out=service=grpc-web:ts \
pb/node.proto
- # generate javascript bindings (dag)
+ # generate javascript bindings (node)
protoc \
-I=pb \
-I=${GOPATH}/src \
@@ -171,6 +190,15 @@ gen-node:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/node.proto
+ # generate rust bindings (node)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/node.proto
+
gen-status:
# generate golang bindings (status)
@@ -208,6 +236,15 @@ gen-status:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/status.proto
+ # generate rust bindings (status)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/status.proto
+
gen-pubsub:
# generate golang bindings (pubsub)
@@ -245,6 +282,14 @@ gen-pubsub:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/pubsub.proto
+ # generate rust bindings (pubsub)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/pubsub.proto
gen-admin:
# generate golang bindings (admin)
@@ -282,6 +327,14 @@ gen-admin:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/admin.proto
+ # generate rust bindings (admin)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/admin.proto
gen-namesys:
# generate golang bindings (namesys)
@@ -318,6 +371,14 @@ gen-namesys:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/namesys.proto
+ # generate rust bindings (namesys)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/namesys.proto
gen-replication:
# generate golang bindings (replication)
@@ -355,6 +416,14 @@ gen-replication:
--plugin=protoc-gen-grpc-java=build/protoc-gen-grpc-java \
--grpc-java_out=java \
pb/replication.proto
+ # generate rust bindings (replication)
+ protoc \
+ -I=pb \
+ -I=${GOPATH}/src \
+ --rust_out=rs/src \
+ --grpc_out=rs/src \
+ --plugin=protoc-gen-grpc=`which grpc_rust_plugin` \
+ pb/replication.proto
gen-docs:
# generate documentation
diff --git a/README.md b/README.md
index 362f08b..a6161d8 100644
--- a/README.md
+++ b/README.md
@@ -5,10 +5,12 @@
We have pre-generated gRPC bindings for the following languages:
* [golang](https://github.com/RTradeLtd/TxPB/tree/master/go)
-* [javascript (grpc-web)](https://github.com/RTradeLtd/TxPB/tree/master/js)
+* [javascript (nodejs)](https://github.com/RTradeLtd/TxPB/tree/master/js)
* [typescript (grpc-web)](https://github.com/RTradeLtd/TxPB/tree/master/ts)
* [java](https://github.com/RTradeLtd/TxPB/tree/master/java/pb)
* [python](https://github.com/RTradeLtd/TxPB/tree/master/py)
+* [python](https://github.com/RTradeLtd/TxPB/tree/master/py)
+* [rust](https://github.com/RTradeLtd/TxPB/tree/master/rs/src)
If you want bindings in other languages, feel free to open a github issue. Alternatively you can generate language bindings independently as long as the languages you are using support the appropriate protocol buffer and gRPC versions.
@@ -24,6 +26,10 @@ If you want bindings in other languages, feel free to open a github issue. Alter
* [TemporalX HTTP Gateway](./doc/GATEWAY.md)
* [Benchmarks](./doc/BENCHMARKS.md)
+# Examples
+
+We have an ever growing library of examples that will help you get started with TemporalX. For all code examples see the `examples` folder.
+
# Code Generation
Before generating the code, you'll need to download quite a few generators. Before downloading the generators you'll need to have a valid installation of the following, please consult appropriate installation manuals as required:
diff --git a/doc/CONFIGURATION.md b/doc/CONFIGURATION.md
index da6f21a..2a75ca4 100644
--- a/doc/CONFIGURATION.md
+++ b/doc/CONFIGURATION.md
@@ -319,7 +319,7 @@ enabled | true | whether or not replication is enabl
database_location | vstorage/replication/db.sqlite | Location of the SQL database to keep track of replications. |
grpc_port | 9094 | A dedicated TCP port for replication protocol. |
white_list_location | storage/replication/publishers | Location to a collection of peer public keys that are allowed to replicate on this server. The file format is raw protobuf as defined in github.com/libp2p/go-libp2p-core/crypto |
-replication|delay | 10m | ReplicationDelay is the time between two replication runs. Uses golang time.Duration string types |
+replication_delay | 10m | ReplicationDelay is the time between two replication runs. Uses golang time.Duration string types |
## Storage
The `storage` section is used to configure the main storage layer of our node. It consists of a generic `datastore` with a `blockstore` on top, and is primarily used for storing our "data" (files, etc..). It also enables managing of blocks using a novel reference count system, as opposed to a pinning system.
diff --git a/doc/PROTO.md b/doc/PROTO.md
index ce6008f..7685e9e 100644
--- a/doc/PROTO.md
+++ b/doc/PROTO.md
@@ -1394,21 +1394,21 @@ PutResponse is a response to any data storage (put) requests
## Scalar Value Types
-| .proto Type | Notes | C++ Type | Java Type | Python Type |
-| ----------- | ----- | -------- | --------- | ----------- |
-| double | | double | double | float |
-| float | | float | float | float |
-| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int |
-| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long |
-| uint32 | Uses variable-length encoding. | uint32 | int | int/long |
-| uint64 | Uses variable-length encoding. | uint64 | long | int/long |
-| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int |
-| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long |
-| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int |
-| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long |
-| sfixed32 | Always four bytes. | int32 | int | int |
-| sfixed64 | Always eight bytes. | int64 | long | int/long |
-| bool | | bool | boolean | boolean |
-| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode |
-| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str |
+| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
+| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
+| double | | double | double | float | float64 | double | float | Float |
+| float | | float | float | float | float32 | float | float | Float |
+| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
+| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
+| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
+| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
+| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
+| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
+| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
+| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
+| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
+| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
+| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
+| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
+| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |
diff --git a/examples/go/main.go b/examples/go/main.go
new file mode 100644
index 0000000..d92b9de
--- /dev/null
+++ b/examples/go/main.go
@@ -0,0 +1,84 @@
+package main
+
+import (
+ "context"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "log"
+ "os"
+
+ pb "github.com/RTradeLtd/TxPB/v3/go"
+ "google.golang.org/grpc"
+)
+
+var (
+ xAPI = "xapi.temporal.cloud:9090"
+)
+
+func main() {
+ conn, err := grpc.Dial(xAPI, grpc.WithInsecure())
+ if err != nil {
+ log.Fatal(err)
+ }
+ nc := pb.NewNodeAPIClient(conn)
+ fc := pb.NewFileAPIClient(conn)
+ resp, err := nc.Dag(context.Background(), &pb.DagRequest{
+ RequestType: pb.DAGREQTYPE_DAG_PUT,
+ Data: []byte("hello world this is test data"),
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("dag put hash: %s\n", resp.GetHashes()[0])
+ hash := uploadFile(fc)
+ fmt.Printf("upload file hash: %s\n", hash)
+ resp, err = nc.Dag(context.Background(), &pb.DagRequest{
+ RequestType: pb.DAGREQTYPE_DAG_GET_LINKS,
+ Hash: hash,
+ })
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("number of links: %v\n", len(resp.GetLinks()))
+}
+
+func uploadFile(nc pb.FileAPIClient) string {
+ defer os.Remove("justsometestdata")
+ if err := ioutil.WriteFile("justsometestdata", []byte("hello world"), os.FileMode(0640)); err != nil {
+ log.Fatal(err)
+ }
+ stream, err := nc.UploadFile(context.Background())
+ if err != nil {
+ log.Fatal(err)
+ }
+ file, err := os.Open("justsometestdata")
+ if err != nil {
+ log.Fatal(err)
+ }
+ // declare file options
+ if err := stream.Send(&pb.UploadRequest{Options: &pb.UploadOptions{MultiHash: "sha2-256", Chunker: "size-1"}}); err != nil {
+ log.Fatal(err)
+ }
+ // upload file - chunked at 5mb each
+ buf := make([]byte, 4194294)
+ for {
+ n, err := file.Read(buf)
+ if err != nil && err == io.EOF {
+ // only break if we haven't read any bytes, otherwise exit
+ if n == 0 {
+ break
+ }
+ } else if err != nil && err != io.EOF {
+ log.Fatal(err)
+ }
+ if err := stream.Send(&pb.UploadRequest{Blob: &pb.Blob{Content: buf[:n]}}); err != nil {
+ log.Fatal(err)
+ }
+ }
+ resp, err := stream.CloseAndRecv()
+ if err != nil {
+ log.Fatal(err)
+ }
+ return resp.GetHash()
+}
diff --git a/examples/js/README.md b/examples/js/README.md
new file mode 100644
index 0000000..61bd1cc
--- /dev/null
+++ b/examples/js/README.md
@@ -0,0 +1,10 @@
+# js
+
+To run these examples you'll need to install the following packages:
+
+```shell
+$> npm install grpc
+$> npm install google-protobuf
+```
+
+To actually run you can do `node index.js`
\ No newline at end of file
diff --git a/examples/js/index.js b/examples/js/index.js
new file mode 100644
index 0000000..ff4d1d1
--- /dev/null
+++ b/examples/js/index.js
@@ -0,0 +1,33 @@
+var services = require('../../js/node_grpc_pb');
+var messages = require('../../js/node_pb');
+var grpc = require('grpc');
+
+function main() {
+ var client = new services.NodeAPIClient(
+ 'xapi.temporal.cloud:9090',
+ grpc.credentials.createInsecure()
+ );
+ var request = new messages.DagRequest()
+ request.RequestType = messages.DAG_PUT;
+ request.Data = "hello world";
+ client.dag(request, function(err, response) {
+ if (err) {
+ console.error("failed to put dag", err);
+ return;
+ }
+ response.array.forEach(element => {
+ if (element === undefined) {
+ return
+ }
+ element.forEach(ele => {
+ if (ele === undefined) {
+ return
+ }
+ console.log("hash " + ele);
+ })
+ });
+ })
+
+}
+
+main();
\ No newline at end of file
diff --git a/examples/py/README.md b/examples/py/README.md
new file mode 100644
index 0000000..7bb07b2
--- /dev/null
+++ b/examples/py/README.md
@@ -0,0 +1,10 @@
+# Python Example
+
+To run this you will want to make sure the appropriate files are in the directory:
+
+```shell
+$> cp ../../py/util_pb2.py .
+$> cp ../../py/node_pb2* .
+```
+
+After which you can run the example with `python3 main.py` (assuming you have the appropriate grpc dependencies installed)
diff --git a/examples/py/main.py b/examples/py/main.py
new file mode 100644
index 0000000..e4705cf
--- /dev/null
+++ b/examples/py/main.py
@@ -0,0 +1,9 @@
+import grpc
+import node_pb2_grpc
+import node_pb2
+
+channel = grpc.insecure_channel('xapi.temporal.cloud:9090')
+s = node_pb2_grpc.NodeAPIStub(channel)
+resp = s.Dag(node_pb2.DagRequest(requestType=node_pb2.DAG_PUT, data=bytes(0)))
+
+print(resp)
\ No newline at end of file
diff --git a/examples/ts/README.md b/examples/ts/README.md
new file mode 100644
index 0000000..adf57fe
--- /dev/null
+++ b/examples/ts/README.md
@@ -0,0 +1,19 @@
+# ts
+
+To run this you'll need to install the following dependencies
+
+```shell
+$> npm install grpc
+$> npm install google-protobuf
+$> npm install @improbable-eng/grpc-web
+$> npm install -g typescript
+```
+
+To compile typescript to javascript run `tsc index.ts` and you can then run the example with `node index.js`
+
+On some machines the above may cause an error and I'm not exactly sure why. To fix this you can change the `messages` and `services` import to the following:
+
+```
+var messages = require("../../js/node_pb");
+var services = require("../../js/node_grpc_pb");
+```
\ No newline at end of file
diff --git a/examples/ts/index.js b/examples/ts/index.js
new file mode 100644
index 0000000..0c71c95
--- /dev/null
+++ b/examples/ts/index.js
@@ -0,0 +1,24 @@
+"use strict";
+exports.__esModule = true;
+var messages = require("../../ts/node_pb");
+var services = require("../../ts/node_pb_service");
+var grpc = require('grpc');
+function main() {
+ var client = new services.NodeAPIClient('xapi.temporal.cloud:9090', grpc.credentials.createInsecure());
+ var request = new messages.DagRequest();
+ request.setRequesttype(messages.DAGREQTYPE.DAG_PUT);
+ request.setData("hello world");
+ client.dag(request, function (err, response) {
+ if (err) {
+ console.error("failed to put dag", err);
+ return;
+ }
+ response.getHashesList().forEach(function (element) {
+ if (element === undefined) {
+ return;
+ }
+ console.log(element);
+ });
+ });
+}
+main();
diff --git a/examples/ts/index.ts b/examples/ts/index.ts
new file mode 100644
index 0000000..1795fde
--- /dev/null
+++ b/examples/ts/index.ts
@@ -0,0 +1,26 @@
+import * as messages from "../../ts/node_pb";
+import * as services from "../../ts/node_pb_service";
+var grpc = require('grpc');
+function main() {
+ var client = new services.NodeAPIClient(
+ 'xapi.temporal.cloud:9090',
+ grpc.credentials.createInsecure(),
+ );
+ var request = new messages.DagRequest()
+ request.setRequesttype(messages.DAGREQTYPE.DAG_PUT);
+ request.setData("hello world");
+ client.dag(request, function(err, response) {
+ if (err) {
+ console.error("failed to put dag", err);
+ return;
+ }
+ response.getHashesList().forEach(element => {
+ if (element === undefined) {
+ return
+ }
+ console.log(element)
+ });
+ })
+}
+
+main();
\ No newline at end of file
diff --git a/rs/Cargo.lock b/rs/Cargo.lock
new file mode 100644
index 0000000..efbed38
--- /dev/null
+++ b/rs/Cargo.lock
@@ -0,0 +1,87 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "cc"
+version = "1.0.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
+
+[[package]]
+name = "cfg-if"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+
+[[package]]
+name = "cmake"
+version = "0.1.42"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "futures"
+version = "0.1.29"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
+
+[[package]]
+name = "grpcio"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ac757a85603e4f8c40a9f94be06a5ad412acab80b39b4e8895ca931b6619910"
+dependencies = [
+ "futures",
+ "grpcio-sys",
+ "libc",
+ "log",
+ "protobuf",
+]
+
+[[package]]
+name = "grpcio-sys"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b2f22fb0327f153acccedbe91894dd0fb15bb6f202d8195665cd206af0402b0"
+dependencies = [
+ "cc",
+ "cmake",
+ "libc",
+ "pkg-config",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.68"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"
+
+[[package]]
+name = "log"
+version = "0.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "pkg-config"
+version = "0.3.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
+
+[[package]]
+name = "protobuf"
+version = "2.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37a5325d019a4d837d3abde0a836920f959e33d350f77b5f1e289e061e774942"
+
+[[package]]
+name = "txpb"
+version = "3.1.1"
+dependencies = [
+ "grpcio",
+]
diff --git a/rs/Cargo.toml b/rs/Cargo.toml
new file mode 100644
index 0000000..6753761
--- /dev/null
+++ b/rs/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "txpb"
+version = "3.1.1"
+authors = ["postables "]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+grpcio = "0.4"
\ No newline at end of file
diff --git a/rs/src/admin.rs b/rs/src/admin.rs
new file mode 100644
index 0000000..ee9b2b6
--- /dev/null
+++ b/rs/src/admin.rs
@@ -0,0 +1,990 @@
+// This file is generated by rust-protobuf 2.10.2. Do not edit
+// @generated
+
+// https://github.com/rust-lang/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unsafe_code)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+//! Generated file from `admin.proto`
+
+use protobuf::Message as Message_imported_for_functions;
+use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
+
+/// Generated files are compatible only with the same version
+/// of protobuf runtime.
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_10_2;
+
+#[derive(PartialEq,Clone,Default)]
+pub struct ManageGCRequest {
+ // message fields
+ pub field_type: GCREQTYPE,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a ManageGCRequest {
+ fn default() -> &'a ManageGCRequest {
+ ::default_instance()
+ }
+}
+
+impl ManageGCRequest {
+ pub fn new() -> ManageGCRequest {
+ ::std::default::Default::default()
+ }
+
+ // .pb.GCREQTYPE type = 1;
+
+
+ pub fn get_field_type(&self) -> GCREQTYPE {
+ self.field_type
+ }
+ pub fn clear_field_type(&mut self) {
+ self.field_type = GCREQTYPE::GC_START;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_field_type(&mut self, v: GCREQTYPE) {
+ self.field_type = v;
+ }
+}
+
+impl ::protobuf::Message for ManageGCRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 1, &mut self.unknown_fields)?
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.field_type != GCREQTYPE::GC_START {
+ my_size += ::protobuf::rt::enum_size(1, self.field_type);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.field_type != GCREQTYPE::GC_START {
+ os.write_enum(1, self.field_type.value())?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> ManageGCRequest {
+ ManageGCRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "type",
+ |m: &ManageGCRequest| { &m.field_type },
+ |m: &mut ManageGCRequest| { &mut m.field_type },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "ManageGCRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static ManageGCRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ManageGCRequest,
+ };
+ unsafe {
+ instance.get(ManageGCRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for ManageGCRequest {
+ fn clear(&mut self) {
+ self.field_type = GCREQTYPE::GC_START;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for ManageGCRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ManageGCRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct ManageGCResponse {
+ // message fields
+ pub status: ::std::string::String,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a ManageGCResponse {
+ fn default() -> &'a ManageGCResponse {
+ ::default_instance()
+ }
+}
+
+impl ManageGCResponse {
+ pub fn new() -> ManageGCResponse {
+ ::std::default::Default::default()
+ }
+
+ // string status = 1;
+
+
+ pub fn get_status(&self) -> &str {
+ &self.status
+ }
+ pub fn clear_status(&mut self) {
+ self.status.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_status(&mut self, v: ::std::string::String) {
+ self.status = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_status(&mut self) -> &mut ::std::string::String {
+ &mut self.status
+ }
+
+ // Take field
+ pub fn take_status(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.status, ::std::string::String::new())
+ }
+}
+
+impl ::protobuf::Message for ManageGCResponse {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.status)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.status.is_empty() {
+ my_size += ::protobuf::rt::string_size(1, &self.status);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.status.is_empty() {
+ os.write_string(1, &self.status)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> ManageGCResponse {
+ ManageGCResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "status",
+ |m: &ManageGCResponse| { &m.status },
+ |m: &mut ManageGCResponse| { &mut m.status },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "ManageGCResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static ManageGCResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ManageGCResponse,
+ };
+ unsafe {
+ instance.get(ManageGCResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for ManageGCResponse {
+ fn clear(&mut self) {
+ self.status.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for ManageGCResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ManageGCResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct RefCountRequest {
+ // message fields
+ pub cids: ::protobuf::RepeatedField<::std::string::String>,
+ pub limit: i64,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a RefCountRequest {
+ fn default() -> &'a RefCountRequest {
+ ::default_instance()
+ }
+}
+
+impl RefCountRequest {
+ pub fn new() -> RefCountRequest {
+ ::std::default::Default::default()
+ }
+
+ // repeated string cids = 1;
+
+
+ pub fn get_cids(&self) -> &[::std::string::String] {
+ &self.cids
+ }
+ pub fn clear_cids(&mut self) {
+ self.cids.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_cids(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.cids = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_cids(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.cids
+ }
+
+ // Take field
+ pub fn take_cids(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.cids, ::protobuf::RepeatedField::new())
+ }
+
+ // int64 limit = 2;
+
+
+ pub fn get_limit(&self) -> i64 {
+ self.limit
+ }
+ pub fn clear_limit(&mut self) {
+ self.limit = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_limit(&mut self, v: i64) {
+ self.limit = v;
+ }
+}
+
+impl ::protobuf::Message for RefCountRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.cids)?;
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int64()?;
+ self.limit = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ for value in &self.cids {
+ my_size += ::protobuf::rt::string_size(1, &value);
+ };
+ if self.limit != 0 {
+ my_size += ::protobuf::rt::value_size(2, self.limit, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ for v in &self.cids {
+ os.write_string(1, &v)?;
+ };
+ if self.limit != 0 {
+ os.write_int64(2, self.limit)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> RefCountRequest {
+ RefCountRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "cids",
+ |m: &RefCountRequest| { &m.cids },
+ |m: &mut RefCountRequest| { &mut m.cids },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
+ "limit",
+ |m: &RefCountRequest| { &m.limit },
+ |m: &mut RefCountRequest| { &mut m.limit },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "RefCountRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static RefCountRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const RefCountRequest,
+ };
+ unsafe {
+ instance.get(RefCountRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for RefCountRequest {
+ fn clear(&mut self) {
+ self.cids.clear();
+ self.limit = 0;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for RefCountRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for RefCountRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct RefCountResponse {
+ // message fields
+ pub cids: ::std::collections::HashMap<::std::string::String, i64>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a RefCountResponse {
+ fn default() -> &'a RefCountResponse {
+ ::default_instance()
+ }
+}
+
+impl RefCountResponse {
+ pub fn new() -> RefCountResponse {
+ ::std::default::Default::default()
+ }
+
+ // repeated .pb.RefCountResponse.CidsEntry cids = 1;
+
+
+ pub fn get_cids(&self) -> &::std::collections::HashMap<::std::string::String, i64> {
+ &self.cids
+ }
+ pub fn clear_cids(&mut self) {
+ self.cids.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_cids(&mut self, v: ::std::collections::HashMap<::std::string::String, i64>) {
+ self.cids = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_cids(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, i64> {
+ &mut self.cids
+ }
+
+ // Take field
+ pub fn take_cids(&mut self) -> ::std::collections::HashMap<::std::string::String, i64> {
+ ::std::mem::replace(&mut self.cids, ::std::collections::HashMap::new())
+ }
+}
+
+impl ::protobuf::Message for RefCountResponse {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeInt64>(wire_type, is, &mut self.cids)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeInt64>(1, &self.cids);
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeInt64>(1, &self.cids, os)?;
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> RefCountResponse {
+ RefCountResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeInt64>(
+ "cids",
+ |m: &RefCountResponse| { &m.cids },
+ |m: &mut RefCountResponse| { &mut m.cids },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "RefCountResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static RefCountResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const RefCountResponse,
+ };
+ unsafe {
+ instance.get(RefCountResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for RefCountResponse {
+ fn clear(&mut self) {
+ self.cids.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for RefCountResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for RefCountResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(Clone,PartialEq,Eq,Debug,Hash)]
+pub enum GCREQTYPE {
+ GC_START = 0,
+ GC_STOP = 1,
+ GC_STATUS = 2,
+}
+
+impl ::protobuf::ProtobufEnum for GCREQTYPE {
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option {
+ match value {
+ 0 => ::std::option::Option::Some(GCREQTYPE::GC_START),
+ 1 => ::std::option::Option::Some(GCREQTYPE::GC_STOP),
+ 2 => ::std::option::Option::Some(GCREQTYPE::GC_STATUS),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn values() -> &'static [Self] {
+ static values: &'static [GCREQTYPE] = &[
+ GCREQTYPE::GC_START,
+ GCREQTYPE::GC_STOP,
+ GCREQTYPE::GC_STATUS,
+ ];
+ values
+ }
+
+ fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ ::protobuf::reflect::EnumDescriptor::new("GCREQTYPE", file_descriptor_proto())
+ })
+ }
+ }
+}
+
+impl ::std::marker::Copy for GCREQTYPE {
+}
+
+impl ::std::default::Default for GCREQTYPE {
+ fn default() -> Self {
+ GCREQTYPE::GC_START
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for GCREQTYPE {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
+ }
+}
+
+#[derive(Clone,PartialEq,Eq,Debug,Hash)]
+pub enum REFREQTYPE {
+ REF_GET_COUNT = 0,
+ REF_DELETE = 1,
+}
+
+impl ::protobuf::ProtobufEnum for REFREQTYPE {
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option {
+ match value {
+ 0 => ::std::option::Option::Some(REFREQTYPE::REF_GET_COUNT),
+ 1 => ::std::option::Option::Some(REFREQTYPE::REF_DELETE),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn values() -> &'static [Self] {
+ static values: &'static [REFREQTYPE] = &[
+ REFREQTYPE::REF_GET_COUNT,
+ REFREQTYPE::REF_DELETE,
+ ];
+ values
+ }
+
+ fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ ::protobuf::reflect::EnumDescriptor::new("REFREQTYPE", file_descriptor_proto())
+ })
+ }
+ }
+}
+
+impl ::std::marker::Copy for REFREQTYPE {
+}
+
+impl ::std::default::Default for REFREQTYPE {
+ fn default() -> Self {
+ REFREQTYPE::REF_GET_COUNT
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for REFREQTYPE {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
+ }
+}
+
+#[derive(Clone,PartialEq,Eq,Debug,Hash)]
+pub enum REFREQOPTS {
+ REF_FORCE = 0,
+}
+
+impl ::protobuf::ProtobufEnum for REFREQOPTS {
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option {
+ match value {
+ 0 => ::std::option::Option::Some(REFREQOPTS::REF_FORCE),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn values() -> &'static [Self] {
+ static values: &'static [REFREQOPTS] = &[
+ REFREQOPTS::REF_FORCE,
+ ];
+ values
+ }
+
+ fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::EnumDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ ::protobuf::reflect::EnumDescriptor::new("REFREQOPTS", file_descriptor_proto())
+ })
+ }
+ }
+}
+
+impl ::std::marker::Copy for REFREQOPTS {
+}
+
+impl ::std::default::Default for REFREQOPTS {
+ fn default() -> Self {
+ REFREQOPTS::REF_FORCE
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for REFREQOPTS {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor())
+ }
+}
+
+static file_descriptor_proto_data: &'static [u8] = b"\
+ \n\x0badmin.proto\x12\x02pb\"4\n\x0fManageGCRequest\x12!\n\x04type\x18\
+ \x01\x20\x01(\x0e2\r.pb.GCREQTYPER\x04type\"*\n\x10ManageGCResponse\x12\
+ \x16\n\x06status\x18\x01\x20\x01(\tR\x06status\";\n\x0fRefCountRequest\
+ \x12\x12\n\x04cids\x18\x01\x20\x03(\tR\x04cids\x12\x14\n\x05limit\x18\
+ \x02\x20\x01(\x03R\x05limit\"\x7f\n\x10RefCountResponse\x122\n\x04cids\
+ \x18\x01\x20\x03(\x0b2\x1e.pb.RefCountResponse.CidsEntryR\x04cids\x1a7\n\
+ \tCidsEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05val\
+ ue\x18\x02\x20\x01(\x03R\x05value:\x028\x01*5\n\tGCREQTYPE\x12\x0c\n\x08\
+ GC_START\x10\0\x12\x0b\n\x07GC_STOP\x10\x01\x12\r\n\tGC_STATUS\x10\x02*/\
+ \n\nREFREQTYPE\x12\x11\n\rREF_GET_COUNT\x10\0\x12\x0e\n\nREF_DELETE\x10\
+ \x01*\x1b\n\nREFREQOPTS\x12\r\n\tREF_FORCE\x10\02|\n\x08AdminAPI\x127\n\
+ \x08ManageGC\x12\x13.pb.ManageGCRequest\x1a\x14.pb.ManageGCResponse\"\0\
+ \x127\n\x08RefCount\x12\x13.pb.RefCountRequest\x1a\x14.pb.RefCountRespon\
+ se\"\0J\xfc\x10\n\x06\x12\x04\0\0;\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\
+ \x08\n\x01\x02\x12\x03\x01\x08\n\nb\n\x02\x06\0\x12\x04\x04\0\t\x01\x1aV\
+ \x20AdminAPI\x20facilitates\x20administrative\x20management\x20of\x20Tem\
+ poralX\x20via\x20a\x20localhost\x20gRPC\x20API\n\n\n\n\x03\x06\0\x01\x12\
+ \x03\x04\x08\x10\nP\n\x04\x06\0\x02\0\x12\x03\x06\x04@\x1aC\x20ManageGC\
+ \x20is\x20used\x20to\x20manage\x20TemporalX's\x20garbage\x20collection\
+ \x20process\n\n\x0c\n\x05\x06\0\x02\0\x01\x12\x03\x06\x08\x10\n\x0c\n\
+ \x05\x06\0\x02\0\x02\x12\x03\x06\x11\x20\n\x0c\n\x05\x06\0\x02\0\x03\x12\
+ \x03\x06+;\na\n\x04\x06\0\x02\x01\x12\x03\x08\x04@\x1aT\x20RefCount\x20i\
+ s\x20used\x20to\x20analyze\x20the\x20counter\x20store\x20and\x20pull\x20\
+ reference\x20count\x20information\n\n\x0c\n\x05\x06\0\x02\x01\x01\x12\
+ \x03\x08\x08\x10\n\x0c\n\x05\x06\0\x02\x01\x02\x12\x03\x08\x11\x20\n\x0c\
+ \n\x05\x06\0\x02\x01\x03\x12\x03\x08+;\nP\n\x02\x05\0\x12\x04\x0c\0\x13\
+ \x01\x1aD\x20GCREQTYPE\x20specifies\x20the\x20type\x20of\x20GC\x20manage\
+ ment\x20call\x20being\x20performed\n\n\n\n\x03\x05\0\x01\x12\x03\x0c\x05\
+ \x0e\n+\n\x04\x05\0\x02\0\x12\x03\x0e\x04\x11\x1a\x1e\x20GC_START\x20is\
+ \x20used\x20to\x20start\x20gc\n\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x0e\
+ \x04\x0c\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x0e\x0f\x10\n(\n\x04\x05\0\
+ \x02\x01\x12\x03\x10\x04\x10\x1a\x1b\x20C_STOP\x20is\x20used\x20to\x20st\
+ op\x20GC\n\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x10\x04\x0b\n\x0c\n\x05\
+ \x05\0\x02\x01\x02\x12\x03\x10\x0e\x0f\n6\n\x04\x05\0\x02\x02\x12\x03\
+ \x12\x04\x12\x1a)\x20GC_STATUS\x20is\x20used\x20to\x20retrieve\x20gc\x20\
+ status\n\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x12\x04\r\n\x0c\n\x05\x05\
+ \0\x02\x02\x02\x12\x03\x12\x10\x11\nW\n\x02\x04\0\x12\x04\x16\0\x19\x01\
+ \x1aK\x20ManageGCRequest\x20is\x20a\x20message\x20used\x20to\x20control\
+ \x20TemporalX\x20garbage\x20collection\n\n\n\n\x03\x04\0\x01\x12\x03\x16\
+ \x08\x17\n=\n\x04\x04\0\x02\0\x12\x03\x18\x04\x17\x1a0\x20type\x20is\x20\
+ the\x20type\x20of\x20gc\x20request\x20being\x20performed\n\n\r\n\x05\x04\
+ \0\x02\0\x04\x12\x04\x18\x04\x16\x19\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\
+ \x18\x04\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x18\x0e\x12\n\x0c\n\x05\
+ \x04\0\x02\0\x03\x12\x03\x18\x15\x16\nU\n\x02\x04\x01\x12\x04\x1c\0\x1f\
+ \x01\x1aI\x20ManageGCResponse\x20is\x20a\x20message\x20used\x20as\x20a\
+ \x20response\x20to\x20gc\x20control\x20requests\n\n\n\n\x03\x04\x01\x01\
+ \x12\x03\x1c\x08\x18\n/\n\x04\x04\x01\x02\0\x12\x03\x1e\x04\x16\x1a\"\
+ \x20status\x20contains\x20a\x20status\x20message\n\n\r\n\x05\x04\x01\x02\
+ \0\x04\x12\x04\x1e\x04\x1c\x1a\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x1e\
+ \x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x1e\x0b\x11\n\x0c\n\x05\x04\
+ \x01\x02\0\x03\x12\x03\x1e\x14\x15\nU\n\x02\x05\x01\x12\x04\"\0&\x01\x1a\
+ I\x20REFREQTYPE\x20is\x20used\x20to\x20indicate\x20the\x20type\x20of\x20\
+ ref\x20count\x20request\x20being\x20made\n\n\n\n\x03\x05\x01\x01\x12\x03\
+ \"\x05\x0f\nS\n\x04\x05\x01\x02\0\x12\x03$\x04\x16\x1aF\x20REF_GET_COUNT\
+ \x20is\x20used\x20to\x20get\x20the\x20reference\x20count\x20of\x20a\x20p\
+ articular\x20cid\n\n\x0c\n\x05\x05\x01\x02\0\x01\x12\x03$\x04\x11\n\x0c\
+ \n\x05\x05\x01\x02\0\x02\x12\x03$\x14\x15\n\x0b\n\x04\x05\x01\x02\x01\
+ \x12\x03%\x04\x13\n\x0c\n\x05\x05\x01\x02\x01\x01\x12\x03%\x04\x0e\n\x0c\
+ \n\x05\x05\x01\x02\x01\x02\x12\x03%\x11\x12\nG\n\x02\x05\x02\x12\x04)\0+\
+ \x01\x1a;\x20REFREQOPTS\x20are\x20options\x20for\x20fine-tuning\x20ref\
+ \x20count\x20requests\n\n\n\n\x03\x05\x02\x01\x12\x03)\x05\x0f\n\x0b\n\
+ \x04\x05\x02\x02\0\x12\x03*\x04\x12\n\x0c\n\x05\x05\x02\x02\0\x01\x12\
+ \x03*\x04\r\n\x0c\n\x05\x05\x02\x02\0\x02\x12\x03*\x10\x11\nm\n\x02\x04\
+ \x02\x12\x04/\04\x01\x1aa\x20RefCountRequest\x20is\x20used\x20to\x20anal\
+ yze\x20the\x20reference\n\x20counter\x20store,\x20and\x20retrieve\x20usa\
+ ge\x20information\n\n\n\n\x03\x04\x02\x01\x12\x03/\x08\x17\n?\n\x04\x04\
+ \x02\x02\0\x12\x031\x04\x1d\x1a2\x20cids\x20are\x20optional\x20cids\x20t\
+ o\x20filter\x20our\x20requests\x20by\n\n\x0c\n\x05\x04\x02\x02\0\x04\x12\
+ \x031\x04\x0c\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x031\r\x13\n\x0c\n\x05\
+ \x04\x02\x02\0\x01\x12\x031\x14\x18\n\x0c\n\x05\x04\x02\x02\0\x03\x12\
+ \x031\x1b\x1c\ne\n\x04\x04\x02\x02\x01\x12\x033\x04\x14\x1aX\x20can\x20b\
+ e\x20used\x20to\x20apply\x20limits\x20to\x20the\x20number\x20of\x20store\
+ \x20requests\x20made,\x20search\x20limits,\x20etc..\n\n\r\n\x05\x04\x02\
+ \x02\x01\x04\x12\x043\x041\x1d\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x033\
+ \x04\t\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x033\n\x0f\n\x0c\n\x05\x04\
+ \x02\x02\x01\x03\x12\x033\x12\x13\nb\n\x02\x04\x03\x12\x048\0;\x01\x1aV\
+ \x20RefCountResponse\x20is\x20used\x20to\x20return\x20the\x20information\
+ \n\x20gathered\x20by\x20a\x20RefCount\x20rpc\x20call.\n\n\n\n\x03\x04\
+ \x03\x01\x12\x038\x08\x18\nB\n\x04\x04\x03\x02\0\x12\x03:\x04\x20\x1a5\
+ \x20cids\x20is\x20a\x20mapping\x20of\x20the\x20cid\x20to\x20its\x20refer\
+ ence\x20count\n\n\r\n\x05\x04\x03\x02\0\x04\x12\x04:\x048\x1a\n\x0c\n\
+ \x05\x04\x03\x02\0\x06\x12\x03:\x04\x16\n\x0c\n\x05\x04\x03\x02\0\x01\
+ \x12\x03:\x17\x1b\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03:\x1e\x1fb\x06pro\
+ to3\
+";
+
+static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
+};
+
+fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
+ ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
+}
+
+pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
+ unsafe {
+ file_descriptor_proto_lazy.get(|| {
+ parse_descriptor_proto()
+ })
+ }
+}
diff --git a/rs/src/admin_grpc.rs b/rs/src/admin_grpc.rs
new file mode 100644
index 0000000..101e4cf
--- /dev/null
+++ b/rs/src/admin_grpc.rs
@@ -0,0 +1,99 @@
+// This file is generated. Do not edit
+// @generated
+
+// https://github.com/Manishearth/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unsafe_code)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+
+const METHOD_ADMIN_API_MANAGE_GC: ::grpcio::Method = ::grpcio::Method {
+ ty: ::grpcio::MethodType::Unary,
+ name: "/pb.AdminAPI/ManageGC",
+ req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+ resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+};
+
+const METHOD_ADMIN_API_REF_COUNT: ::grpcio::Method = ::grpcio::Method {
+ ty: ::grpcio::MethodType::Unary,
+ name: "/pb.AdminAPI/RefCount",
+ req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+ resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+};
+
+#[derive(Clone)]
+pub struct AdminApiClient {
+ client: ::grpcio::Client,
+}
+
+impl AdminApiClient {
+ pub fn new(channel: ::grpcio::Channel) -> Self {
+ AdminApiClient {
+ client: ::grpcio::Client::new(channel),
+ }
+ }
+
+ pub fn manage_gc_opt(&self, req: &super::admin::ManageGCRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result {
+ self.client.unary_call(&METHOD_ADMIN_API_MANAGE_GC, req, opt)
+ }
+
+ pub fn manage_gc(&self, req: &super::admin::ManageGCRequest) -> ::grpcio::Result {
+ self.manage_gc_opt(req, ::grpcio::CallOption::default())
+ }
+
+ pub fn manage_gc_async_opt(&self, req: &super::admin::ManageGCRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.client.unary_call_async(&METHOD_ADMIN_API_MANAGE_GC, req, opt)
+ }
+
+ pub fn manage_gc_async(&self, req: &super::admin::ManageGCRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.manage_gc_async_opt(req, ::grpcio::CallOption::default())
+ }
+
+ pub fn ref_count_opt(&self, req: &super::admin::RefCountRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result {
+ self.client.unary_call(&METHOD_ADMIN_API_REF_COUNT, req, opt)
+ }
+
+ pub fn ref_count(&self, req: &super::admin::RefCountRequest) -> ::grpcio::Result {
+ self.ref_count_opt(req, ::grpcio::CallOption::default())
+ }
+
+ pub fn ref_count_async_opt(&self, req: &super::admin::RefCountRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.client.unary_call_async(&METHOD_ADMIN_API_REF_COUNT, req, opt)
+ }
+
+ pub fn ref_count_async(&self, req: &super::admin::RefCountRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.ref_count_async_opt(req, ::grpcio::CallOption::default())
+ }
+ pub fn spawn(&self, f: F) where F: ::futures::Future- + Send + 'static {
+ self.client.spawn(f)
+ }
+}
+
+pub trait AdminApi {
+ fn manage_gc(&mut self, ctx: ::grpcio::RpcContext, req: super::admin::ManageGCRequest, sink: ::grpcio::UnarySink);
+ fn ref_count(&mut self, ctx: ::grpcio::RpcContext, req: super::admin::RefCountRequest, sink: ::grpcio::UnarySink);
+}
+
+pub fn create_admin_api(s: S) -> ::grpcio::Service {
+ let mut builder = ::grpcio::ServiceBuilder::new();
+ let mut instance = s.clone();
+ builder = builder.add_unary_handler(&METHOD_ADMIN_API_MANAGE_GC, move |ctx, req, resp| {
+ instance.manage_gc(ctx, req, resp)
+ });
+ let mut instance = s;
+ builder = builder.add_unary_handler(&METHOD_ADMIN_API_REF_COUNT, move |ctx, req, resp| {
+ instance.ref_count(ctx, req, resp)
+ });
+ builder.build()
+}
diff --git a/rs/src/file.rs b/rs/src/file.rs
new file mode 100644
index 0000000..6b26a1c
--- /dev/null
+++ b/rs/src/file.rs
@@ -0,0 +1,1350 @@
+// This file is generated by rust-protobuf 2.10.2. Do not edit
+// @generated
+
+// https://github.com/rust-lang/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unsafe_code)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+//! Generated file from `file.proto`
+
+use protobuf::Message as Message_imported_for_functions;
+use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
+
+/// Generated files are compatible only with the same version
+/// of protobuf runtime.
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_10_2;
+
+#[derive(PartialEq,Clone,Default)]
+pub struct UploadRequest {
+ // message fields
+ pub blob: ::protobuf::SingularPtrField,
+ pub options: ::protobuf::SingularPtrField,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a UploadRequest {
+ fn default() -> &'a UploadRequest {
+ ::default_instance()
+ }
+}
+
+impl UploadRequest {
+ pub fn new() -> UploadRequest {
+ ::std::default::Default::default()
+ }
+
+ // .pb.Blob blob = 1;
+
+
+ pub fn get_blob(&self) -> &Blob {
+ self.blob.as_ref().unwrap_or_else(|| Blob::default_instance())
+ }
+ pub fn clear_blob(&mut self) {
+ self.blob.clear();
+ }
+
+ pub fn has_blob(&self) -> bool {
+ self.blob.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_blob(&mut self, v: Blob) {
+ self.blob = ::protobuf::SingularPtrField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_blob(&mut self) -> &mut Blob {
+ if self.blob.is_none() {
+ self.blob.set_default();
+ }
+ self.blob.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_blob(&mut self) -> Blob {
+ self.blob.take().unwrap_or_else(|| Blob::new())
+ }
+
+ // .pb.UploadOptions options = 2;
+
+
+ pub fn get_options(&self) -> &UploadOptions {
+ self.options.as_ref().unwrap_or_else(|| UploadOptions::default_instance())
+ }
+ pub fn clear_options(&mut self) {
+ self.options.clear();
+ }
+
+ pub fn has_options(&self) -> bool {
+ self.options.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_options(&mut self, v: UploadOptions) {
+ self.options = ::protobuf::SingularPtrField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_options(&mut self) -> &mut UploadOptions {
+ if self.options.is_none() {
+ self.options.set_default();
+ }
+ self.options.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_options(&mut self) -> UploadOptions {
+ self.options.take().unwrap_or_else(|| UploadOptions::new())
+ }
+}
+
+impl ::protobuf::Message for UploadRequest {
+ fn is_initialized(&self) -> bool {
+ for v in &self.blob {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ for v in &self.options {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.blob)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.options)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(ref v) = self.blob.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ }
+ if let Some(ref v) = self.options.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if let Some(ref v) = self.blob.as_ref() {
+ os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ }
+ if let Some(ref v) = self.options.as_ref() {
+ os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> UploadRequest {
+ UploadRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>(
+ "blob",
+ |m: &UploadRequest| { &m.blob },
+ |m: &mut UploadRequest| { &mut m.blob },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>(
+ "options",
+ |m: &UploadRequest| { &m.options },
+ |m: &mut UploadRequest| { &mut m.options },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "UploadRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static UploadRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const UploadRequest,
+ };
+ unsafe {
+ instance.get(UploadRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for UploadRequest {
+ fn clear(&mut self) {
+ self.blob.clear();
+ self.options.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for UploadRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for UploadRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct UploadOptions {
+ // message fields
+ pub multiHash: ::std::string::String,
+ pub layout: ::std::string::String,
+ pub chunker: ::std::string::String,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a UploadOptions {
+ fn default() -> &'a UploadOptions {
+ ::default_instance()
+ }
+}
+
+impl UploadOptions {
+ pub fn new() -> UploadOptions {
+ ::std::default::Default::default()
+ }
+
+ // string multiHash = 1;
+
+
+ pub fn get_multiHash(&self) -> &str {
+ &self.multiHash
+ }
+ pub fn clear_multiHash(&mut self) {
+ self.multiHash.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_multiHash(&mut self, v: ::std::string::String) {
+ self.multiHash = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_multiHash(&mut self) -> &mut ::std::string::String {
+ &mut self.multiHash
+ }
+
+ // Take field
+ pub fn take_multiHash(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.multiHash, ::std::string::String::new())
+ }
+
+ // string layout = 2;
+
+
+ pub fn get_layout(&self) -> &str {
+ &self.layout
+ }
+ pub fn clear_layout(&mut self) {
+ self.layout.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_layout(&mut self, v: ::std::string::String) {
+ self.layout = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_layout(&mut self) -> &mut ::std::string::String {
+ &mut self.layout
+ }
+
+ // Take field
+ pub fn take_layout(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.layout, ::std::string::String::new())
+ }
+
+ // string chunker = 3;
+
+
+ pub fn get_chunker(&self) -> &str {
+ &self.chunker
+ }
+ pub fn clear_chunker(&mut self) {
+ self.chunker.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_chunker(&mut self, v: ::std::string::String) {
+ self.chunker = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_chunker(&mut self) -> &mut ::std::string::String {
+ &mut self.chunker
+ }
+
+ // Take field
+ pub fn take_chunker(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.chunker, ::std::string::String::new())
+ }
+}
+
+impl ::protobuf::Message for UploadOptions {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.multiHash)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.layout)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.chunker)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.multiHash.is_empty() {
+ my_size += ::protobuf::rt::string_size(1, &self.multiHash);
+ }
+ if !self.layout.is_empty() {
+ my_size += ::protobuf::rt::string_size(2, &self.layout);
+ }
+ if !self.chunker.is_empty() {
+ my_size += ::protobuf::rt::string_size(3, &self.chunker);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.multiHash.is_empty() {
+ os.write_string(1, &self.multiHash)?;
+ }
+ if !self.layout.is_empty() {
+ os.write_string(2, &self.layout)?;
+ }
+ if !self.chunker.is_empty() {
+ os.write_string(3, &self.chunker)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> UploadOptions {
+ UploadOptions::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "multiHash",
+ |m: &UploadOptions| { &m.multiHash },
+ |m: &mut UploadOptions| { &mut m.multiHash },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "layout",
+ |m: &UploadOptions| { &m.layout },
+ |m: &mut UploadOptions| { &mut m.layout },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "chunker",
+ |m: &UploadOptions| { &m.chunker },
+ |m: &mut UploadOptions| { &mut m.chunker },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "UploadOptions",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static UploadOptions {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const UploadOptions,
+ };
+ unsafe {
+ instance.get(UploadOptions::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for UploadOptions {
+ fn clear(&mut self) {
+ self.multiHash.clear();
+ self.layout.clear();
+ self.chunker.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for UploadOptions {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for UploadOptions {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct DownloadRequest {
+ // message fields
+ pub hash: ::std::string::String,
+ pub chunkSize: i32,
+ pub rangeStart: u64,
+ pub rangeEnd: u64,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a DownloadRequest {
+ fn default() -> &'a DownloadRequest {
+ ::default_instance()
+ }
+}
+
+impl DownloadRequest {
+ pub fn new() -> DownloadRequest {
+ ::std::default::Default::default()
+ }
+
+ // string hash = 1;
+
+
+ pub fn get_hash(&self) -> &str {
+ &self.hash
+ }
+ pub fn clear_hash(&mut self) {
+ self.hash.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_hash(&mut self, v: ::std::string::String) {
+ self.hash = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_hash(&mut self) -> &mut ::std::string::String {
+ &mut self.hash
+ }
+
+ // Take field
+ pub fn take_hash(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.hash, ::std::string::String::new())
+ }
+
+ // int32 chunkSize = 2;
+
+
+ pub fn get_chunkSize(&self) -> i32 {
+ self.chunkSize
+ }
+ pub fn clear_chunkSize(&mut self) {
+ self.chunkSize = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_chunkSize(&mut self, v: i32) {
+ self.chunkSize = v;
+ }
+
+ // uint64 rangeStart = 3;
+
+
+ pub fn get_rangeStart(&self) -> u64 {
+ self.rangeStart
+ }
+ pub fn clear_rangeStart(&mut self) {
+ self.rangeStart = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_rangeStart(&mut self, v: u64) {
+ self.rangeStart = v;
+ }
+
+ // uint64 rangeEnd = 4;
+
+
+ pub fn get_rangeEnd(&self) -> u64 {
+ self.rangeEnd
+ }
+ pub fn clear_rangeEnd(&mut self) {
+ self.rangeEnd = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_rangeEnd(&mut self, v: u64) {
+ self.rangeEnd = v;
+ }
+}
+
+impl ::protobuf::Message for DownloadRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.hash)?;
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.chunkSize = tmp;
+ },
+ 3 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_uint64()?;
+ self.rangeStart = tmp;
+ },
+ 4 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_uint64()?;
+ self.rangeEnd = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.hash.is_empty() {
+ my_size += ::protobuf::rt::string_size(1, &self.hash);
+ }
+ if self.chunkSize != 0 {
+ my_size += ::protobuf::rt::value_size(2, self.chunkSize, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if self.rangeStart != 0 {
+ my_size += ::protobuf::rt::value_size(3, self.rangeStart, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if self.rangeEnd != 0 {
+ my_size += ::protobuf::rt::value_size(4, self.rangeEnd, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.hash.is_empty() {
+ os.write_string(1, &self.hash)?;
+ }
+ if self.chunkSize != 0 {
+ os.write_int32(2, self.chunkSize)?;
+ }
+ if self.rangeStart != 0 {
+ os.write_uint64(3, self.rangeStart)?;
+ }
+ if self.rangeEnd != 0 {
+ os.write_uint64(4, self.rangeEnd)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> DownloadRequest {
+ DownloadRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "hash",
+ |m: &DownloadRequest| { &m.hash },
+ |m: &mut DownloadRequest| { &mut m.hash },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
+ "chunkSize",
+ |m: &DownloadRequest| { &m.chunkSize },
+ |m: &mut DownloadRequest| { &mut m.chunkSize },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
+ "rangeStart",
+ |m: &DownloadRequest| { &m.rangeStart },
+ |m: &mut DownloadRequest| { &mut m.rangeStart },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
+ "rangeEnd",
+ |m: &DownloadRequest| { &m.rangeEnd },
+ |m: &mut DownloadRequest| { &mut m.rangeEnd },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "DownloadRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static DownloadRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const DownloadRequest,
+ };
+ unsafe {
+ instance.get(DownloadRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for DownloadRequest {
+ fn clear(&mut self) {
+ self.hash.clear();
+ self.chunkSize = 0;
+ self.rangeStart = 0;
+ self.rangeEnd = 0;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for DownloadRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for DownloadRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct DownloadResponse {
+ // message fields
+ pub blob: ::protobuf::SingularPtrField,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a DownloadResponse {
+ fn default() -> &'a DownloadResponse {
+ ::default_instance()
+ }
+}
+
+impl DownloadResponse {
+ pub fn new() -> DownloadResponse {
+ ::std::default::Default::default()
+ }
+
+ // .pb.Blob blob = 1;
+
+
+ pub fn get_blob(&self) -> &Blob {
+ self.blob.as_ref().unwrap_or_else(|| Blob::default_instance())
+ }
+ pub fn clear_blob(&mut self) {
+ self.blob.clear();
+ }
+
+ pub fn has_blob(&self) -> bool {
+ self.blob.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_blob(&mut self, v: Blob) {
+ self.blob = ::protobuf::SingularPtrField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_blob(&mut self) -> &mut Blob {
+ if self.blob.is_none() {
+ self.blob.set_default();
+ }
+ self.blob.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_blob(&mut self) -> Blob {
+ self.blob.take().unwrap_or_else(|| Blob::new())
+ }
+}
+
+impl ::protobuf::Message for DownloadResponse {
+ fn is_initialized(&self) -> bool {
+ for v in &self.blob {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.blob)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(ref v) = self.blob.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if let Some(ref v) = self.blob.as_ref() {
+ os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> DownloadResponse {
+ DownloadResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>(
+ "blob",
+ |m: &DownloadResponse| { &m.blob },
+ |m: &mut DownloadResponse| { &mut m.blob },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "DownloadResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static DownloadResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const DownloadResponse,
+ };
+ unsafe {
+ instance.get(DownloadResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for DownloadResponse {
+ fn clear(&mut self) {
+ self.blob.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for DownloadResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for DownloadResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct Blob {
+ // message fields
+ pub content: ::std::vec::Vec,
+ pub rangeStart: u64,
+ pub rangeEnd: u64,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a Blob {
+ fn default() -> &'a Blob {
+ ::default_instance()
+ }
+}
+
+impl Blob {
+ pub fn new() -> Blob {
+ ::std::default::Default::default()
+ }
+
+ // bytes content = 1;
+
+
+ pub fn get_content(&self) -> &[u8] {
+ &self.content
+ }
+ pub fn clear_content(&mut self) {
+ self.content.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_content(&mut self, v: ::std::vec::Vec) {
+ self.content = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_content(&mut self) -> &mut ::std::vec::Vec {
+ &mut self.content
+ }
+
+ // Take field
+ pub fn take_content(&mut self) -> ::std::vec::Vec {
+ ::std::mem::replace(&mut self.content, ::std::vec::Vec::new())
+ }
+
+ // uint64 rangeStart = 2;
+
+
+ pub fn get_rangeStart(&self) -> u64 {
+ self.rangeStart
+ }
+ pub fn clear_rangeStart(&mut self) {
+ self.rangeStart = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_rangeStart(&mut self, v: u64) {
+ self.rangeStart = v;
+ }
+
+ // uint64 rangeEnd = 3;
+
+
+ pub fn get_rangeEnd(&self) -> u64 {
+ self.rangeEnd
+ }
+ pub fn clear_rangeEnd(&mut self) {
+ self.rangeEnd = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_rangeEnd(&mut self, v: u64) {
+ self.rangeEnd = v;
+ }
+}
+
+impl ::protobuf::Message for Blob {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.content)?;
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_uint64()?;
+ self.rangeStart = tmp;
+ },
+ 3 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_uint64()?;
+ self.rangeEnd = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.content.is_empty() {
+ my_size += ::protobuf::rt::bytes_size(1, &self.content);
+ }
+ if self.rangeStart != 0 {
+ my_size += ::protobuf::rt::value_size(2, self.rangeStart, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if self.rangeEnd != 0 {
+ my_size += ::protobuf::rt::value_size(3, self.rangeEnd, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.content.is_empty() {
+ os.write_bytes(1, &self.content)?;
+ }
+ if self.rangeStart != 0 {
+ os.write_uint64(2, self.rangeStart)?;
+ }
+ if self.rangeEnd != 0 {
+ os.write_uint64(3, self.rangeEnd)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> Blob {
+ Blob::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "content",
+ |m: &Blob| { &m.content },
+ |m: &mut Blob| { &mut m.content },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
+ "rangeStart",
+ |m: &Blob| { &m.rangeStart },
+ |m: &mut Blob| { &mut m.rangeStart },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
+ "rangeEnd",
+ |m: &Blob| { &m.rangeEnd },
+ |m: &mut Blob| { &mut m.rangeEnd },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "Blob",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static Blob {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const Blob,
+ };
+ unsafe {
+ instance.get(Blob::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for Blob {
+ fn clear(&mut self) {
+ self.content.clear();
+ self.rangeStart = 0;
+ self.rangeEnd = 0;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for Blob {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for Blob {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+static file_descriptor_proto_data: &'static [u8] = b"\
+ \n\nfile.proto\x12\x02pb\x1a\nutil.proto\"Z\n\rUploadRequest\x12\x1c\n\
+ \x04blob\x18\x01\x20\x01(\x0b2\x08.pb.BlobR\x04blob\x12+\n\x07options\
+ \x18\x02\x20\x01(\x0b2\x11.pb.UploadOptionsR\x07options\"_\n\rUploadOpti\
+ ons\x12\x1c\n\tmultiHash\x18\x01\x20\x01(\tR\tmultiHash\x12\x16\n\x06lay\
+ out\x18\x02\x20\x01(\tR\x06layout\x12\x18\n\x07chunker\x18\x03\x20\x01(\
+ \tR\x07chunker\"\x7f\n\x0fDownloadRequest\x12\x12\n\x04hash\x18\x01\x20\
+ \x01(\tR\x04hash\x12\x1c\n\tchunkSize\x18\x02\x20\x01(\x05R\tchunkSize\
+ \x12\x1e\n\nrangeStart\x18\x03\x20\x01(\x04R\nrangeStart\x12\x1a\n\x08ra\
+ ngeEnd\x18\x04\x20\x01(\x04R\x08rangeEnd\"0\n\x10DownloadResponse\x12\
+ \x1c\n\x04blob\x18\x01\x20\x01(\x0b2\x08.pb.BlobR\x04blob\"\\\n\x04Blob\
+ \x12\x18\n\x07content\x18\x01\x20\x01(\x0cR\x07content\x12\x1e\n\nrangeS\
+ tart\x18\x02\x20\x01(\x04R\nrangeStart\x12\x1a\n\x08rangeEnd\x18\x03\x20\
+ \x01(\x04R\x08rangeEnd2~\n\x07FileAPI\x124\n\nUploadFile\x12\x11.pb.Uplo\
+ adRequest\x1a\x0f.pb.PutResponse\"\0(\x01\x12=\n\x0cDownloadFile\x12\x13\
+ .pb.DownloadRequest\x1a\x14.pb.DownloadResponse\"\00\x01J\xda\x17\n\x06\
+ \x12\x04\0\0B\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\
+ \x03\x01\x08\n\n\t\n\x02\x03\0\x12\x03\x02\x07\x13\nT\n\x02\x06\0\x12\
+ \x04\x05\0\n\x01\x1aH\x20FileAPI\x20provides\x20a\x20gRPC\x20api\x20to\
+ \x20upload/download\x20files\x20as\x20UnixFS\x20objects\n\n\n\n\x03\x06\
+ \0\x01\x12\x03\x05\x08\x0f\n]\n\x04\x06\0\x02\0\x12\x03\x07\x04C\x1aP\
+ \x20UploadFile\x20allows\x20uploading\x20a\x20file\x20as\x20a\x20UnixFS\
+ \x20object\x20(equivalent\x20to\x20ipfs\x20add)\n\n\x0c\n\x05\x06\0\x02\
+ \0\x01\x12\x03\x07\x08\x12\n\x0c\n\x05\x06\0\x02\0\x05\x12\x03\x07\x13\
+ \x19\n\x0c\n\x05\x06\0\x02\0\x02\x12\x03\x07\x1a'\n\x0c\n\x05\x06\0\x02\
+ \0\x03\x12\x03\x073>\nW\n\x04\x06\0\x02\x01\x12\x03\t\x04K\x1aJ\x20Downl\
+ oadFile\x20allows\x20downloading\x20a\x20UnixFS\x20object\x20(equivalent\
+ \x20to\x20ipfs\x20get)\n\n\x0c\n\x05\x06\0\x02\x01\x01\x12\x03\t\x08\x14\
+ \n\x0c\n\x05\x06\0\x02\x01\x02\x12\x03\t\x15$\n\x0c\n\x05\x06\0\x02\x01\
+ \x06\x12\x03\t/5\n\x0c\n\x05\x06\0\x02\x01\x03\x12\x03\t6F\nE\n\x02\x04\
+ \0\x12\x04\x0e\0\x13\x01\x1a9\x20UploadRequest\x20is\x20used\x20to\x20up\
+ load\x20data\x20as\x20a\x20UnixFS\x20object\n\n\n\n\x03\x04\0\x01\x12\
+ \x03\x0e\x08\x15\n-\n\x04\x04\0\x02\0\x12\x03\x10\x04\x12\x1a\x20\x20blo\
+ b\x20is\x20a\x20single\x20chunk\x20of\x20data\n\n\r\n\x05\x04\0\x02\0\
+ \x04\x12\x04\x10\x04\x0e\x17\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x10\x04\
+ \x08\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x10\t\r\n\x0c\n\x05\x04\0\x02\0\
+ \x03\x12\x03\x10\x10\x11\nA\n\x04\x04\0\x02\x01\x12\x03\x12\x04\x1e\x1a4\
+ \x20options\x20allows\x20setting\x20the\x20optoins\x20for\x20this\x20upl\
+ oad\n\n\r\n\x05\x04\0\x02\x01\x04\x12\x04\x12\x04\x10\x12\n\x0c\n\x05\
+ \x04\0\x02\x01\x06\x12\x03\x12\x04\x11\n\x0c\n\x05\x04\0\x02\x01\x01\x12\
+ \x03\x12\x12\x19\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x12\x1c\x1d\nN\n\
+ \x02\x04\x01\x12\x04\x16\0\x1d\x01\x1aB\x20UploadOptions\x20allows\x20co\
+ ntrolling\x20the\x20parameters\x20of\x20a\x20file\x20upload\n\n\n\n\x03\
+ \x04\x01\x01\x12\x03\x16\x08\x15\n5\n\x04\x04\x01\x02\0\x12\x03\x18\x04\
+ \x19\x1a(\x20specifes\x20the\x20multihash\x20function\x20to\x20use\n\n\r\
+ \n\x05\x04\x01\x02\0\x04\x12\x04\x18\x04\x16\x17\n\x0c\n\x05\x04\x01\x02\
+ \0\x05\x12\x03\x18\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x18\x0b\
+ \x14\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x18\x17\x18\n<\n\x04\x04\x01\
+ \x02\x01\x12\x03\x1a\x04\x16\x1a/\x20specifies\x20the\x20dag\x20layout\
+ \x20(balanced,\x20tricklet)\n\n\r\n\x05\x04\x01\x02\x01\x04\x12\x04\x1a\
+ \x04\x18\x19\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\x1a\x04\n\n\x0c\n\
+ \x05\x04\x01\x02\x01\x01\x12\x03\x1a\x0b\x11\n\x0c\n\x05\x04\x01\x02\x01\
+ \x03\x12\x03\x1a\x14\x15\nB\n\x04\x04\x01\x02\x02\x12\x03\x1c\x04\x17\
+ \x1a5\x20specifies\x20the\x20chunker\x20type\x20(rabin,\x20default,\x20e\
+ tc...)\n\n\r\n\x05\x04\x01\x02\x02\x04\x12\x04\x1c\x04\x1a\x16\n\x0c\n\
+ \x05\x04\x01\x02\x02\x05\x12\x03\x1c\x04\n\n\x0c\n\x05\x04\x01\x02\x02\
+ \x01\x12\x03\x1c\x0b\x12\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x1c\x15\
+ \x16\n\xa6\x01\n\x02\x04\x02\x12\x04\"\0/\x01\x1a\x99\x01\x20DownloadReq\
+ uest\x20is\x20used\x20to\x20download\x20a\x20UnixFS\x20object\n\x20altho\
+ ugh\x20it\x20can\x20in\x20theory\x20be\x20used\x20with\x20other\x20type\
+ \x20of\x20objects\n\x20there\x20may\x20be\x20some\x20undefined\x20behavi\
+ or\n\n\n\n\x03\x04\x02\x01\x12\x03\"\x08\x17\nU\n\x04\x04\x02\x02\0\x12\
+ \x03$\x04\x14\x1aH\x20hash\x20is\x20the\x20ipfs\x20hash/cid\x20(content\
+ \x20identifier)\x20of\x20the\x20data\x20to\x20download\n\n\r\n\x05\x04\
+ \x02\x02\0\x04\x12\x04$\x04\"\x19\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03$\
+ \x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03$\x0b\x0f\n\x0c\n\x05\x04\
+ \x02\x02\0\x03\x12\x03$\x12\x13\n\xb7\x01\n\x04\x04\x02\x02\x01\x12\x03(\
+ \x04\x18\x1a\xa9\x01\x20chunkSize\x20specifies\x20the\x20size\x20of\x20c\
+ hunks\x20to\x20be\x20sent\x20to\x20the\x20client\n\x20it\x20allows\x20us\
+ \x20to\x20efficiently\x20control\x20incoming\x20data\x20amounts\x20which\
+ \n\x20is\x20useful\x20on\x20machines\x20with\x20low-memory\n\n\r\n\x05\
+ \x04\x02\x02\x01\x04\x12\x04(\x04$\x14\n\x0c\n\x05\x04\x02\x02\x01\x05\
+ \x12\x03(\x04\t\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03(\n\x13\n\x0c\n\
+ \x05\x04\x02\x02\x01\x03\x12\x03(\x16\x17\n\xa8\x02\n\x04\x04\x02\x02\
+ \x02\x12\x03-\x04\x1a\x1a\x9a\x02\x20Range\x20start\x20and\x20end\x20mir\
+ rors\x20developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range.\n\x20If\
+ \x20both\x20is\x20none\x20zero,\x20only\x20data\x20within\x20range\x20is\
+ \x20requested.\n\x20The\x20unit\x20of\x20range\x20is\x20alway\x20in\x20b\
+ ytes.\n\x20If\x20used,\x20please\x20check\x20the\x20returned\x20range\
+ \x20values\x20in\x20blobs\x20to\x20make\x20sure\x20this\x20feature\x20is\
+ \x20supported.\n\n\r\n\x05\x04\x02\x02\x02\x04\x12\x04-\x04(\x18\n\x0c\n\
+ \x05\x04\x02\x02\x02\x05\x12\x03-\x04\n\n\x0c\n\x05\x04\x02\x02\x02\x01\
+ \x12\x03-\x0b\x15\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03-\x18\x19\n\x0b\
+ \n\x04\x04\x02\x02\x03\x12\x03.\x04\x18\n\r\n\x05\x04\x02\x02\x03\x04\
+ \x12\x04.\x04-\x1a\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03.\x04\n\n\x0c\
+ \n\x05\x04\x02\x02\x03\x01\x12\x03.\x0b\x13\n\x0c\n\x05\x04\x02\x02\x03\
+ \x03\x12\x03.\x16\x17\n\x86\x01\n\x02\x04\x03\x12\x043\06\x01\x1az\x20Do\
+ wnloadResponse\x20contains\x20the\x20response\x20to\x20a\x20download\x20\
+ request\n\x20which\x20allows\x20the\x20gRPC\x20server\x20to\x20stream\
+ \x20blobs\x20to\x20the\x20client\n\n\n\n\x03\x04\x03\x01\x12\x033\x08\
+ \x18\n-\n\x04\x04\x03\x02\0\x12\x035\x04\x12\x1a\x20\x20blob\x20is\x20a\
+ \x20single\x20chunk\x20of\x20data\n\n\r\n\x05\x04\x03\x02\0\x04\x12\x045\
+ \x043\x1a\n\x0c\n\x05\x04\x03\x02\0\x06\x12\x035\x04\x08\n\x0c\n\x05\x04\
+ \x03\x02\0\x01\x12\x035\t\r\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x035\x10\
+ \x11\n,\n\x02\x04\x04\x12\x049\0B\x01\x1a\x20\x20Blob\x20is\x20a\x20chun\
+ k\x20of\x20binary\x20data\n\n\n\n\x03\x04\x04\x01\x12\x039\x08\x0c\nJ\n\
+ \x04\x04\x04\x02\0\x12\x03;\x04\x16\x1a=\x20content\x20is\x20the\x20actu\
+ al\x20binary\x20data\x20contained\x20in\x20this\x20message\n\n\r\n\x05\
+ \x04\x04\x02\0\x04\x12\x04;\x049\x0e\n\x0c\n\x05\x04\x04\x02\0\x05\x12\
+ \x03;\x04\t\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03;\n\x11\n\x0c\n\x05\x04\
+ \x04\x02\0\x03\x12\x03;\x14\x15\n\x92\x02\n\x04\x04\x04\x02\x01\x12\x03@\
+ \x04\x1a\x1a\x84\x02\x20Range\x20start\x20and\x20end\x20mirrors\x20devel\
+ oper.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range.\n\x20If\x20b\
+ oth\x20is\x20zero,\x20the\x20blobs\x20streams\x20contents\x20of\x20the\
+ \x20file\x20from\x20start\x20to\x20finish.\n\x20The\x20unit\x20of\x20ran\
+ ge\x20is\x20alway\x20in\x20bytes.\n\x20Currently,\x20DownloadResponse\
+ \x20support\x20blob\x20range.\n\n\r\n\x05\x04\x04\x02\x01\x04\x12\x04@\
+ \x04;\x16\n\x0c\n\x05\x04\x04\x02\x01\x05\x12\x03@\x04\n\n\x0c\n\x05\x04\
+ \x04\x02\x01\x01\x12\x03@\x0b\x15\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\
+ \x03@\x18\x19\n\x0b\n\x04\x04\x04\x02\x02\x12\x03A\x04\x18\n\r\n\x05\x04\
+ \x04\x02\x02\x04\x12\x04A\x04@\x1a\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\
+ \x03A\x04\n\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03A\x0b\x13\n\x0c\n\x05\
+ \x04\x04\x02\x02\x03\x12\x03A\x16\x17b\x06proto3\
+";
+
+static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
+};
+
+fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
+ ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
+}
+
+pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
+ unsafe {
+ file_descriptor_proto_lazy.get(|| {
+ parse_descriptor_proto()
+ })
+ }
+}
diff --git a/rs/src/file_grpc.rs b/rs/src/file_grpc.rs
new file mode 100644
index 0000000..97fb7d9
--- /dev/null
+++ b/rs/src/file_grpc.rs
@@ -0,0 +1,83 @@
+// This file is generated. Do not edit
+// @generated
+
+// https://github.com/Manishearth/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unsafe_code)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+
+const METHOD_FILE_API_UPLOAD_FILE: ::grpcio::Method = ::grpcio::Method {
+ ty: ::grpcio::MethodType::ClientStreaming,
+ name: "/pb.FileAPI/UploadFile",
+ req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+ resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+};
+
+const METHOD_FILE_API_DOWNLOAD_FILE: ::grpcio::Method = ::grpcio::Method {
+ ty: ::grpcio::MethodType::ServerStreaming,
+ name: "/pb.FileAPI/DownloadFile",
+ req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+ resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+};
+
+#[derive(Clone)]
+pub struct FileApiClient {
+ client: ::grpcio::Client,
+}
+
+impl FileApiClient {
+ pub fn new(channel: ::grpcio::Channel) -> Self {
+ FileApiClient {
+ client: ::grpcio::Client::new(channel),
+ }
+ }
+
+ pub fn upload_file_opt(&self, opt: ::grpcio::CallOption) -> ::grpcio::Result<(::grpcio::ClientCStreamSender, ::grpcio::ClientCStreamReceiver)> {
+ self.client.client_streaming(&METHOD_FILE_API_UPLOAD_FILE, opt)
+ }
+
+ pub fn upload_file(&self) -> ::grpcio::Result<(::grpcio::ClientCStreamSender, ::grpcio::ClientCStreamReceiver)> {
+ self.upload_file_opt(::grpcio::CallOption::default())
+ }
+
+ pub fn download_file_opt(&self, req: &super::file::DownloadRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> {
+ self.client.server_streaming(&METHOD_FILE_API_DOWNLOAD_FILE, req, opt)
+ }
+
+ pub fn download_file(&self, req: &super::file::DownloadRequest) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> {
+ self.download_file_opt(req, ::grpcio::CallOption::default())
+ }
+ pub fn spawn(&self, f: F) where F: ::futures::Future
- + Send + 'static {
+ self.client.spawn(f)
+ }
+}
+
+pub trait FileApi {
+ fn upload_file(&mut self, ctx: ::grpcio::RpcContext, stream: ::grpcio::RequestStream, sink: ::grpcio::ClientStreamingSink);
+ fn download_file(&mut self, ctx: ::grpcio::RpcContext, req: super::file::DownloadRequest, sink: ::grpcio::ServerStreamingSink);
+}
+
+pub fn create_file_api(s: S) -> ::grpcio::Service {
+ let mut builder = ::grpcio::ServiceBuilder::new();
+ let mut instance = s.clone();
+ builder = builder.add_client_streaming_handler(&METHOD_FILE_API_UPLOAD_FILE, move |ctx, req, resp| {
+ instance.upload_file(ctx, req, resp)
+ });
+ let mut instance = s;
+ builder = builder.add_server_streaming_handler(&METHOD_FILE_API_DOWNLOAD_FILE, move |ctx, req, resp| {
+ instance.download_file(ctx, req, resp)
+ });
+ builder.build()
+}
diff --git a/rs/src/main.rs b/rs/src/main.rs
new file mode 100644
index 0000000..e7a11a9
--- /dev/null
+++ b/rs/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}
diff --git a/rs/src/namesys.rs b/rs/src/namesys.rs
new file mode 100644
index 0000000..a768ac8
--- /dev/null
+++ b/rs/src/namesys.rs
@@ -0,0 +1,897 @@
+// This file is generated by rust-protobuf 2.10.2. Do not edit
+// @generated
+
+// https://github.com/rust-lang/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unsafe_code)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+//! Generated file from `namesys.proto`
+
+use protobuf::Message as Message_imported_for_functions;
+use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
+
+/// Generated files are compatible only with the same version
+/// of protobuf runtime.
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_10_2;
+
+#[derive(PartialEq,Clone,Default)]
+pub struct NameSysResolveRequest {
+ // message fields
+ pub name: ::std::string::String,
+ pub depth: u32,
+ pub dhtRecordCount: u32,
+ pub dhtTimeout: i32,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a NameSysResolveRequest {
+ fn default() -> &'a NameSysResolveRequest {
+ ::default_instance()
+ }
+}
+
+impl NameSysResolveRequest {
+ pub fn new() -> NameSysResolveRequest {
+ ::std::default::Default::default()
+ }
+
+ // string name = 1;
+
+
+ pub fn get_name(&self) -> &str {
+ &self.name
+ }
+ pub fn clear_name(&mut self) {
+ self.name.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_name(&mut self, v: ::std::string::String) {
+ self.name = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_name(&mut self) -> &mut ::std::string::String {
+ &mut self.name
+ }
+
+ // Take field
+ pub fn take_name(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.name, ::std::string::String::new())
+ }
+
+ // uint32 depth = 2;
+
+
+ pub fn get_depth(&self) -> u32 {
+ self.depth
+ }
+ pub fn clear_depth(&mut self) {
+ self.depth = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_depth(&mut self, v: u32) {
+ self.depth = v;
+ }
+
+ // uint32 dhtRecordCount = 3;
+
+
+ pub fn get_dhtRecordCount(&self) -> u32 {
+ self.dhtRecordCount
+ }
+ pub fn clear_dhtRecordCount(&mut self) {
+ self.dhtRecordCount = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_dhtRecordCount(&mut self, v: u32) {
+ self.dhtRecordCount = v;
+ }
+
+ // int32 dhtTimeout = 4;
+
+
+ pub fn get_dhtTimeout(&self) -> i32 {
+ self.dhtTimeout
+ }
+ pub fn clear_dhtTimeout(&mut self) {
+ self.dhtTimeout = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_dhtTimeout(&mut self, v: i32) {
+ self.dhtTimeout = v;
+ }
+}
+
+impl ::protobuf::Message for NameSysResolveRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_uint32()?;
+ self.depth = tmp;
+ },
+ 3 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_uint32()?;
+ self.dhtRecordCount = tmp;
+ },
+ 4 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.dhtTimeout = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.name.is_empty() {
+ my_size += ::protobuf::rt::string_size(1, &self.name);
+ }
+ if self.depth != 0 {
+ my_size += ::protobuf::rt::value_size(2, self.depth, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if self.dhtRecordCount != 0 {
+ my_size += ::protobuf::rt::value_size(3, self.dhtRecordCount, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if self.dhtTimeout != 0 {
+ my_size += ::protobuf::rt::value_size(4, self.dhtTimeout, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.name.is_empty() {
+ os.write_string(1, &self.name)?;
+ }
+ if self.depth != 0 {
+ os.write_uint32(2, self.depth)?;
+ }
+ if self.dhtRecordCount != 0 {
+ os.write_uint32(3, self.dhtRecordCount)?;
+ }
+ if self.dhtTimeout != 0 {
+ os.write_int32(4, self.dhtTimeout)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> NameSysResolveRequest {
+ NameSysResolveRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "name",
+ |m: &NameSysResolveRequest| { &m.name },
+ |m: &mut NameSysResolveRequest| { &mut m.name },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
+ "depth",
+ |m: &NameSysResolveRequest| { &m.depth },
+ |m: &mut NameSysResolveRequest| { &mut m.depth },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
+ "dhtRecordCount",
+ |m: &NameSysResolveRequest| { &m.dhtRecordCount },
+ |m: &mut NameSysResolveRequest| { &mut m.dhtRecordCount },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
+ "dhtTimeout",
+ |m: &NameSysResolveRequest| { &m.dhtTimeout },
+ |m: &mut NameSysResolveRequest| { &mut m.dhtTimeout },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "NameSysResolveRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static NameSysResolveRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const NameSysResolveRequest,
+ };
+ unsafe {
+ instance.get(NameSysResolveRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for NameSysResolveRequest {
+ fn clear(&mut self) {
+ self.name.clear();
+ self.depth = 0;
+ self.dhtRecordCount = 0;
+ self.dhtTimeout = 0;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for NameSysResolveRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for NameSysResolveRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct NameSysResolveResult {
+ // message fields
+ pub path: ::std::string::String,
+ pub error: ::std::string::String,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a NameSysResolveResult {
+ fn default() -> &'a NameSysResolveResult {
+ ::default_instance()
+ }
+}
+
+impl NameSysResolveResult {
+ pub fn new() -> NameSysResolveResult {
+ ::std::default::Default::default()
+ }
+
+ // string path = 1;
+
+
+ pub fn get_path(&self) -> &str {
+ &self.path
+ }
+ pub fn clear_path(&mut self) {
+ self.path.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_path(&mut self, v: ::std::string::String) {
+ self.path = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_path(&mut self) -> &mut ::std::string::String {
+ &mut self.path
+ }
+
+ // Take field
+ pub fn take_path(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.path, ::std::string::String::new())
+ }
+
+ // string error = 2;
+
+
+ pub fn get_error(&self) -> &str {
+ &self.error
+ }
+ pub fn clear_error(&mut self) {
+ self.error.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_error(&mut self, v: ::std::string::String) {
+ self.error = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_error(&mut self) -> &mut ::std::string::String {
+ &mut self.error
+ }
+
+ // Take field
+ pub fn take_error(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.error, ::std::string::String::new())
+ }
+}
+
+impl ::protobuf::Message for NameSysResolveResult {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.path)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.error)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.path.is_empty() {
+ my_size += ::protobuf::rt::string_size(1, &self.path);
+ }
+ if !self.error.is_empty() {
+ my_size += ::protobuf::rt::string_size(2, &self.error);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.path.is_empty() {
+ os.write_string(1, &self.path)?;
+ }
+ if !self.error.is_empty() {
+ os.write_string(2, &self.error)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> NameSysResolveResult {
+ NameSysResolveResult::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "path",
+ |m: &NameSysResolveResult| { &m.path },
+ |m: &mut NameSysResolveResult| { &mut m.path },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "error",
+ |m: &NameSysResolveResult| { &m.error },
+ |m: &mut NameSysResolveResult| { &mut m.error },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "NameSysResolveResult",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static NameSysResolveResult {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const NameSysResolveResult,
+ };
+ unsafe {
+ instance.get(NameSysResolveResult::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for NameSysResolveResult {
+ fn clear(&mut self) {
+ self.path.clear();
+ self.error.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for NameSysResolveResult {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for NameSysResolveResult {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct NameSysPublishRequest {
+ // message fields
+ pub privateKey: ::std::vec::Vec,
+ pub value: ::std::string::String,
+ pub eol: i32,
+ pub ttl: i32,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a NameSysPublishRequest {
+ fn default() -> &'a NameSysPublishRequest {
+ ::default_instance()
+ }
+}
+
+impl NameSysPublishRequest {
+ pub fn new() -> NameSysPublishRequest {
+ ::std::default::Default::default()
+ }
+
+ // bytes privateKey = 1;
+
+
+ pub fn get_privateKey(&self) -> &[u8] {
+ &self.privateKey
+ }
+ pub fn clear_privateKey(&mut self) {
+ self.privateKey.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_privateKey(&mut self, v: ::std::vec::Vec) {
+ self.privateKey = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_privateKey(&mut self) -> &mut ::std::vec::Vec {
+ &mut self.privateKey
+ }
+
+ // Take field
+ pub fn take_privateKey(&mut self) -> ::std::vec::Vec {
+ ::std::mem::replace(&mut self.privateKey, ::std::vec::Vec::new())
+ }
+
+ // string value = 2;
+
+
+ pub fn get_value(&self) -> &str {
+ &self.value
+ }
+ pub fn clear_value(&mut self) {
+ self.value.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_value(&mut self, v: ::std::string::String) {
+ self.value = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_value(&mut self) -> &mut ::std::string::String {
+ &mut self.value
+ }
+
+ // Take field
+ pub fn take_value(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.value, ::std::string::String::new())
+ }
+
+ // int32 eol = 3;
+
+
+ pub fn get_eol(&self) -> i32 {
+ self.eol
+ }
+ pub fn clear_eol(&mut self) {
+ self.eol = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_eol(&mut self, v: i32) {
+ self.eol = v;
+ }
+
+ // int32 ttl = 4;
+
+
+ pub fn get_ttl(&self) -> i32 {
+ self.ttl
+ }
+ pub fn clear_ttl(&mut self) {
+ self.ttl = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_ttl(&mut self, v: i32) {
+ self.ttl = v;
+ }
+}
+
+impl ::protobuf::Message for NameSysPublishRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.privateKey)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
+ },
+ 3 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.eol = tmp;
+ },
+ 4 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.ttl = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.privateKey.is_empty() {
+ my_size += ::protobuf::rt::bytes_size(1, &self.privateKey);
+ }
+ if !self.value.is_empty() {
+ my_size += ::protobuf::rt::string_size(2, &self.value);
+ }
+ if self.eol != 0 {
+ my_size += ::protobuf::rt::value_size(3, self.eol, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if self.ttl != 0 {
+ my_size += ::protobuf::rt::value_size(4, self.ttl, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.privateKey.is_empty() {
+ os.write_bytes(1, &self.privateKey)?;
+ }
+ if !self.value.is_empty() {
+ os.write_string(2, &self.value)?;
+ }
+ if self.eol != 0 {
+ os.write_int32(3, self.eol)?;
+ }
+ if self.ttl != 0 {
+ os.write_int32(4, self.ttl)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> NameSysPublishRequest {
+ NameSysPublishRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "privateKey",
+ |m: &NameSysPublishRequest| { &m.privateKey },
+ |m: &mut NameSysPublishRequest| { &mut m.privateKey },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "value",
+ |m: &NameSysPublishRequest| { &m.value },
+ |m: &mut NameSysPublishRequest| { &mut m.value },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
+ "eol",
+ |m: &NameSysPublishRequest| { &m.eol },
+ |m: &mut NameSysPublishRequest| { &mut m.eol },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
+ "ttl",
+ |m: &NameSysPublishRequest| { &m.ttl },
+ |m: &mut NameSysPublishRequest| { &mut m.ttl },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "NameSysPublishRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static NameSysPublishRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const NameSysPublishRequest,
+ };
+ unsafe {
+ instance.get(NameSysPublishRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for NameSysPublishRequest {
+ fn clear(&mut self) {
+ self.privateKey.clear();
+ self.value.clear();
+ self.eol = 0;
+ self.ttl = 0;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for NameSysPublishRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for NameSysPublishRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+static file_descriptor_proto_data: &'static [u8] = b"\
+ \n\rnamesys.proto\x12\x02pb\x1a\nutil.proto\"\x89\x01\n\x15NameSysResolv\
+ eRequest\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x14\n\x05dept\
+ h\x18\x02\x20\x01(\rR\x05depth\x12&\n\x0edhtRecordCount\x18\x03\x20\x01(\
+ \rR\x0edhtRecordCount\x12\x1e\n\ndhtTimeout\x18\x04\x20\x01(\x05R\ndhtTi\
+ meout\"@\n\x14NameSysResolveResult\x12\x12\n\x04path\x18\x01\x20\x01(\tR\
+ \x04path\x12\x14\n\x05error\x18\x02\x20\x01(\tR\x05error\"q\n\x15NameSys\
+ PublishRequest\x12\x1e\n\nprivateKey\x18\x01\x20\x01(\x0cR\nprivateKey\
+ \x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value\x12\x10\n\x03eol\x18\
+ \x03\x20\x01(\x05R\x03eol\x12\x10\n\x03ttl\x18\x04\x20\x01(\x05R\x03ttl2\
+ \xdf\x01\n\nNameSysAPI\x12G\n\x0eNameSysResolve\x12\x19.pb.NameSysResolv\
+ eRequest\x1a\x18.pb.NameSysResolveResult\"\0\x12N\n\x13NameSysResolveAsy\
+ nc\x12\x19.pb.NameSysResolveRequest\x1a\x18.pb.NameSysResolveResult\"\00\
+ \x01\x128\n\x0eNameSysPublish\x12\x19.pb.NameSysPublishRequest\x1a\t.pb.\
+ Empty\"\0J\xf6\x0f\n\x06\x12\x04\0\02\x01\n\x08\n\x01\x0c\x12\x03\0\0\
+ \x12\n\x08\n\x01\x02\x12\x03\x01\x08\n\n\t\n\x02\x03\0\x12\x03\x02\x07\
+ \x13\n?\n\x02\x06\0\x12\x04\x05\0\r\x01\x1a3\x20NameSysAPI\x20provides\
+ \x20a\x20generic\x20name\x20resolution\x20API\n\n\n\n\x03\x06\0\x01\x12\
+ \x03\x05\x08\x12\n\\\n\x04\x06\0\x02\0\x12\x03\x07\x04P\x1aO\x20NameSysR\
+ esolve\x20is\x20used\x20to\x20resolve\x20a\x20name,\x20waiting\x20for\
+ \x20the\x20request\x20to\x20complete\n\n\x0c\n\x05\x06\0\x02\0\x01\x12\
+ \x03\x07\x08\x16\n\x0c\n\x05\x06\0\x02\0\x02\x12\x03\x07\x17,\n\x0c\n\
+ \x05\x06\0\x02\0\x03\x12\x03\x077K\n\xa3\x01\n\x04\x06\0\x02\x01\x12\x03\
+ \n\x04\\\x1a\x95\x01\x20NameSysResolveAsync\x20is\x20like\x20Resolve,\
+ \x20except\x20instead\x20of\x20waiting\x20for\x20the\x20request\n\x20to\
+ \x20complete,\x20we\x20send\x20back\x20a\x20stream\x20which\x20we\x20wil\
+ l\x20send\x20the\x20result\x20on\n\n\x0c\n\x05\x06\0\x02\x01\x01\x12\x03\
+ \n\x08\x1b\n\x0c\n\x05\x06\0\x02\x01\x02\x12\x03\n\x1c1\n\x0c\n\x05\x06\
+ \0\x02\x01\x06\x12\x03\n\n\x02\x04\x02\x12\
+ \x04&\02\x01\x1a2\x20NameSysPublishRequest\x20is\x20used\x20to\x20publis\
+ h\x20a\x20value\n\n\n\n\x03\x04\x02\x01\x12\x03&\x08\x1d\n5\n\x04\x04\
+ \x02\x02\0\x12\x03(\x04\x19\x1a(\x20the\x20private\x20key\x20(name)\x20f\
+ or\x20this\x20record\n\n\r\n\x05\x04\x02\x02\0\x04\x12\x04(\x04&\x1f\n\
+ \x0c\n\x05\x04\x02\x02\0\x05\x12\x03(\x04\t\n\x0c\n\x05\x04\x02\x02\0\
+ \x01\x12\x03(\n\x14\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03(\x17\x18\n'\n\
+ \x04\x04\x02\x02\x01\x12\x03*\x04\x15\x1a\x1a\x20the\x20value\x20of\x20t\
+ his\x20record\n\n\r\n\x05\x04\x02\x02\x01\x04\x12\x04*\x04(\x19\n\x0c\n\
+ \x05\x04\x02\x02\x01\x05\x12\x03*\x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\
+ \x12\x03*\x0b\x10\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03*\x13\x14\n\x80\
+ \x01\n\x04\x04\x02\x02\x02\x12\x03.\x04\x13\x1as\x20the\x20eol\x20for\
+ \x20this\x20publish,\x20if\x200\x20implies\n\x20as\x20NameSys::Publish\
+ \x20call,\x20if\x20non\x200\x20implies\n\x20a\x20NameSys:PublishWithEOL\
+ \x20call\n\n\r\n\x05\x04\x02\x02\x02\x04\x12\x04.\x04*\x15\n\x0c\n\x05\
+ \x04\x02\x02\x02\x05\x12\x03.\x04\t\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\
+ \x03.\x0b\x0e\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03.\x11\x12\nO\n\x04\
+ \x04\x02\x02\x03\x12\x031\x04\x13\x1aB\x20if\x20set,\x20allows\x20us\x20\
+ to\x20override\x20default\n\x20ttl\x20value\x20of\x20ipns\x20records\n\n\
+ \r\n\x05\x04\x02\x02\x03\x04\x12\x041\x04.\x13\n\x0c\n\x05\x04\x02\x02\
+ \x03\x05\x12\x031\x04\t\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x031\x0b\x0e\
+ \n\x0c\n\x05\x04\x02\x02\x03\x03\x12\x031\x11\x12b\x06proto3\
+";
+
+static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
+};
+
+fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
+ ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
+}
+
+pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
+ unsafe {
+ file_descriptor_proto_lazy.get(|| {
+ parse_descriptor_proto()
+ })
+ }
+}
diff --git a/rs/src/namesys_grpc.rs b/rs/src/namesys_grpc.rs
new file mode 100644
index 0000000..50aea18
--- /dev/null
+++ b/rs/src/namesys_grpc.rs
@@ -0,0 +1,119 @@
+// This file is generated. Do not edit
+// @generated
+
+// https://github.com/Manishearth/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unsafe_code)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+
+const METHOD_NAME_SYS_API_NAME_SYS_RESOLVE: ::grpcio::Method = ::grpcio::Method {
+ ty: ::grpcio::MethodType::Unary,
+ name: "/pb.NameSysAPI/NameSysResolve",
+ req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+ resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+};
+
+const METHOD_NAME_SYS_API_NAME_SYS_RESOLVE_ASYNC: ::grpcio::Method = ::grpcio::Method {
+ ty: ::grpcio::MethodType::ServerStreaming,
+ name: "/pb.NameSysAPI/NameSysResolveAsync",
+ req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+ resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+};
+
+const METHOD_NAME_SYS_API_NAME_SYS_PUBLISH: ::grpcio::Method = ::grpcio::Method {
+ ty: ::grpcio::MethodType::Unary,
+ name: "/pb.NameSysAPI/NameSysPublish",
+ req_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+ resp_mar: ::grpcio::Marshaller { ser: ::grpcio::pb_ser, de: ::grpcio::pb_de },
+};
+
+#[derive(Clone)]
+pub struct NameSysApiClient {
+ client: ::grpcio::Client,
+}
+
+impl NameSysApiClient {
+ pub fn new(channel: ::grpcio::Channel) -> Self {
+ NameSysApiClient {
+ client: ::grpcio::Client::new(channel),
+ }
+ }
+
+ pub fn name_sys_resolve_opt(&self, req: &super::namesys::NameSysResolveRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result {
+ self.client.unary_call(&METHOD_NAME_SYS_API_NAME_SYS_RESOLVE, req, opt)
+ }
+
+ pub fn name_sys_resolve(&self, req: &super::namesys::NameSysResolveRequest) -> ::grpcio::Result {
+ self.name_sys_resolve_opt(req, ::grpcio::CallOption::default())
+ }
+
+ pub fn name_sys_resolve_async_opt(&self, req: &super::namesys::NameSysResolveRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.client.unary_call_async(&METHOD_NAME_SYS_API_NAME_SYS_RESOLVE, req, opt)
+ }
+
+ pub fn name_sys_resolve_async(&self, req: &super::namesys::NameSysResolveRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.name_sys_resolve_async_opt(req, ::grpcio::CallOption::default())
+ }
+
+ pub fn name_sys_resolve_async_opt(&self, req: &super::namesys::NameSysResolveRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> {
+ self.client.server_streaming(&METHOD_NAME_SYS_API_NAME_SYS_RESOLVE_ASYNC, req, opt)
+ }
+
+ pub fn name_sys_resolve_async(&self, req: &super::namesys::NameSysResolveRequest) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> {
+ self.name_sys_resolve_async_opt(req, ::grpcio::CallOption::default())
+ }
+
+ pub fn name_sys_publish_opt(&self, req: &super::namesys::NameSysPublishRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result {
+ self.client.unary_call(&METHOD_NAME_SYS_API_NAME_SYS_PUBLISH, req, opt)
+ }
+
+ pub fn name_sys_publish(&self, req: &super::namesys::NameSysPublishRequest) -> ::grpcio::Result {
+ self.name_sys_publish_opt(req, ::grpcio::CallOption::default())
+ }
+
+ pub fn name_sys_publish_async_opt(&self, req: &super::namesys::NameSysPublishRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.client.unary_call_async(&METHOD_NAME_SYS_API_NAME_SYS_PUBLISH, req, opt)
+ }
+
+ pub fn name_sys_publish_async(&self, req: &super::namesys::NameSysPublishRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> {
+ self.name_sys_publish_async_opt(req, ::grpcio::CallOption::default())
+ }
+ pub fn spawn(&self, f: F) where F: ::futures::Future
- + Send + 'static {
+ self.client.spawn(f)
+ }
+}
+
+pub trait NameSysApi {
+ fn name_sys_resolve(&mut self, ctx: ::grpcio::RpcContext, req: super::namesys::NameSysResolveRequest, sink: ::grpcio::UnarySink);
+ fn name_sys_resolve_async(&mut self, ctx: ::grpcio::RpcContext, req: super::namesys::NameSysResolveRequest, sink: ::grpcio::ServerStreamingSink);
+ fn name_sys_publish(&mut self, ctx: ::grpcio::RpcContext, req: super::namesys::NameSysPublishRequest, sink: ::grpcio::UnarySink);
+}
+
+pub fn create_name_sys_api(s: S) -> ::grpcio::Service {
+ let mut builder = ::grpcio::ServiceBuilder::new();
+ let mut instance = s.clone();
+ builder = builder.add_unary_handler(&METHOD_NAME_SYS_API_NAME_SYS_RESOLVE, move |ctx, req, resp| {
+ instance.name_sys_resolve(ctx, req, resp)
+ });
+ let mut instance = s.clone();
+ builder = builder.add_server_streaming_handler(&METHOD_NAME_SYS_API_NAME_SYS_RESOLVE_ASYNC, move |ctx, req, resp| {
+ instance.name_sys_resolve_async(ctx, req, resp)
+ });
+ let mut instance = s;
+ builder = builder.add_unary_handler(&METHOD_NAME_SYS_API_NAME_SYS_PUBLISH, move |ctx, req, resp| {
+ instance.name_sys_publish(ctx, req, resp)
+ });
+ builder.build()
+}
diff --git a/rs/src/node.rs b/rs/src/node.rs
new file mode 100644
index 0000000..abecae1
--- /dev/null
+++ b/rs/src/node.rs
@@ -0,0 +1,6113 @@
+// This file is generated by rust-protobuf 2.10.2. Do not edit
+// @generated
+
+// https://github.com/rust-lang/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unsafe_code)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+//! Generated file from `node.proto`
+
+use protobuf::Message as Message_imported_for_functions;
+use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
+
+/// Generated files are compatible only with the same version
+/// of protobuf runtime.
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_10_2;
+
+#[derive(PartialEq,Clone,Default)]
+pub struct P2PRequest {
+ // message fields
+ pub requestType: P2PREQTYPE,
+ pub all: bool,
+ pub verbose: bool,
+ pub protocolName: ::std::string::String,
+ pub listenAddress: ::std::string::String,
+ pub targetAddress: ::std::string::String,
+ pub remoteAddress: ::std::string::String,
+ pub allowCustomProtocols: bool,
+ pub reportPeerID: bool,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a P2PRequest {
+ fn default() -> &'a P2PRequest {
+ ::default_instance()
+ }
+}
+
+impl P2PRequest {
+ pub fn new() -> P2PRequest {
+ ::std::default::Default::default()
+ }
+
+ // .pb.P2PREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> P2PREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = P2PREQTYPE::CLOSE;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: P2PREQTYPE) {
+ self.requestType = v;
+ }
+
+ // bool all = 2;
+
+
+ pub fn get_all(&self) -> bool {
+ self.all
+ }
+ pub fn clear_all(&mut self) {
+ self.all = false;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_all(&mut self, v: bool) {
+ self.all = v;
+ }
+
+ // bool verbose = 3;
+
+
+ pub fn get_verbose(&self) -> bool {
+ self.verbose
+ }
+ pub fn clear_verbose(&mut self) {
+ self.verbose = false;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_verbose(&mut self, v: bool) {
+ self.verbose = v;
+ }
+
+ // string protocolName = 4;
+
+
+ pub fn get_protocolName(&self) -> &str {
+ &self.protocolName
+ }
+ pub fn clear_protocolName(&mut self) {
+ self.protocolName.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_protocolName(&mut self, v: ::std::string::String) {
+ self.protocolName = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_protocolName(&mut self) -> &mut ::std::string::String {
+ &mut self.protocolName
+ }
+
+ // Take field
+ pub fn take_protocolName(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.protocolName, ::std::string::String::new())
+ }
+
+ // string listenAddress = 5;
+
+
+ pub fn get_listenAddress(&self) -> &str {
+ &self.listenAddress
+ }
+ pub fn clear_listenAddress(&mut self) {
+ self.listenAddress.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_listenAddress(&mut self, v: ::std::string::String) {
+ self.listenAddress = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_listenAddress(&mut self) -> &mut ::std::string::String {
+ &mut self.listenAddress
+ }
+
+ // Take field
+ pub fn take_listenAddress(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.listenAddress, ::std::string::String::new())
+ }
+
+ // string targetAddress = 6;
+
+
+ pub fn get_targetAddress(&self) -> &str {
+ &self.targetAddress
+ }
+ pub fn clear_targetAddress(&mut self) {
+ self.targetAddress.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_targetAddress(&mut self, v: ::std::string::String) {
+ self.targetAddress = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_targetAddress(&mut self) -> &mut ::std::string::String {
+ &mut self.targetAddress
+ }
+
+ // Take field
+ pub fn take_targetAddress(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.targetAddress, ::std::string::String::new())
+ }
+
+ // string remoteAddress = 7;
+
+
+ pub fn get_remoteAddress(&self) -> &str {
+ &self.remoteAddress
+ }
+ pub fn clear_remoteAddress(&mut self) {
+ self.remoteAddress.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_remoteAddress(&mut self, v: ::std::string::String) {
+ self.remoteAddress = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_remoteAddress(&mut self) -> &mut ::std::string::String {
+ &mut self.remoteAddress
+ }
+
+ // Take field
+ pub fn take_remoteAddress(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.remoteAddress, ::std::string::String::new())
+ }
+
+ // bool allowCustomProtocols = 8;
+
+
+ pub fn get_allowCustomProtocols(&self) -> bool {
+ self.allowCustomProtocols
+ }
+ pub fn clear_allowCustomProtocols(&mut self) {
+ self.allowCustomProtocols = false;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_allowCustomProtocols(&mut self, v: bool) {
+ self.allowCustomProtocols = v;
+ }
+
+ // bool reportPeerID = 9;
+
+
+ pub fn get_reportPeerID(&self) -> bool {
+ self.reportPeerID
+ }
+ pub fn clear_reportPeerID(&mut self) {
+ self.reportPeerID = false;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_reportPeerID(&mut self, v: bool) {
+ self.reportPeerID = v;
+ }
+}
+
+impl ::protobuf::Message for P2PRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_bool()?;
+ self.all = tmp;
+ },
+ 3 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_bool()?;
+ self.verbose = tmp;
+ },
+ 4 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.protocolName)?;
+ },
+ 5 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.listenAddress)?;
+ },
+ 6 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.targetAddress)?;
+ },
+ 7 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.remoteAddress)?;
+ },
+ 8 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_bool()?;
+ self.allowCustomProtocols = tmp;
+ },
+ 9 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_bool()?;
+ self.reportPeerID = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != P2PREQTYPE::CLOSE {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ if self.all != false {
+ my_size += 2;
+ }
+ if self.verbose != false {
+ my_size += 2;
+ }
+ if !self.protocolName.is_empty() {
+ my_size += ::protobuf::rt::string_size(4, &self.protocolName);
+ }
+ if !self.listenAddress.is_empty() {
+ my_size += ::protobuf::rt::string_size(5, &self.listenAddress);
+ }
+ if !self.targetAddress.is_empty() {
+ my_size += ::protobuf::rt::string_size(6, &self.targetAddress);
+ }
+ if !self.remoteAddress.is_empty() {
+ my_size += ::protobuf::rt::string_size(7, &self.remoteAddress);
+ }
+ if self.allowCustomProtocols != false {
+ my_size += 2;
+ }
+ if self.reportPeerID != false {
+ my_size += 2;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != P2PREQTYPE::CLOSE {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ if self.all != false {
+ os.write_bool(2, self.all)?;
+ }
+ if self.verbose != false {
+ os.write_bool(3, self.verbose)?;
+ }
+ if !self.protocolName.is_empty() {
+ os.write_string(4, &self.protocolName)?;
+ }
+ if !self.listenAddress.is_empty() {
+ os.write_string(5, &self.listenAddress)?;
+ }
+ if !self.targetAddress.is_empty() {
+ os.write_string(6, &self.targetAddress)?;
+ }
+ if !self.remoteAddress.is_empty() {
+ os.write_string(7, &self.remoteAddress)?;
+ }
+ if self.allowCustomProtocols != false {
+ os.write_bool(8, self.allowCustomProtocols)?;
+ }
+ if self.reportPeerID != false {
+ os.write_bool(9, self.reportPeerID)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> P2PRequest {
+ P2PRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &P2PRequest| { &m.requestType },
+ |m: &mut P2PRequest| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
+ "all",
+ |m: &P2PRequest| { &m.all },
+ |m: &mut P2PRequest| { &mut m.all },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
+ "verbose",
+ |m: &P2PRequest| { &m.verbose },
+ |m: &mut P2PRequest| { &mut m.verbose },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "protocolName",
+ |m: &P2PRequest| { &m.protocolName },
+ |m: &mut P2PRequest| { &mut m.protocolName },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "listenAddress",
+ |m: &P2PRequest| { &m.listenAddress },
+ |m: &mut P2PRequest| { &mut m.listenAddress },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "targetAddress",
+ |m: &P2PRequest| { &m.targetAddress },
+ |m: &mut P2PRequest| { &mut m.targetAddress },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "remoteAddress",
+ |m: &P2PRequest| { &m.remoteAddress },
+ |m: &mut P2PRequest| { &mut m.remoteAddress },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
+ "allowCustomProtocols",
+ |m: &P2PRequest| { &m.allowCustomProtocols },
+ |m: &mut P2PRequest| { &mut m.allowCustomProtocols },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
+ "reportPeerID",
+ |m: &P2PRequest| { &m.reportPeerID },
+ |m: &mut P2PRequest| { &mut m.reportPeerID },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "P2PRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static P2PRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const P2PRequest,
+ };
+ unsafe {
+ instance.get(P2PRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for P2PRequest {
+ fn clear(&mut self) {
+ self.requestType = P2PREQTYPE::CLOSE;
+ self.all = false;
+ self.verbose = false;
+ self.protocolName.clear();
+ self.listenAddress.clear();
+ self.targetAddress.clear();
+ self.remoteAddress.clear();
+ self.allowCustomProtocols = false;
+ self.reportPeerID = false;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for P2PRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for P2PRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct P2PResponse {
+ // message fields
+ pub requestType: P2PREQTYPE,
+ pub names: ::protobuf::RepeatedField<::std::string::String>,
+ pub connsClosed: i32,
+ pub streamInfos: ::protobuf::RepeatedField,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a P2PResponse {
+ fn default() -> &'a P2PResponse {
+ ::default_instance()
+ }
+}
+
+impl P2PResponse {
+ pub fn new() -> P2PResponse {
+ ::std::default::Default::default()
+ }
+
+ // .pb.P2PREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> P2PREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = P2PREQTYPE::CLOSE;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: P2PREQTYPE) {
+ self.requestType = v;
+ }
+
+ // repeated string names = 2;
+
+
+ pub fn get_names(&self) -> &[::std::string::String] {
+ &self.names
+ }
+ pub fn clear_names(&mut self) {
+ self.names.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_names(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.names = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_names(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.names
+ }
+
+ // Take field
+ pub fn take_names(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.names, ::protobuf::RepeatedField::new())
+ }
+
+ // int32 connsClosed = 3;
+
+
+ pub fn get_connsClosed(&self) -> i32 {
+ self.connsClosed
+ }
+ pub fn clear_connsClosed(&mut self) {
+ self.connsClosed = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_connsClosed(&mut self, v: i32) {
+ self.connsClosed = v;
+ }
+
+ // repeated .pb.P2PLsInfo streamInfos = 4;
+
+
+ pub fn get_streamInfos(&self) -> &[P2PLsInfo] {
+ &self.streamInfos
+ }
+ pub fn clear_streamInfos(&mut self) {
+ self.streamInfos.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_streamInfos(&mut self, v: ::protobuf::RepeatedField) {
+ self.streamInfos = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_streamInfos(&mut self) -> &mut ::protobuf::RepeatedField {
+ &mut self.streamInfos
+ }
+
+ // Take field
+ pub fn take_streamInfos(&mut self) -> ::protobuf::RepeatedField {
+ ::std::mem::replace(&mut self.streamInfos, ::protobuf::RepeatedField::new())
+ }
+}
+
+impl ::protobuf::Message for P2PResponse {
+ fn is_initialized(&self) -> bool {
+ for v in &self.streamInfos {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.names)?;
+ },
+ 3 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.connsClosed = tmp;
+ },
+ 4 => {
+ ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.streamInfos)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != P2PREQTYPE::CLOSE {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ for value in &self.names {
+ my_size += ::protobuf::rt::string_size(2, &value);
+ };
+ if self.connsClosed != 0 {
+ my_size += ::protobuf::rt::value_size(3, self.connsClosed, ::protobuf::wire_format::WireTypeVarint);
+ }
+ for value in &self.streamInfos {
+ let len = value.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != P2PREQTYPE::CLOSE {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ for v in &self.names {
+ os.write_string(2, &v)?;
+ };
+ if self.connsClosed != 0 {
+ os.write_int32(3, self.connsClosed)?;
+ }
+ for v in &self.streamInfos {
+ os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ };
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> P2PResponse {
+ P2PResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &P2PResponse| { &m.requestType },
+ |m: &mut P2PResponse| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "names",
+ |m: &P2PResponse| { &m.names },
+ |m: &mut P2PResponse| { &mut m.names },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
+ "connsClosed",
+ |m: &P2PResponse| { &m.connsClosed },
+ |m: &mut P2PResponse| { &mut m.connsClosed },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>(
+ "streamInfos",
+ |m: &P2PResponse| { &m.streamInfos },
+ |m: &mut P2PResponse| { &mut m.streamInfos },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "P2PResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static P2PResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const P2PResponse,
+ };
+ unsafe {
+ instance.get(P2PResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for P2PResponse {
+ fn clear(&mut self) {
+ self.requestType = P2PREQTYPE::CLOSE;
+ self.names.clear();
+ self.connsClosed = 0;
+ self.streamInfos.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for P2PResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for P2PResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct P2PLsInfo {
+ // message fields
+ pub protocolName: ::std::string::String,
+ pub listenAddress: ::std::string::String,
+ pub targetAddress: ::std::string::String,
+ pub local: bool,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a P2PLsInfo {
+ fn default() -> &'a P2PLsInfo {
+ ::default_instance()
+ }
+}
+
+impl P2PLsInfo {
+ pub fn new() -> P2PLsInfo {
+ ::std::default::Default::default()
+ }
+
+ // string protocolName = 1;
+
+
+ pub fn get_protocolName(&self) -> &str {
+ &self.protocolName
+ }
+ pub fn clear_protocolName(&mut self) {
+ self.protocolName.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_protocolName(&mut self, v: ::std::string::String) {
+ self.protocolName = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_protocolName(&mut self) -> &mut ::std::string::String {
+ &mut self.protocolName
+ }
+
+ // Take field
+ pub fn take_protocolName(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.protocolName, ::std::string::String::new())
+ }
+
+ // string listenAddress = 2;
+
+
+ pub fn get_listenAddress(&self) -> &str {
+ &self.listenAddress
+ }
+ pub fn clear_listenAddress(&mut self) {
+ self.listenAddress.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_listenAddress(&mut self, v: ::std::string::String) {
+ self.listenAddress = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_listenAddress(&mut self) -> &mut ::std::string::String {
+ &mut self.listenAddress
+ }
+
+ // Take field
+ pub fn take_listenAddress(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.listenAddress, ::std::string::String::new())
+ }
+
+ // string targetAddress = 3;
+
+
+ pub fn get_targetAddress(&self) -> &str {
+ &self.targetAddress
+ }
+ pub fn clear_targetAddress(&mut self) {
+ self.targetAddress.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_targetAddress(&mut self, v: ::std::string::String) {
+ self.targetAddress = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_targetAddress(&mut self) -> &mut ::std::string::String {
+ &mut self.targetAddress
+ }
+
+ // Take field
+ pub fn take_targetAddress(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.targetAddress, ::std::string::String::new())
+ }
+
+ // bool local = 4;
+
+
+ pub fn get_local(&self) -> bool {
+ self.local
+ }
+ pub fn clear_local(&mut self) {
+ self.local = false;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_local(&mut self, v: bool) {
+ self.local = v;
+ }
+}
+
+impl ::protobuf::Message for P2PLsInfo {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.protocolName)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.listenAddress)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.targetAddress)?;
+ },
+ 4 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_bool()?;
+ self.local = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.protocolName.is_empty() {
+ my_size += ::protobuf::rt::string_size(1, &self.protocolName);
+ }
+ if !self.listenAddress.is_empty() {
+ my_size += ::protobuf::rt::string_size(2, &self.listenAddress);
+ }
+ if !self.targetAddress.is_empty() {
+ my_size += ::protobuf::rt::string_size(3, &self.targetAddress);
+ }
+ if self.local != false {
+ my_size += 2;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.protocolName.is_empty() {
+ os.write_string(1, &self.protocolName)?;
+ }
+ if !self.listenAddress.is_empty() {
+ os.write_string(2, &self.listenAddress)?;
+ }
+ if !self.targetAddress.is_empty() {
+ os.write_string(3, &self.targetAddress)?;
+ }
+ if self.local != false {
+ os.write_bool(4, self.local)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> P2PLsInfo {
+ P2PLsInfo::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "protocolName",
+ |m: &P2PLsInfo| { &m.protocolName },
+ |m: &mut P2PLsInfo| { &mut m.protocolName },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "listenAddress",
+ |m: &P2PLsInfo| { &m.listenAddress },
+ |m: &mut P2PLsInfo| { &mut m.listenAddress },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "targetAddress",
+ |m: &P2PLsInfo| { &m.targetAddress },
+ |m: &mut P2PLsInfo| { &mut m.targetAddress },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
+ "local",
+ |m: &P2PLsInfo| { &m.local },
+ |m: &mut P2PLsInfo| { &mut m.local },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "P2PLsInfo",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static P2PLsInfo {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const P2PLsInfo,
+ };
+ unsafe {
+ instance.get(P2PLsInfo::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for P2PLsInfo {
+ fn clear(&mut self) {
+ self.protocolName.clear();
+ self.listenAddress.clear();
+ self.targetAddress.clear();
+ self.local = false;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for P2PLsInfo {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for P2PLsInfo {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct GetPeersResponse {
+ // message fields
+ pub peerIDs: ::protobuf::RepeatedField<::std::string::String>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a GetPeersResponse {
+ fn default() -> &'a GetPeersResponse {
+ ::default_instance()
+ }
+}
+
+impl GetPeersResponse {
+ pub fn new() -> GetPeersResponse {
+ ::std::default::Default::default()
+ }
+
+ // repeated string peerIDs = 1;
+
+
+ pub fn get_peerIDs(&self) -> &[::std::string::String] {
+ &self.peerIDs
+ }
+ pub fn clear_peerIDs(&mut self) {
+ self.peerIDs.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_peerIDs(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.peerIDs = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_peerIDs(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.peerIDs
+ }
+
+ // Take field
+ pub fn take_peerIDs(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.peerIDs, ::protobuf::RepeatedField::new())
+ }
+}
+
+impl ::protobuf::Message for GetPeersResponse {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.peerIDs)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ for value in &self.peerIDs {
+ my_size += ::protobuf::rt::string_size(1, &value);
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ for v in &self.peerIDs {
+ os.write_string(1, &v)?;
+ };
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> GetPeersResponse {
+ GetPeersResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "peerIDs",
+ |m: &GetPeersResponse| { &m.peerIDs },
+ |m: &mut GetPeersResponse| { &mut m.peerIDs },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "GetPeersResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static GetPeersResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const GetPeersResponse,
+ };
+ unsafe {
+ instance.get(GetPeersResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for GetPeersResponse {
+ fn clear(&mut self) {
+ self.peerIDs.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for GetPeersResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for GetPeersResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct ConnMgmtRequest {
+ // message fields
+ pub requestType: CONNMGMTREQTYPE,
+ pub multiAddrs: ::protobuf::RepeatedField<::std::string::String>,
+ pub peerIDs: ::protobuf::RepeatedField<::std::string::String>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a ConnMgmtRequest {
+ fn default() -> &'a ConnMgmtRequest {
+ ::default_instance()
+ }
+}
+
+impl ConnMgmtRequest {
+ pub fn new() -> ConnMgmtRequest {
+ ::std::default::Default::default()
+ }
+
+ // .pb.CONNMGMTREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> CONNMGMTREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = CONNMGMTREQTYPE::CM_CONNECT;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: CONNMGMTREQTYPE) {
+ self.requestType = v;
+ }
+
+ // repeated string multiAddrs = 2;
+
+
+ pub fn get_multiAddrs(&self) -> &[::std::string::String] {
+ &self.multiAddrs
+ }
+ pub fn clear_multiAddrs(&mut self) {
+ self.multiAddrs.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_multiAddrs(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.multiAddrs = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_multiAddrs(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.multiAddrs
+ }
+
+ // Take field
+ pub fn take_multiAddrs(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.multiAddrs, ::protobuf::RepeatedField::new())
+ }
+
+ // repeated string peerIDs = 3;
+
+
+ pub fn get_peerIDs(&self) -> &[::std::string::String] {
+ &self.peerIDs
+ }
+ pub fn clear_peerIDs(&mut self) {
+ self.peerIDs.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_peerIDs(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.peerIDs = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_peerIDs(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.peerIDs
+ }
+
+ // Take field
+ pub fn take_peerIDs(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.peerIDs, ::protobuf::RepeatedField::new())
+ }
+}
+
+impl ::protobuf::Message for ConnMgmtRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.multiAddrs)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.peerIDs)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != CONNMGMTREQTYPE::CM_CONNECT {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ for value in &self.multiAddrs {
+ my_size += ::protobuf::rt::string_size(2, &value);
+ };
+ for value in &self.peerIDs {
+ my_size += ::protobuf::rt::string_size(3, &value);
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != CONNMGMTREQTYPE::CM_CONNECT {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ for v in &self.multiAddrs {
+ os.write_string(2, &v)?;
+ };
+ for v in &self.peerIDs {
+ os.write_string(3, &v)?;
+ };
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> ConnMgmtRequest {
+ ConnMgmtRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &ConnMgmtRequest| { &m.requestType },
+ |m: &mut ConnMgmtRequest| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "multiAddrs",
+ |m: &ConnMgmtRequest| { &m.multiAddrs },
+ |m: &mut ConnMgmtRequest| { &mut m.multiAddrs },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "peerIDs",
+ |m: &ConnMgmtRequest| { &m.peerIDs },
+ |m: &mut ConnMgmtRequest| { &mut m.peerIDs },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "ConnMgmtRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static ConnMgmtRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ConnMgmtRequest,
+ };
+ unsafe {
+ instance.get(ConnMgmtRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for ConnMgmtRequest {
+ fn clear(&mut self) {
+ self.requestType = CONNMGMTREQTYPE::CM_CONNECT;
+ self.multiAddrs.clear();
+ self.peerIDs.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for ConnMgmtRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ConnMgmtRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct ConnMgmtResponse {
+ // message fields
+ pub requestType: CONNMGMTREQTYPE,
+ pub connected: ::std::collections::HashMap<::std::string::String, bool>,
+ pub status: ::std::collections::HashMap<::std::string::String, ConnMgmtStatus>,
+ pub peerIDs: ::protobuf::RepeatedField<::std::string::String>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a ConnMgmtResponse {
+ fn default() -> &'a ConnMgmtResponse {
+ ::default_instance()
+ }
+}
+
+impl ConnMgmtResponse {
+ pub fn new() -> ConnMgmtResponse {
+ ::std::default::Default::default()
+ }
+
+ // .pb.CONNMGMTREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> CONNMGMTREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = CONNMGMTREQTYPE::CM_CONNECT;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: CONNMGMTREQTYPE) {
+ self.requestType = v;
+ }
+
+ // repeated .pb.ConnMgmtResponse.ConnectedEntry connected = 2;
+
+
+ pub fn get_connected(&self) -> &::std::collections::HashMap<::std::string::String, bool> {
+ &self.connected
+ }
+ pub fn clear_connected(&mut self) {
+ self.connected.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_connected(&mut self, v: ::std::collections::HashMap<::std::string::String, bool>) {
+ self.connected = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_connected(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, bool> {
+ &mut self.connected
+ }
+
+ // Take field
+ pub fn take_connected(&mut self) -> ::std::collections::HashMap<::std::string::String, bool> {
+ ::std::mem::replace(&mut self.connected, ::std::collections::HashMap::new())
+ }
+
+ // repeated .pb.ConnMgmtResponse.StatusEntry status = 3;
+
+
+ pub fn get_status(&self) -> &::std::collections::HashMap<::std::string::String, ConnMgmtStatus> {
+ &self.status
+ }
+ pub fn clear_status(&mut self) {
+ self.status.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_status(&mut self, v: ::std::collections::HashMap<::std::string::String, ConnMgmtStatus>) {
+ self.status = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_status(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ConnMgmtStatus> {
+ &mut self.status
+ }
+
+ // Take field
+ pub fn take_status(&mut self) -> ::std::collections::HashMap<::std::string::String, ConnMgmtStatus> {
+ ::std::mem::replace(&mut self.status, ::std::collections::HashMap::new())
+ }
+
+ // repeated string peerIDs = 4;
+
+
+ pub fn get_peerIDs(&self) -> &[::std::string::String] {
+ &self.peerIDs
+ }
+ pub fn clear_peerIDs(&mut self) {
+ self.peerIDs.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_peerIDs(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.peerIDs = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_peerIDs(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.peerIDs
+ }
+
+ // Take field
+ pub fn take_peerIDs(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.peerIDs, ::protobuf::RepeatedField::new())
+ }
+}
+
+impl ::protobuf::Message for ConnMgmtResponse {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeBool>(wire_type, is, &mut self.connected)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(wire_type, is, &mut self.status)?;
+ },
+ 4 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.peerIDs)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != CONNMGMTREQTYPE::CM_CONNECT {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeBool>(2, &self.connected);
+ my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(3, &self.status);
+ for value in &self.peerIDs {
+ my_size += ::protobuf::rt::string_size(4, &value);
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != CONNMGMTREQTYPE::CM_CONNECT {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeBool>(2, &self.connected, os)?;
+ ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(3, &self.status, os)?;
+ for v in &self.peerIDs {
+ os.write_string(4, &v)?;
+ };
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> ConnMgmtResponse {
+ ConnMgmtResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &ConnMgmtResponse| { &m.requestType },
+ |m: &mut ConnMgmtResponse| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeBool>(
+ "connected",
+ |m: &ConnMgmtResponse| { &m.connected },
+ |m: &mut ConnMgmtResponse| { &mut m.connected },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeMessage>(
+ "status",
+ |m: &ConnMgmtResponse| { &m.status },
+ |m: &mut ConnMgmtResponse| { &mut m.status },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "peerIDs",
+ |m: &ConnMgmtResponse| { &m.peerIDs },
+ |m: &mut ConnMgmtResponse| { &mut m.peerIDs },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "ConnMgmtResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static ConnMgmtResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ConnMgmtResponse,
+ };
+ unsafe {
+ instance.get(ConnMgmtResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for ConnMgmtResponse {
+ fn clear(&mut self) {
+ self.requestType = CONNMGMTREQTYPE::CM_CONNECT;
+ self.connected.clear();
+ self.status.clear();
+ self.peerIDs.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for ConnMgmtResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ConnMgmtResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct ConnMgmtStatus {
+ // message fields
+ pub disconnected: bool,
+ pub reason: ::std::string::String,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a ConnMgmtStatus {
+ fn default() -> &'a ConnMgmtStatus {
+ ::default_instance()
+ }
+}
+
+impl ConnMgmtStatus {
+ pub fn new() -> ConnMgmtStatus {
+ ::std::default::Default::default()
+ }
+
+ // bool disconnected = 1;
+
+
+ pub fn get_disconnected(&self) -> bool {
+ self.disconnected
+ }
+ pub fn clear_disconnected(&mut self) {
+ self.disconnected = false;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_disconnected(&mut self, v: bool) {
+ self.disconnected = v;
+ }
+
+ // string reason = 2;
+
+
+ pub fn get_reason(&self) -> &str {
+ &self.reason
+ }
+ pub fn clear_reason(&mut self) {
+ self.reason.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_reason(&mut self, v: ::std::string::String) {
+ self.reason = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_reason(&mut self) -> &mut ::std::string::String {
+ &mut self.reason
+ }
+
+ // Take field
+ pub fn take_reason(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.reason, ::std::string::String::new())
+ }
+}
+
+impl ::protobuf::Message for ConnMgmtStatus {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_bool()?;
+ self.disconnected = tmp;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.reason)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.disconnected != false {
+ my_size += 2;
+ }
+ if !self.reason.is_empty() {
+ my_size += ::protobuf::rt::string_size(2, &self.reason);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.disconnected != false {
+ os.write_bool(1, self.disconnected)?;
+ }
+ if !self.reason.is_empty() {
+ os.write_string(2, &self.reason)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> ConnMgmtStatus {
+ ConnMgmtStatus::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
+ "disconnected",
+ |m: &ConnMgmtStatus| { &m.disconnected },
+ |m: &mut ConnMgmtStatus| { &mut m.disconnected },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "reason",
+ |m: &ConnMgmtStatus| { &m.reason },
+ |m: &mut ConnMgmtStatus| { &mut m.reason },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "ConnMgmtStatus",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static ConnMgmtStatus {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ConnMgmtStatus,
+ };
+ unsafe {
+ instance.get(ConnMgmtStatus::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for ConnMgmtStatus {
+ fn clear(&mut self) {
+ self.disconnected = false;
+ self.reason.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for ConnMgmtStatus {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ConnMgmtStatus {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct ExtrasRequest {
+ // message fields
+ pub requestType: EXTRASREQTYPE,
+ pub extrasFeature: EXTRASTYPE,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a ExtrasRequest {
+ fn default() -> &'a ExtrasRequest {
+ ::default_instance()
+ }
+}
+
+impl ExtrasRequest {
+ pub fn new() -> ExtrasRequest {
+ ::std::default::Default::default()
+ }
+
+ // .pb.EXTRASREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> EXTRASREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = EXTRASREQTYPE::EX_ENABLE;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: EXTRASREQTYPE) {
+ self.requestType = v;
+ }
+
+ // .pb.EXTRASTYPE extrasFeature = 2;
+
+
+ pub fn get_extrasFeature(&self) -> EXTRASTYPE {
+ self.extrasFeature
+ }
+ pub fn clear_extrasFeature(&mut self) {
+ self.extrasFeature = EXTRASTYPE::IDENTIFY;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_extrasFeature(&mut self, v: EXTRASTYPE) {
+ self.extrasFeature = v;
+ }
+}
+
+impl ::protobuf::Message for ExtrasRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.extrasFeature, 2, &mut self.unknown_fields)?
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != EXTRASREQTYPE::EX_ENABLE {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ if self.extrasFeature != EXTRASTYPE::IDENTIFY {
+ my_size += ::protobuf::rt::enum_size(2, self.extrasFeature);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != EXTRASREQTYPE::EX_ENABLE {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ if self.extrasFeature != EXTRASTYPE::IDENTIFY {
+ os.write_enum(2, self.extrasFeature.value())?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> ExtrasRequest {
+ ExtrasRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &ExtrasRequest| { &m.requestType },
+ |m: &mut ExtrasRequest| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "extrasFeature",
+ |m: &ExtrasRequest| { &m.extrasFeature },
+ |m: &mut ExtrasRequest| { &mut m.extrasFeature },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "ExtrasRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static ExtrasRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ExtrasRequest,
+ };
+ unsafe {
+ instance.get(ExtrasRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for ExtrasRequest {
+ fn clear(&mut self) {
+ self.requestType = EXTRASREQTYPE::EX_ENABLE;
+ self.extrasFeature = EXTRASTYPE::IDENTIFY;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for ExtrasRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ExtrasRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct BlockstoreRequest {
+ // message fields
+ pub requestType: BSREQTYPE,
+ pub reqOpts: ::std::vec::Vec,
+ pub cids: ::protobuf::RepeatedField<::std::string::String>,
+ pub data: ::protobuf::RepeatedField<::std::vec::Vec>,
+ pub cidVersion: ::std::string::String,
+ pub hashFunc: ::std::string::String,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a BlockstoreRequest {
+ fn default() -> &'a BlockstoreRequest {
+ ::default_instance()
+ }
+}
+
+impl BlockstoreRequest {
+ pub fn new() -> BlockstoreRequest {
+ ::std::default::Default::default()
+ }
+
+ // .pb.BSREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> BSREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = BSREQTYPE::BS_DELETE;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: BSREQTYPE) {
+ self.requestType = v;
+ }
+
+ // repeated .pb.BSREQOPTS reqOpts = 2;
+
+
+ pub fn get_reqOpts(&self) -> &[BSREQOPTS] {
+ &self.reqOpts
+ }
+ pub fn clear_reqOpts(&mut self) {
+ self.reqOpts.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_reqOpts(&mut self, v: ::std::vec::Vec) {
+ self.reqOpts = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_reqOpts(&mut self) -> &mut ::std::vec::Vec {
+ &mut self.reqOpts
+ }
+
+ // Take field
+ pub fn take_reqOpts(&mut self) -> ::std::vec::Vec {
+ ::std::mem::replace(&mut self.reqOpts, ::std::vec::Vec::new())
+ }
+
+ // repeated string cids = 3;
+
+
+ pub fn get_cids(&self) -> &[::std::string::String] {
+ &self.cids
+ }
+ pub fn clear_cids(&mut self) {
+ self.cids.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_cids(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.cids = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_cids(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.cids
+ }
+
+ // Take field
+ pub fn take_cids(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.cids, ::protobuf::RepeatedField::new())
+ }
+
+ // repeated bytes data = 4;
+
+
+ pub fn get_data(&self) -> &[::std::vec::Vec] {
+ &self.data
+ }
+ pub fn clear_data(&mut self) {
+ self.data.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_data(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) {
+ self.data = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_data(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> {
+ &mut self.data
+ }
+
+ // Take field
+ pub fn take_data(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> {
+ ::std::mem::replace(&mut self.data, ::protobuf::RepeatedField::new())
+ }
+
+ // string cidVersion = 5;
+
+
+ pub fn get_cidVersion(&self) -> &str {
+ &self.cidVersion
+ }
+ pub fn clear_cidVersion(&mut self) {
+ self.cidVersion.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_cidVersion(&mut self, v: ::std::string::String) {
+ self.cidVersion = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_cidVersion(&mut self) -> &mut ::std::string::String {
+ &mut self.cidVersion
+ }
+
+ // Take field
+ pub fn take_cidVersion(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.cidVersion, ::std::string::String::new())
+ }
+
+ // string hashFunc = 7;
+
+
+ pub fn get_hashFunc(&self) -> &str {
+ &self.hashFunc
+ }
+ pub fn clear_hashFunc(&mut self) {
+ self.hashFunc.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_hashFunc(&mut self, v: ::std::string::String) {
+ self.hashFunc = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_hashFunc(&mut self) -> &mut ::std::string::String {
+ &mut self.hashFunc
+ }
+
+ // Take field
+ pub fn take_hashFunc(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.hashFunc, ::std::string::String::new())
+ }
+}
+
+impl ::protobuf::Message for BlockstoreRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_repeated_enum_with_unknown_fields_into(wire_type, is, &mut self.reqOpts, 2, &mut self.unknown_fields)?
+ },
+ 3 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.cids)?;
+ },
+ 4 => {
+ ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.data)?;
+ },
+ 5 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.cidVersion)?;
+ },
+ 7 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.hashFunc)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != BSREQTYPE::BS_DELETE {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ for value in &self.reqOpts {
+ my_size += ::protobuf::rt::enum_size(2, *value);
+ };
+ for value in &self.cids {
+ my_size += ::protobuf::rt::string_size(3, &value);
+ };
+ for value in &self.data {
+ my_size += ::protobuf::rt::bytes_size(4, &value);
+ };
+ if !self.cidVersion.is_empty() {
+ my_size += ::protobuf::rt::string_size(5, &self.cidVersion);
+ }
+ if !self.hashFunc.is_empty() {
+ my_size += ::protobuf::rt::string_size(7, &self.hashFunc);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != BSREQTYPE::BS_DELETE {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ for v in &self.reqOpts {
+ os.write_enum(2, v.value())?;
+ };
+ for v in &self.cids {
+ os.write_string(3, &v)?;
+ };
+ for v in &self.data {
+ os.write_bytes(4, &v)?;
+ };
+ if !self.cidVersion.is_empty() {
+ os.write_string(5, &self.cidVersion)?;
+ }
+ if !self.hashFunc.is_empty() {
+ os.write_string(7, &self.hashFunc)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> BlockstoreRequest {
+ BlockstoreRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &BlockstoreRequest| { &m.requestType },
+ |m: &mut BlockstoreRequest| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "reqOpts",
+ |m: &BlockstoreRequest| { &m.reqOpts },
+ |m: &mut BlockstoreRequest| { &mut m.reqOpts },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "cids",
+ |m: &BlockstoreRequest| { &m.cids },
+ |m: &mut BlockstoreRequest| { &mut m.cids },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "data",
+ |m: &BlockstoreRequest| { &m.data },
+ |m: &mut BlockstoreRequest| { &mut m.data },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "cidVersion",
+ |m: &BlockstoreRequest| { &m.cidVersion },
+ |m: &mut BlockstoreRequest| { &mut m.cidVersion },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "hashFunc",
+ |m: &BlockstoreRequest| { &m.hashFunc },
+ |m: &mut BlockstoreRequest| { &mut m.hashFunc },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "BlockstoreRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static BlockstoreRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const BlockstoreRequest,
+ };
+ unsafe {
+ instance.get(BlockstoreRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for BlockstoreRequest {
+ fn clear(&mut self) {
+ self.requestType = BSREQTYPE::BS_DELETE;
+ self.reqOpts.clear();
+ self.cids.clear();
+ self.data.clear();
+ self.cidVersion.clear();
+ self.hashFunc.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for BlockstoreRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for BlockstoreRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct BlockstoreResponse {
+ // message fields
+ pub requestType: BSREQTYPE,
+ pub blocks: ::protobuf::RepeatedField,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a BlockstoreResponse {
+ fn default() -> &'a BlockstoreResponse {
+ ::default_instance()
+ }
+}
+
+impl BlockstoreResponse {
+ pub fn new() -> BlockstoreResponse {
+ ::std::default::Default::default()
+ }
+
+ // .pb.BSREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> BSREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = BSREQTYPE::BS_DELETE;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: BSREQTYPE) {
+ self.requestType = v;
+ }
+
+ // repeated .pb.Block blocks = 2;
+
+
+ pub fn get_blocks(&self) -> &[Block] {
+ &self.blocks
+ }
+ pub fn clear_blocks(&mut self) {
+ self.blocks.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_blocks(&mut self, v: ::protobuf::RepeatedField) {
+ self.blocks = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_blocks(&mut self) -> &mut ::protobuf::RepeatedField {
+ &mut self.blocks
+ }
+
+ // Take field
+ pub fn take_blocks(&mut self) -> ::protobuf::RepeatedField {
+ ::std::mem::replace(&mut self.blocks, ::protobuf::RepeatedField::new())
+ }
+}
+
+impl ::protobuf::Message for BlockstoreResponse {
+ fn is_initialized(&self) -> bool {
+ for v in &self.blocks {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.blocks)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != BSREQTYPE::BS_DELETE {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ for value in &self.blocks {
+ let len = value.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != BSREQTYPE::BS_DELETE {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ for v in &self.blocks {
+ os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ };
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> BlockstoreResponse {
+ BlockstoreResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &BlockstoreResponse| { &m.requestType },
+ |m: &mut BlockstoreResponse| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>(
+ "blocks",
+ |m: &BlockstoreResponse| { &m.blocks },
+ |m: &mut BlockstoreResponse| { &mut m.blocks },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "BlockstoreResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static BlockstoreResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const BlockstoreResponse,
+ };
+ unsafe {
+ instance.get(BlockstoreResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for BlockstoreResponse {
+ fn clear(&mut self) {
+ self.requestType = BSREQTYPE::BS_DELETE;
+ self.blocks.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for BlockstoreResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for BlockstoreResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct Block {
+ // message fields
+ pub cid: ::std::string::String,
+ pub data: ::std::vec::Vec,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a Block {
+ fn default() -> &'a Block {
+ ::default_instance()
+ }
+}
+
+impl Block {
+ pub fn new() -> Block {
+ ::std::default::Default::default()
+ }
+
+ // string cid = 1;
+
+
+ pub fn get_cid(&self) -> &str {
+ &self.cid
+ }
+ pub fn clear_cid(&mut self) {
+ self.cid.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_cid(&mut self, v: ::std::string::String) {
+ self.cid = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_cid(&mut self) -> &mut ::std::string::String {
+ &mut self.cid
+ }
+
+ // Take field
+ pub fn take_cid(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.cid, ::std::string::String::new())
+ }
+
+ // bytes data = 2;
+
+
+ pub fn get_data(&self) -> &[u8] {
+ &self.data
+ }
+ pub fn clear_data(&mut self) {
+ self.data.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_data(&mut self, v: ::std::vec::Vec) {
+ self.data = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_data(&mut self) -> &mut ::std::vec::Vec {
+ &mut self.data
+ }
+
+ // Take field
+ pub fn take_data(&mut self) -> ::std::vec::Vec {
+ ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
+ }
+}
+
+impl ::protobuf::Message for Block {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.cid)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.cid.is_empty() {
+ my_size += ::protobuf::rt::string_size(1, &self.cid);
+ }
+ if !self.data.is_empty() {
+ my_size += ::protobuf::rt::bytes_size(2, &self.data);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.cid.is_empty() {
+ os.write_string(1, &self.cid)?;
+ }
+ if !self.data.is_empty() {
+ os.write_bytes(2, &self.data)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> Block {
+ Block::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "cid",
+ |m: &Block| { &m.cid },
+ |m: &mut Block| { &mut m.cid },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "data",
+ |m: &Block| { &m.data },
+ |m: &mut Block| { &mut m.data },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "Block",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static Block {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const Block,
+ };
+ unsafe {
+ instance.get(Block::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for Block {
+ fn clear(&mut self) {
+ self.cid.clear();
+ self.data.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for Block {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for Block {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct DagRequest {
+ // message fields
+ pub requestType: DAGREQTYPE,
+ pub data: ::std::vec::Vec,
+ pub objectEncoding: ::std::string::String,
+ pub serializationFormat: ::std::string::String,
+ pub hashFunc: ::std::string::String,
+ pub cidVersion: i64,
+ pub hash: ::std::string::String,
+ pub links: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a DagRequest {
+ fn default() -> &'a DagRequest {
+ ::default_instance()
+ }
+}
+
+impl DagRequest {
+ pub fn new() -> DagRequest {
+ ::std::default::Default::default()
+ }
+
+ // .pb.DAGREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> DAGREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = DAGREQTYPE::DAG_PUT;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: DAGREQTYPE) {
+ self.requestType = v;
+ }
+
+ // bytes data = 2;
+
+
+ pub fn get_data(&self) -> &[u8] {
+ &self.data
+ }
+ pub fn clear_data(&mut self) {
+ self.data.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_data(&mut self, v: ::std::vec::Vec) {
+ self.data = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_data(&mut self) -> &mut ::std::vec::Vec {
+ &mut self.data
+ }
+
+ // Take field
+ pub fn take_data(&mut self) -> ::std::vec::Vec {
+ ::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
+ }
+
+ // string objectEncoding = 3;
+
+
+ pub fn get_objectEncoding(&self) -> &str {
+ &self.objectEncoding
+ }
+ pub fn clear_objectEncoding(&mut self) {
+ self.objectEncoding.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_objectEncoding(&mut self, v: ::std::string::String) {
+ self.objectEncoding = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_objectEncoding(&mut self) -> &mut ::std::string::String {
+ &mut self.objectEncoding
+ }
+
+ // Take field
+ pub fn take_objectEncoding(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.objectEncoding, ::std::string::String::new())
+ }
+
+ // string serializationFormat = 4;
+
+
+ pub fn get_serializationFormat(&self) -> &str {
+ &self.serializationFormat
+ }
+ pub fn clear_serializationFormat(&mut self) {
+ self.serializationFormat.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_serializationFormat(&mut self, v: ::std::string::String) {
+ self.serializationFormat = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_serializationFormat(&mut self) -> &mut ::std::string::String {
+ &mut self.serializationFormat
+ }
+
+ // Take field
+ pub fn take_serializationFormat(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.serializationFormat, ::std::string::String::new())
+ }
+
+ // string hashFunc = 5;
+
+
+ pub fn get_hashFunc(&self) -> &str {
+ &self.hashFunc
+ }
+ pub fn clear_hashFunc(&mut self) {
+ self.hashFunc.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_hashFunc(&mut self, v: ::std::string::String) {
+ self.hashFunc = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_hashFunc(&mut self) -> &mut ::std::string::String {
+ &mut self.hashFunc
+ }
+
+ // Take field
+ pub fn take_hashFunc(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.hashFunc, ::std::string::String::new())
+ }
+
+ // int64 cidVersion = 6;
+
+
+ pub fn get_cidVersion(&self) -> i64 {
+ self.cidVersion
+ }
+ pub fn clear_cidVersion(&mut self) {
+ self.cidVersion = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_cidVersion(&mut self, v: i64) {
+ self.cidVersion = v;
+ }
+
+ // string hash = 7;
+
+
+ pub fn get_hash(&self) -> &str {
+ &self.hash
+ }
+ pub fn clear_hash(&mut self) {
+ self.hash.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_hash(&mut self, v: ::std::string::String) {
+ self.hash = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_hash(&mut self) -> &mut ::std::string::String {
+ &mut self.hash
+ }
+
+ // Take field
+ pub fn take_hash(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.hash, ::std::string::String::new())
+ }
+
+ // repeated .pb.DagRequest.LinksEntry links = 8;
+
+
+ pub fn get_links(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
+ &self.links
+ }
+ pub fn clear_links(&mut self) {
+ self.links.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_links(&mut self, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) {
+ self.links = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_links(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> {
+ &mut self.links
+ }
+
+ // Take field
+ pub fn take_links(&mut self) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> {
+ ::std::mem::replace(&mut self.links, ::std::collections::HashMap::new())
+ }
+}
+
+impl ::protobuf::Message for DagRequest {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.objectEncoding)?;
+ },
+ 4 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.serializationFormat)?;
+ },
+ 5 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.hashFunc)?;
+ },
+ 6 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int64()?;
+ self.cidVersion = tmp;
+ },
+ 7 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.hash)?;
+ },
+ 8 => {
+ ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.links)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != DAGREQTYPE::DAG_PUT {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ if !self.data.is_empty() {
+ my_size += ::protobuf::rt::bytes_size(2, &self.data);
+ }
+ if !self.objectEncoding.is_empty() {
+ my_size += ::protobuf::rt::string_size(3, &self.objectEncoding);
+ }
+ if !self.serializationFormat.is_empty() {
+ my_size += ::protobuf::rt::string_size(4, &self.serializationFormat);
+ }
+ if !self.hashFunc.is_empty() {
+ my_size += ::protobuf::rt::string_size(5, &self.hashFunc);
+ }
+ if self.cidVersion != 0 {
+ my_size += ::protobuf::rt::value_size(6, self.cidVersion, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if !self.hash.is_empty() {
+ my_size += ::protobuf::rt::string_size(7, &self.hash);
+ }
+ my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(8, &self.links);
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != DAGREQTYPE::DAG_PUT {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ if !self.data.is_empty() {
+ os.write_bytes(2, &self.data)?;
+ }
+ if !self.objectEncoding.is_empty() {
+ os.write_string(3, &self.objectEncoding)?;
+ }
+ if !self.serializationFormat.is_empty() {
+ os.write_string(4, &self.serializationFormat)?;
+ }
+ if !self.hashFunc.is_empty() {
+ os.write_string(5, &self.hashFunc)?;
+ }
+ if self.cidVersion != 0 {
+ os.write_int64(6, self.cidVersion)?;
+ }
+ if !self.hash.is_empty() {
+ os.write_string(7, &self.hash)?;
+ }
+ ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(8, &self.links, os)?;
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> DagRequest {
+ DagRequest::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &DagRequest| { &m.requestType },
+ |m: &mut DagRequest| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "data",
+ |m: &DagRequest| { &m.data },
+ |m: &mut DagRequest| { &mut m.data },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "objectEncoding",
+ |m: &DagRequest| { &m.objectEncoding },
+ |m: &mut DagRequest| { &mut m.objectEncoding },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "serializationFormat",
+ |m: &DagRequest| { &m.serializationFormat },
+ |m: &mut DagRequest| { &mut m.serializationFormat },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "hashFunc",
+ |m: &DagRequest| { &m.hashFunc },
+ |m: &mut DagRequest| { &mut m.hashFunc },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
+ "cidVersion",
+ |m: &DagRequest| { &m.cidVersion },
+ |m: &mut DagRequest| { &mut m.cidVersion },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "hash",
+ |m: &DagRequest| { &m.hash },
+ |m: &mut DagRequest| { &mut m.hash },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(
+ "links",
+ |m: &DagRequest| { &m.links },
+ |m: &mut DagRequest| { &mut m.links },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "DagRequest",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static DagRequest {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const DagRequest,
+ };
+ unsafe {
+ instance.get(DagRequest::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for DagRequest {
+ fn clear(&mut self) {
+ self.requestType = DAGREQTYPE::DAG_PUT;
+ self.data.clear();
+ self.objectEncoding.clear();
+ self.serializationFormat.clear();
+ self.hashFunc.clear();
+ self.cidVersion = 0;
+ self.hash.clear();
+ self.links.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for DagRequest {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for DagRequest {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct DagResponse {
+ // message fields
+ pub requestType: DAGREQTYPE,
+ pub hashes: ::protobuf::RepeatedField<::std::string::String>,
+ pub rawData: ::std::vec::Vec,
+ pub links: ::protobuf::RepeatedField,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a DagResponse {
+ fn default() -> &'a DagResponse {
+ ::default_instance()
+ }
+}
+
+impl DagResponse {
+ pub fn new() -> DagResponse {
+ ::std::default::Default::default()
+ }
+
+ // .pb.DAGREQTYPE requestType = 1;
+
+
+ pub fn get_requestType(&self) -> DAGREQTYPE {
+ self.requestType
+ }
+ pub fn clear_requestType(&mut self) {
+ self.requestType = DAGREQTYPE::DAG_PUT;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_requestType(&mut self, v: DAGREQTYPE) {
+ self.requestType = v;
+ }
+
+ // repeated string hashes = 2;
+
+
+ pub fn get_hashes(&self) -> &[::std::string::String] {
+ &self.hashes
+ }
+ pub fn clear_hashes(&mut self) {
+ self.hashes.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_hashes(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
+ self.hashes = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_hashes(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
+ &mut self.hashes
+ }
+
+ // Take field
+ pub fn take_hashes(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
+ ::std::mem::replace(&mut self.hashes, ::protobuf::RepeatedField::new())
+ }
+
+ // bytes rawData = 3;
+
+
+ pub fn get_rawData(&self) -> &[u8] {
+ &self.rawData
+ }
+ pub fn clear_rawData(&mut self) {
+ self.rawData.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_rawData(&mut self, v: ::std::vec::Vec) {
+ self.rawData = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_rawData(&mut self) -> &mut ::std::vec::Vec {
+ &mut self.rawData
+ }
+
+ // Take field
+ pub fn take_rawData(&mut self) -> ::std::vec::Vec {
+ ::std::mem::replace(&mut self.rawData, ::std::vec::Vec::new())
+ }
+
+ // repeated .pb.IPLDLink links = 4;
+
+
+ pub fn get_links(&self) -> &[IPLDLink] {
+ &self.links
+ }
+ pub fn clear_links(&mut self) {
+ self.links.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_links(&mut self, v: ::protobuf::RepeatedField) {
+ self.links = v;
+ }
+
+ // Mutable pointer to the field.
+ pub fn mut_links(&mut self) -> &mut ::protobuf::RepeatedField {
+ &mut self.links
+ }
+
+ // Take field
+ pub fn take_links(&mut self) -> ::protobuf::RepeatedField {
+ ::std::mem::replace(&mut self.links, ::protobuf::RepeatedField::new())
+ }
+}
+
+impl ::protobuf::Message for DagResponse {
+ fn is_initialized(&self) -> bool {
+ for v in &self.links {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.requestType, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.hashes)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.rawData)?;
+ },
+ 4 => {
+ ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.links)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if self.requestType != DAGREQTYPE::DAG_PUT {
+ my_size += ::protobuf::rt::enum_size(1, self.requestType);
+ }
+ for value in &self.hashes {
+ my_size += ::protobuf::rt::string_size(2, &value);
+ };
+ if !self.rawData.is_empty() {
+ my_size += ::protobuf::rt::bytes_size(3, &self.rawData);
+ }
+ for value in &self.links {
+ let len = value.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if self.requestType != DAGREQTYPE::DAG_PUT {
+ os.write_enum(1, self.requestType.value())?;
+ }
+ for v in &self.hashes {
+ os.write_string(2, &v)?;
+ };
+ if !self.rawData.is_empty() {
+ os.write_bytes(3, &self.rawData)?;
+ }
+ for v in &self.links {
+ os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ };
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> DagResponse {
+ DagResponse::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>(
+ "requestType",
+ |m: &DagResponse| { &m.requestType },
+ |m: &mut DagResponse| { &mut m.requestType },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "hashes",
+ |m: &DagResponse| { &m.hashes },
+ |m: &mut DagResponse| { &mut m.hashes },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "rawData",
+ |m: &DagResponse| { &m.rawData },
+ |m: &mut DagResponse| { &mut m.rawData },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>(
+ "links",
+ |m: &DagResponse| { &m.links },
+ |m: &mut DagResponse| { &mut m.links },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "DagResponse",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static DagResponse {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const DagResponse,
+ };
+ unsafe {
+ instance.get(DagResponse::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for DagResponse {
+ fn clear(&mut self) {
+ self.requestType = DAGREQTYPE::DAG_PUT;
+ self.hashes.clear();
+ self.rawData.clear();
+ self.links.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for DagResponse {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for DagResponse {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct IPLDLink {
+ // message fields
+ pub hash: ::std::vec::Vec,
+ pub name: ::std::string::String,
+ pub size: u64,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a IPLDLink {
+ fn default() -> &'a IPLDLink {
+ ::default_instance()
+ }
+}
+
+impl IPLDLink {
+ pub fn new() -> IPLDLink {
+ ::std::default::Default::default()
+ }
+
+ // bytes hash = 1;
+
+
+ pub fn get_hash(&self) -> &[u8] {
+ &self.hash
+ }
+ pub fn clear_hash(&mut self) {
+ self.hash.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_hash(&mut self, v: ::std::vec::Vec) {
+ self.hash = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_hash(&mut self) -> &mut ::std::vec::Vec {
+ &mut self.hash
+ }
+
+ // Take field
+ pub fn take_hash(&mut self) -> ::std::vec::Vec {
+ ::std::mem::replace(&mut self.hash, ::std::vec::Vec::new())
+ }
+
+ // string name = 2;
+
+
+ pub fn get_name(&self) -> &str {
+ &self.name
+ }
+ pub fn clear_name(&mut self) {
+ self.name.clear();
+ }
+
+ // Param is passed by value, moved
+ pub fn set_name(&mut self, v: ::std::string::String) {
+ self.name = v;
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_name(&mut self) -> &mut ::std::string::String {
+ &mut self.name
+ }
+
+ // Take field
+ pub fn take_name(&mut self) -> ::std::string::String {
+ ::std::mem::replace(&mut self.name, ::std::string::String::new())
+ }
+
+ // uint64 size = 3;
+
+
+ pub fn get_size(&self) -> u64 {
+ self.size
+ }
+ pub fn clear_size(&mut self) {
+ self.size = 0;
+ }
+
+ // Param is passed by value, moved
+ pub fn set_size(&mut self, v: u64) {
+ self.size = v;
+ }
+}
+
+impl ::protobuf::Message for IPLDLink {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.hash)?;
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?;
+ },
+ 3 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_uint64()?;
+ self.size = tmp;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if !self.hash.is_empty() {
+ my_size += ::protobuf::rt::bytes_size(1, &self.hash);
+ }
+ if !self.name.is_empty() {
+ my_size += ::protobuf::rt::string_size(2, &self.name);
+ }
+ if self.size != 0 {
+ my_size += ::protobuf::rt::value_size(3, self.size, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if !self.hash.is_empty() {
+ os.write_bytes(1, &self.hash)?;
+ }
+ if !self.name.is_empty() {
+ os.write_string(2, &self.name)?;
+ }
+ if self.size != 0 {
+ os.write_uint64(3, self.size)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: Box) -> ::std::boxed::Box {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> IPLDLink {
+ IPLDLink::new()
+ }
+
+ fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
+ static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
+ };
+ unsafe {
+ descriptor.get(|| {
+ let mut fields = ::std::vec::Vec::new();
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
+ "hash",
+ |m: &IPLDLink| { &m.hash },
+ |m: &mut IPLDLink| { &mut m.hash },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
+ "name",
+ |m: &IPLDLink| { &m.name },
+ |m: &mut IPLDLink| { &mut m.name },
+ ));
+ fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
+ "size",
+ |m: &IPLDLink| { &m.size },
+ |m: &mut IPLDLink| { &mut m.size },
+ ));
+ ::protobuf::reflect::MessageDescriptor::new::(
+ "IPLDLink",
+ fields,
+ file_descriptor_proto()
+ )
+ })
+ }
+ }
+
+ fn default_instance() -> &'static IPLDLink {
+ static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy {
+ lock: ::protobuf::lazy::ONCE_INIT,
+ ptr: 0 as *const IPLDLink,
+ };
+ unsafe {
+ instance.get(IPLDLink::new)
+ }
+ }
+}
+
+impl ::protobuf::Clear for IPLDLink {
+ fn clear(&mut self) {
+ self.hash.clear();
+ self.name.clear();
+ self.size = 0;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::std::fmt::Debug for IPLDLink {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for IPLDLink {
+ fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
+ ::protobuf::reflect::ProtobufValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default)]
+pub struct IPLDNode {
+ // message fields
+ pub links: ::protobuf::RepeatedField,
+ pub data: ::std::vec::Vec