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, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a IPLDNode { + fn default() -> &'a IPLDNode { + ::default_instance() + } +} + +impl IPLDNode { + pub fn new() -> IPLDNode { + ::std::default::Default::default() + } + + // repeated .pb.IPLDLink links = 2; + + + 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()) + } + + // bytes data = 1; + + + 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 IPLDNode { + 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 { + 2 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.links)?; + }, + 1 => { + ::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; + for value in &self.links { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if !self.data.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &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<()> { + for v in &self.links { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if !self.data.is_empty() { + os.write_bytes(1, &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() -> IPLDNode { + IPLDNode::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::ProtobufTypeMessage>( + "links", + |m: &IPLDNode| { &m.links }, + |m: &mut IPLDNode| { &mut m.links }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "data", + |m: &IPLDNode| { &m.data }, + |m: &mut IPLDNode| { &mut m.data }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "IPLDNode", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static IPLDNode { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const IPLDNode, + }; + unsafe { + instance.get(IPLDNode::new) + } + } +} + +impl ::protobuf::Clear for IPLDNode { + fn clear(&mut self) { + self.links.clear(); + self.data.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for IPLDNode { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for IPLDNode { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct KeystoreRequest { + // message fields + pub requestType: KSREQTYPE, + pub name: ::std::string::String, + pub privateKey: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a KeystoreRequest { + fn default() -> &'a KeystoreRequest { + ::default_instance() + } +} + +impl KeystoreRequest { + pub fn new() -> KeystoreRequest { + ::std::default::Default::default() + } + + // .pb.KSREQTYPE requestType = 1; + + + pub fn get_requestType(&self) -> KSREQTYPE { + self.requestType + } + pub fn clear_requestType(&mut self) { + self.requestType = KSREQTYPE::KS_HAS; + } + + // Param is passed by value, moved + pub fn set_requestType(&mut self, v: KSREQTYPE) { + self.requestType = v; + } + + // 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()) + } + + // bytes privateKey = 3; + + + 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()) + } +} + +impl ::protobuf::Message for KeystoreRequest { + 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_string_into(wire_type, is, &mut self.name)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.privateKey)?; + }, + _ => { + ::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 != KSREQTYPE::KS_HAS { + my_size += ::protobuf::rt::enum_size(1, self.requestType); + } + if !self.name.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.name); + } + if !self.privateKey.is_empty() { + my_size += ::protobuf::rt::bytes_size(3, &self.privateKey); + } + 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 != KSREQTYPE::KS_HAS { + os.write_enum(1, self.requestType.value())?; + } + if !self.name.is_empty() { + os.write_string(2, &self.name)?; + } + if !self.privateKey.is_empty() { + os.write_bytes(3, &self.privateKey)?; + } + 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() -> KeystoreRequest { + KeystoreRequest::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: &KeystoreRequest| { &m.requestType }, + |m: &mut KeystoreRequest| { &mut m.requestType }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &KeystoreRequest| { &m.name }, + |m: &mut KeystoreRequest| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "privateKey", + |m: &KeystoreRequest| { &m.privateKey }, + |m: &mut KeystoreRequest| { &mut m.privateKey }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "KeystoreRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static KeystoreRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const KeystoreRequest, + }; + unsafe { + instance.get(KeystoreRequest::new) + } + } +} + +impl ::protobuf::Clear for KeystoreRequest { + fn clear(&mut self) { + self.requestType = KSREQTYPE::KS_HAS; + self.name.clear(); + self.privateKey.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for KeystoreRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for KeystoreRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct KeystoreResponse { + // message fields + pub requestType: KSREQTYPE, + pub privateKey: ::std::vec::Vec, + pub keyNames: ::protobuf::RepeatedField<::std::string::String>, + pub has: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a KeystoreResponse { + fn default() -> &'a KeystoreResponse { + ::default_instance() + } +} + +impl KeystoreResponse { + pub fn new() -> KeystoreResponse { + ::std::default::Default::default() + } + + // .pb.KSREQTYPE requestType = 1; + + + pub fn get_requestType(&self) -> KSREQTYPE { + self.requestType + } + pub fn clear_requestType(&mut self) { + self.requestType = KSREQTYPE::KS_HAS; + } + + // Param is passed by value, moved + pub fn set_requestType(&mut self, v: KSREQTYPE) { + self.requestType = v; + } + + // bytes privateKey = 2; + + + 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()) + } + + // repeated string keyNames = 3; + + + pub fn get_keyNames(&self) -> &[::std::string::String] { + &self.keyNames + } + pub fn clear_keyNames(&mut self) { + self.keyNames.clear(); + } + + // Param is passed by value, moved + pub fn set_keyNames(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.keyNames = v; + } + + // Mutable pointer to the field. + pub fn mut_keyNames(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.keyNames + } + + // Take field + pub fn take_keyNames(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.keyNames, ::protobuf::RepeatedField::new()) + } + + // bool has = 4; + + + pub fn get_has(&self) -> bool { + self.has + } + pub fn clear_has(&mut self) { + self.has = false; + } + + // Param is passed by value, moved + pub fn set_has(&mut self, v: bool) { + self.has = v; + } +} + +impl ::protobuf::Message for KeystoreResponse { + 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.privateKey)?; + }, + 3 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.keyNames)?; + }, + 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.has = 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 != KSREQTYPE::KS_HAS { + my_size += ::protobuf::rt::enum_size(1, self.requestType); + } + if !self.privateKey.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.privateKey); + } + for value in &self.keyNames { + my_size += ::protobuf::rt::string_size(3, &value); + }; + if self.has != 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 != KSREQTYPE::KS_HAS { + os.write_enum(1, self.requestType.value())?; + } + if !self.privateKey.is_empty() { + os.write_bytes(2, &self.privateKey)?; + } + for v in &self.keyNames { + os.write_string(3, &v)?; + }; + if self.has != false { + os.write_bool(4, self.has)?; + } + 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() -> KeystoreResponse { + KeystoreResponse::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: &KeystoreResponse| { &m.requestType }, + |m: &mut KeystoreResponse| { &mut m.requestType }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "privateKey", + |m: &KeystoreResponse| { &m.privateKey }, + |m: &mut KeystoreResponse| { &mut m.privateKey }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "keyNames", + |m: &KeystoreResponse| { &m.keyNames }, + |m: &mut KeystoreResponse| { &mut m.keyNames }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "has", + |m: &KeystoreResponse| { &m.has }, + |m: &mut KeystoreResponse| { &mut m.has }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "KeystoreResponse", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static KeystoreResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const KeystoreResponse, + }; + unsafe { + instance.get(KeystoreResponse::new) + } + } +} + +impl ::protobuf::Clear for KeystoreResponse { + fn clear(&mut self) { + self.requestType = KSREQTYPE::KS_HAS; + self.privateKey.clear(); + self.keyNames.clear(); + self.has = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for KeystoreResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for KeystoreResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PersistRequest { + // message fields + pub cids: ::protobuf::RepeatedField<::std::string::String>, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PersistRequest { + fn default() -> &'a PersistRequest { + ::default_instance() + } +} + +impl PersistRequest { + pub fn new() -> PersistRequest { + ::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()) + } +} + +impl ::protobuf::Message for PersistRequest { + 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)?; + }, + _ => { + ::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); + }; + 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)?; + }; + 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() -> PersistRequest { + PersistRequest::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: &PersistRequest| { &m.cids }, + |m: &mut PersistRequest| { &mut m.cids }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PersistRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PersistRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PersistRequest, + }; + unsafe { + instance.get(PersistRequest::new) + } + } +} + +impl ::protobuf::Clear for PersistRequest { + fn clear(&mut self) { + self.cids.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PersistRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PersistRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PersistResponse { + // message fields + pub status: ::std::collections::HashMap<::std::string::String, bool>, + pub errors: ::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 PersistResponse { + fn default() -> &'a PersistResponse { + ::default_instance() + } +} + +impl PersistResponse { + pub fn new() -> PersistResponse { + ::std::default::Default::default() + } + + // repeated .pb.PersistResponse.StatusEntry status = 1; + + + pub fn get_status(&self) -> &::std::collections::HashMap<::std::string::String, bool> { + &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, bool>) { + self.status = v; + } + + // Mutable pointer to the field. + pub fn mut_status(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, bool> { + &mut self.status + } + + // Take field + pub fn take_status(&mut self) -> ::std::collections::HashMap<::std::string::String, bool> { + ::std::mem::replace(&mut self.status, ::std::collections::HashMap::new()) + } + + // repeated .pb.PersistResponse.ErrorsEntry errors = 2; + + + pub fn get_errors(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> { + &self.errors + } + pub fn clear_errors(&mut self) { + self.errors.clear(); + } + + // Param is passed by value, moved + pub fn set_errors(&mut self, v: ::std::collections::HashMap<::std::string::String, ::std::string::String>) { + self.errors = v; + } + + // Mutable pointer to the field. + pub fn mut_errors(&mut self) -> &mut ::std::collections::HashMap<::std::string::String, ::std::string::String> { + &mut self.errors + } + + // Take field + pub fn take_errors(&mut self) -> ::std::collections::HashMap<::std::string::String, ::std::string::String> { + ::std::mem::replace(&mut self.errors, ::std::collections::HashMap::new()) + } +} + +impl ::protobuf::Message for PersistResponse { + 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::ProtobufTypeBool>(wire_type, is, &mut self.status)?; + }, + 2 => { + ::protobuf::rt::read_map_into::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(wire_type, is, &mut self.errors)?; + }, + _ => { + ::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::ProtobufTypeBool>(1, &self.status); + my_size += ::protobuf::rt::compute_map_size::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(2, &self.errors); + 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::ProtobufTypeBool>(1, &self.status, os)?; + ::protobuf::rt::write_map_with_cached_sizes::<::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>(2, &self.errors, 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() -> PersistResponse { + PersistResponse::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::ProtobufTypeBool>( + "status", + |m: &PersistResponse| { &m.status }, + |m: &mut PersistResponse| { &mut m.status }, + )); + fields.push(::protobuf::reflect::accessor::make_map_accessor::<_, ::protobuf::types::ProtobufTypeString, ::protobuf::types::ProtobufTypeString>( + "errors", + |m: &PersistResponse| { &m.errors }, + |m: &mut PersistResponse| { &mut m.errors }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PersistResponse", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PersistResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PersistResponse, + }; + unsafe { + instance.get(PersistResponse::new) + } + } +} + +impl ::protobuf::Clear for PersistResponse { + fn clear(&mut self) { + self.status.clear(); + self.errors.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PersistResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PersistResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum P2PREQTYPE { + CLOSE = 0, + FORWARD = 1, + LISTEN = 2, + LS = 3, +} + +impl ::protobuf::ProtobufEnum for P2PREQTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(P2PREQTYPE::CLOSE), + 1 => ::std::option::Option::Some(P2PREQTYPE::FORWARD), + 2 => ::std::option::Option::Some(P2PREQTYPE::LISTEN), + 3 => ::std::option::Option::Some(P2PREQTYPE::LS), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [P2PREQTYPE] = &[ + P2PREQTYPE::CLOSE, + P2PREQTYPE::FORWARD, + P2PREQTYPE::LISTEN, + P2PREQTYPE::LS, + ]; + 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("P2PREQTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for P2PREQTYPE { +} + +impl ::std::default::Default for P2PREQTYPE { + fn default() -> Self { + P2PREQTYPE::CLOSE + } +} + +impl ::protobuf::reflect::ProtobufValue for P2PREQTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum CONNMGMTREQTYPE { + CM_CONNECT = 0, + CM_DISCONNECT = 1, + CM_STATUS = 2, + CM_GET_PEERS = 3, +} + +impl ::protobuf::ProtobufEnum for CONNMGMTREQTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(CONNMGMTREQTYPE::CM_CONNECT), + 1 => ::std::option::Option::Some(CONNMGMTREQTYPE::CM_DISCONNECT), + 2 => ::std::option::Option::Some(CONNMGMTREQTYPE::CM_STATUS), + 3 => ::std::option::Option::Some(CONNMGMTREQTYPE::CM_GET_PEERS), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [CONNMGMTREQTYPE] = &[ + CONNMGMTREQTYPE::CM_CONNECT, + CONNMGMTREQTYPE::CM_DISCONNECT, + CONNMGMTREQTYPE::CM_STATUS, + CONNMGMTREQTYPE::CM_GET_PEERS, + ]; + 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("CONNMGMTREQTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for CONNMGMTREQTYPE { +} + +impl ::std::default::Default for CONNMGMTREQTYPE { + fn default() -> Self { + CONNMGMTREQTYPE::CM_CONNECT + } +} + +impl ::protobuf::reflect::ProtobufValue for CONNMGMTREQTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum EXTRASREQTYPE { + EX_ENABLE = 0, + EX_DISABLE = 1, +} + +impl ::protobuf::ProtobufEnum for EXTRASREQTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(EXTRASREQTYPE::EX_ENABLE), + 1 => ::std::option::Option::Some(EXTRASREQTYPE::EX_DISABLE), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [EXTRASREQTYPE] = &[ + EXTRASREQTYPE::EX_ENABLE, + EXTRASREQTYPE::EX_DISABLE, + ]; + 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("EXTRASREQTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for EXTRASREQTYPE { +} + +impl ::std::default::Default for EXTRASREQTYPE { + fn default() -> Self { + EXTRASREQTYPE::EX_ENABLE + } +} + +impl ::protobuf::reflect::ProtobufValue for EXTRASREQTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum EXTRASTYPE { + IDENTIFY = 0, + PUBSUB = 1, + DISCOVERY = 2, + MDNS = 3, +} + +impl ::protobuf::ProtobufEnum for EXTRASTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(EXTRASTYPE::IDENTIFY), + 1 => ::std::option::Option::Some(EXTRASTYPE::PUBSUB), + 2 => ::std::option::Option::Some(EXTRASTYPE::DISCOVERY), + 3 => ::std::option::Option::Some(EXTRASTYPE::MDNS), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [EXTRASTYPE] = &[ + EXTRASTYPE::IDENTIFY, + EXTRASTYPE::PUBSUB, + EXTRASTYPE::DISCOVERY, + EXTRASTYPE::MDNS, + ]; + 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("EXTRASTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for EXTRASTYPE { +} + +impl ::std::default::Default for EXTRASTYPE { + fn default() -> Self { + EXTRASTYPE::IDENTIFY + } +} + +impl ::protobuf::reflect::ProtobufValue for EXTRASTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum BSREQTYPE { + BS_DELETE = 0, + BS_PUT = 1, + BS_PUT_MANY = 2, + BS_GET = 3, + BS_GET_MANY = 4, +} + +impl ::protobuf::ProtobufEnum for BSREQTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(BSREQTYPE::BS_DELETE), + 1 => ::std::option::Option::Some(BSREQTYPE::BS_PUT), + 2 => ::std::option::Option::Some(BSREQTYPE::BS_PUT_MANY), + 3 => ::std::option::Option::Some(BSREQTYPE::BS_GET), + 4 => ::std::option::Option::Some(BSREQTYPE::BS_GET_MANY), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [BSREQTYPE] = &[ + BSREQTYPE::BS_DELETE, + BSREQTYPE::BS_PUT, + BSREQTYPE::BS_PUT_MANY, + BSREQTYPE::BS_GET, + BSREQTYPE::BS_GET_MANY, + ]; + 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("BSREQTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for BSREQTYPE { +} + +impl ::std::default::Default for BSREQTYPE { + fn default() -> Self { + BSREQTYPE::BS_DELETE + } +} + +impl ::protobuf::reflect::ProtobufValue for BSREQTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum BSREQOPTS { + DEFAULT = 0, + BS_FORCE = 1, +} + +impl ::protobuf::ProtobufEnum for BSREQOPTS { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(BSREQOPTS::DEFAULT), + 1 => ::std::option::Option::Some(BSREQOPTS::BS_FORCE), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [BSREQOPTS] = &[ + BSREQOPTS::DEFAULT, + BSREQOPTS::BS_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("BSREQOPTS", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for BSREQOPTS { +} + +impl ::std::default::Default for BSREQOPTS { + fn default() -> Self { + BSREQOPTS::DEFAULT + } +} + +impl ::protobuf::reflect::ProtobufValue for BSREQOPTS { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum DAGREQTYPE { + DAG_PUT = 0, + DAG_GET = 1, + DAG_NEW_NODE = 2, + DAG_ADD_LINKS = 3, + DAG_GET_LINKS = 4, +} + +impl ::protobuf::ProtobufEnum for DAGREQTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(DAGREQTYPE::DAG_PUT), + 1 => ::std::option::Option::Some(DAGREQTYPE::DAG_GET), + 2 => ::std::option::Option::Some(DAGREQTYPE::DAG_NEW_NODE), + 3 => ::std::option::Option::Some(DAGREQTYPE::DAG_ADD_LINKS), + 4 => ::std::option::Option::Some(DAGREQTYPE::DAG_GET_LINKS), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [DAGREQTYPE] = &[ + DAGREQTYPE::DAG_PUT, + DAGREQTYPE::DAG_GET, + DAGREQTYPE::DAG_NEW_NODE, + DAGREQTYPE::DAG_ADD_LINKS, + DAGREQTYPE::DAG_GET_LINKS, + ]; + 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("DAGREQTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for DAGREQTYPE { +} + +impl ::std::default::Default for DAGREQTYPE { + fn default() -> Self { + DAGREQTYPE::DAG_PUT + } +} + +impl ::protobuf::reflect::ProtobufValue for DAGREQTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum KSREQTYPE { + KS_HAS = 0, + KS_GET = 1, + KS_PUT = 2, + KS_DELETE = 3, + KS_LIST = 4, +} + +impl ::protobuf::ProtobufEnum for KSREQTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(KSREQTYPE::KS_HAS), + 1 => ::std::option::Option::Some(KSREQTYPE::KS_GET), + 2 => ::std::option::Option::Some(KSREQTYPE::KS_PUT), + 3 => ::std::option::Option::Some(KSREQTYPE::KS_DELETE), + 4 => ::std::option::Option::Some(KSREQTYPE::KS_LIST), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [KSREQTYPE] = &[ + KSREQTYPE::KS_HAS, + KSREQTYPE::KS_GET, + KSREQTYPE::KS_PUT, + KSREQTYPE::KS_DELETE, + KSREQTYPE::KS_LIST, + ]; + 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("KSREQTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for KSREQTYPE { +} + +impl ::std::default::Default for KSREQTYPE { + fn default() -> Self { + KSREQTYPE::KS_HAS + } +} + +impl ::protobuf::reflect::ProtobufValue for KSREQTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\nnode.proto\x12\x02pb\x1a\nutil.proto\"\xd8\x02\n\nP2PRequest\x120\n\ + \x0brequestType\x18\x01\x20\x01(\x0e2\x0e.pb.P2PREQTYPER\x0brequestType\ + \x12\x10\n\x03all\x18\x02\x20\x01(\x08R\x03all\x12\x18\n\x07verbose\x18\ + \x03\x20\x01(\x08R\x07verbose\x12\"\n\x0cprotocolName\x18\x04\x20\x01(\t\ + R\x0cprotocolName\x12$\n\rlistenAddress\x18\x05\x20\x01(\tR\rlistenAddre\ + ss\x12$\n\rtargetAddress\x18\x06\x20\x01(\tR\rtargetAddress\x12$\n\rremo\ + teAddress\x18\x07\x20\x01(\tR\rremoteAddress\x122\n\x14allowCustomProtoc\ + ols\x18\x08\x20\x01(\x08R\x14allowCustomProtocols\x12\"\n\x0creportPeerI\ + D\x18\t\x20\x01(\x08R\x0creportPeerID\"\xa8\x01\n\x0bP2PResponse\x120\n\ + \x0brequestType\x18\x01\x20\x01(\x0e2\x0e.pb.P2PREQTYPER\x0brequestType\ + \x12\x14\n\x05names\x18\x02\x20\x03(\tR\x05names\x12\x20\n\x0bconnsClose\ + d\x18\x03\x20\x01(\x05R\x0bconnsClosed\x12/\n\x0bstreamInfos\x18\x04\x20\ + \x03(\x0b2\r.pb.P2PLsInfoR\x0bstreamInfos\"\x91\x01\n\tP2PLsInfo\x12\"\n\ + \x0cprotocolName\x18\x01\x20\x01(\tR\x0cprotocolName\x12$\n\rlistenAddre\ + ss\x18\x02\x20\x01(\tR\rlistenAddress\x12$\n\rtargetAddress\x18\x03\x20\ + \x01(\tR\rtargetAddress\x12\x14\n\x05local\x18\x04\x20\x01(\x08R\x05loca\ + l\",\n\x10GetPeersResponse\x12\x18\n\x07peerIDs\x18\x01\x20\x03(\tR\x07p\ + eerIDs\"\x82\x01\n\x0fConnMgmtRequest\x125\n\x0brequestType\x18\x01\x20\ + \x01(\x0e2\x13.pb.CONNMGMTREQTYPER\x0brequestType\x12\x1e\n\nmultiAddrs\ + \x18\x02\x20\x03(\tR\nmultiAddrs\x12\x18\n\x07peerIDs\x18\x03\x20\x03(\t\ + R\x07peerIDs\"\xed\x02\n\x10ConnMgmtResponse\x125\n\x0brequestType\x18\ + \x01\x20\x01(\x0e2\x13.pb.CONNMGMTREQTYPER\x0brequestType\x12A\n\tconnec\ + ted\x18\x02\x20\x03(\x0b2#.pb.ConnMgmtResponse.ConnectedEntryR\tconnecte\ + d\x128\n\x06status\x18\x03\x20\x03(\x0b2\x20.pb.ConnMgmtResponse.StatusE\ + ntryR\x06status\x12\x18\n\x07peerIDs\x18\x04\x20\x03(\tR\x07peerIDs\x1a<\ + \n\x0eConnectedEntry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x14\ + \n\x05value\x18\x02\x20\x01(\x08R\x05value:\x028\x01\x1aM\n\x0bStatusEnt\ + ry\x12\x10\n\x03key\x18\x01\x20\x01(\tR\x03key\x12(\n\x05value\x18\x02\ + \x20\x01(\x0b2\x12.pb.ConnMgmtStatusR\x05value:\x028\x01\"L\n\x0eConnMgm\ + tStatus\x12\"\n\x0cdisconnected\x18\x01\x20\x01(\x08R\x0cdisconnected\ + \x12\x16\n\x06reason\x18\x02\x20\x01(\tR\x06reason\"z\n\rExtrasRequest\ + \x123\n\x0brequestType\x18\x01\x20\x01(\x0e2\x11.pb.EXTRASREQTYPER\x0bre\ + questType\x124\n\rextrasFeature\x18\x02\x20\x01(\x0e2\x0e.pb.EXTRASTYPER\ + \rextrasFeature\"\xd1\x01\n\x11BlockstoreRequest\x12/\n\x0brequestType\ + \x18\x01\x20\x01(\x0e2\r.pb.BSREQTYPER\x0brequestType\x12'\n\x07reqOpts\ + \x18\x02\x20\x03(\x0e2\r.pb.BSREQOPTSR\x07reqOpts\x12\x12\n\x04cids\x18\ + \x03\x20\x03(\tR\x04cids\x12\x12\n\x04data\x18\x04\x20\x03(\x0cR\x04data\ + \x12\x1e\n\ncidVersion\x18\x05\x20\x01(\tR\ncidVersion\x12\x1a\n\x08hash\ + Func\x18\x07\x20\x01(\tR\x08hashFunc\"h\n\x12BlockstoreResponse\x12/\n\ + \x0brequestType\x18\x01\x20\x01(\x0e2\r.pb.BSREQTYPER\x0brequestType\x12\ + !\n\x06blocks\x18\x02\x20\x03(\x0b2\t.pb.BlockR\x06blocks\"-\n\x05Block\ + \x12\x10\n\x03cid\x18\x01\x20\x01(\tR\x03cid\x12\x12\n\x04data\x18\x02\ + \x20\x01(\x0cR\x04data\"\xe7\x02\n\nDagRequest\x120\n\x0brequestType\x18\ + \x01\x20\x01(\x0e2\x0e.pb.DAGREQTYPER\x0brequestType\x12\x12\n\x04data\ + \x18\x02\x20\x01(\x0cR\x04data\x12&\n\x0eobjectEncoding\x18\x03\x20\x01(\ + \tR\x0eobjectEncoding\x120\n\x13serializationFormat\x18\x04\x20\x01(\tR\ + \x13serializationFormat\x12\x1a\n\x08hashFunc\x18\x05\x20\x01(\tR\x08has\ + hFunc\x12\x1e\n\ncidVersion\x18\x06\x20\x01(\x03R\ncidVersion\x12\x12\n\ + \x04hash\x18\x07\x20\x01(\tR\x04hash\x12/\n\x05links\x18\x08\x20\x03(\ + \x0b2\x19.pb.DagRequest.LinksEntryR\x05links\x1a8\n\nLinksEntry\x12\x10\ + \n\x03key\x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\ + \tR\x05value:\x028\x01\"\x95\x01\n\x0bDagResponse\x120\n\x0brequestType\ + \x18\x01\x20\x01(\x0e2\x0e.pb.DAGREQTYPER\x0brequestType\x12\x16\n\x06ha\ + shes\x18\x02\x20\x03(\tR\x06hashes\x12\x18\n\x07rawData\x18\x03\x20\x01(\ + \x0cR\x07rawData\x12\"\n\x05links\x18\x04\x20\x03(\x0b2\x0c.pb.IPLDLinkR\ + \x05links\"F\n\x08IPLDLink\x12\x12\n\x04hash\x18\x01\x20\x01(\x0cR\x04ha\ + sh\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04size\x18\ + \x03\x20\x01(\x04R\x04size\"B\n\x08IPLDNode\x12\"\n\x05links\x18\x02\x20\ + \x03(\x0b2\x0c.pb.IPLDLinkR\x05links\x12\x12\n\x04data\x18\x01\x20\x01(\ + \x0cR\x04data\"v\n\x0fKeystoreRequest\x12/\n\x0brequestType\x18\x01\x20\ + \x01(\x0e2\r.pb.KSREQTYPER\x0brequestType\x12\x12\n\x04name\x18\x02\x20\ + \x01(\tR\x04name\x12\x1e\n\nprivateKey\x18\x03\x20\x01(\x0cR\nprivateKey\ + \"\x91\x01\n\x10KeystoreResponse\x12/\n\x0brequestType\x18\x01\x20\x01(\ + \x0e2\r.pb.KSREQTYPER\x0brequestType\x12\x1e\n\nprivateKey\x18\x02\x20\ + \x01(\x0cR\nprivateKey\x12\x1a\n\x08keyNames\x18\x03\x20\x03(\tR\x08keyN\ + ames\x12\x10\n\x03has\x18\x04\x20\x01(\x08R\x03has\"$\n\x0ePersistReques\ + t\x12\x12\n\x04cids\x18\x01\x20\x03(\tR\x04cids\"\xf9\x01\n\x0fPersistRe\ + sponse\x127\n\x06status\x18\x01\x20\x03(\x0b2\x1f.pb.PersistResponse.Sta\ + tusEntryR\x06status\x127\n\x06errors\x18\x02\x20\x03(\x0b2\x1f.pb.Persis\ + tResponse.ErrorsEntryR\x06errors\x1a9\n\x0bStatusEntry\x12\x10\n\x03key\ + \x18\x01\x20\x01(\tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\x08R\x05\ + value:\x028\x01\x1a9\n\x0bErrorsEntry\x12\x10\n\x03key\x18\x01\x20\x01(\ + \tR\x03key\x12\x14\n\x05value\x18\x02\x20\x01(\tR\x05value:\x028\x01*8\n\ + \nP2PREQTYPE\x12\t\n\x05CLOSE\x10\0\x12\x0b\n\x07FORWARD\x10\x01\x12\n\n\ + \x06LISTEN\x10\x02\x12\x06\n\x02LS\x10\x03*U\n\x0fCONNMGMTREQTYPE\x12\ + \x0e\n\nCM_CONNECT\x10\0\x12\x11\n\rCM_DISCONNECT\x10\x01\x12\r\n\tCM_ST\ + ATUS\x10\x02\x12\x10\n\x0cCM_GET_PEERS\x10\x03*.\n\rEXTRASREQTYPE\x12\r\ + \n\tEX_ENABLE\x10\0\x12\x0e\n\nEX_DISABLE\x10\x01*?\n\nEXTRASTYPE\x12\ + \x0c\n\x08IDENTIFY\x10\0\x12\n\n\x06PUBSUB\x10\x01\x12\r\n\tDISCOVERY\ + \x10\x02\x12\x08\n\x04MDNS\x10\x03*T\n\tBSREQTYPE\x12\r\n\tBS_DELETE\x10\ + \0\x12\n\n\x06BS_PUT\x10\x01\x12\x0f\n\x0bBS_PUT_MANY\x10\x02\x12\n\n\ + \x06BS_GET\x10\x03\x12\x0f\n\x0bBS_GET_MANY\x10\x04*&\n\tBSREQOPTS\x12\ + \x0b\n\x07DEFAULT\x10\0\x12\x0c\n\x08BS_FORCE\x10\x01*^\n\nDAGREQTYPE\ + \x12\x0b\n\x07DAG_PUT\x10\0\x12\x0b\n\x07DAG_GET\x10\x01\x12\x10\n\x0cDA\ + G_NEW_NODE\x10\x02\x12\x11\n\rDAG_ADD_LINKS\x10\x03\x12\x11\n\rDAG_GET_L\ + INKS\x10\x04*K\n\tKSREQTYPE\x12\n\n\x06KS_HAS\x10\0\x12\n\n\x06KS_GET\ + \x10\x01\x12\n\n\x06KS_PUT\x10\x02\x12\r\n\tKS_DELETE\x10\x03\x12\x0b\n\ + \x07KS_LIST\x10\x042\xee\x02\n\x07NodeAPI\x127\n\x08ConnMgmt\x12\x13.pb.\ + ConnMgmtRequest\x1a\x14.pb.ConnMgmtResponse\"\0\x12(\n\x06Extras\x12\x11\ + .pb.ExtrasRequest\x1a\t.pb.Empty\"\0\x12(\n\x03P2P\x12\x0e.pb.P2PRequest\ + \x1a\x0f.pb.P2PResponse\"\0\x12=\n\nBlockstore\x12\x15.pb.BlockstoreRequ\ + est\x1a\x16.pb.BlockstoreResponse\"\0\x12(\n\x03Dag\x12\x0e.pb.DagReques\ + t\x1a\x0f.pb.DagResponse\"\0\x127\n\x08Keystore\x12\x13.pb.KeystoreReque\ + st\x1a\x14.pb.KeystoreResponse\"\0\x124\n\x07Persist\x12\x12.pb.PersistR\ + equest\x1a\x13.pb.PersistResponse\"\0J\xe4r\n\x07\x12\x05\0\0\xd8\x02\ + \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\nO\n\x02\x06\0\x12\x04\x05\0\x16\x01\ + \x1aC\x20NodeAPI\x20provide\x20an\x20API\x20to\x20control\x20the\x20unde\ + rlying\x20custom\x20ipfs\x20node\n\n\n\n\x03\x06\0\x01\x12\x03\x05\x08\ + \x0f\n@\n\x04\x06\0\x02\0\x12\x03\x07\x04@\x1a3\x20ConnMgmt\x20provides\ + \x20control\x20over\x20libp2p\x20connections\n\n\x0c\n\x05\x06\0\x02\0\ + \x01\x12\x03\x07\x08\x10\n\x0c\n\x05\x06\0\x02\0\x02\x12\x03\x07\x11\x20\ + \n\x0c\n\x05\x06\0\x02\0\x03\x12\x03\x07+;\nC\n\x04\x06\0\x02\x01\x12\ + \x03\t\x041\x1a6\x20Extras\x20provide\x20control\x20over\x20node\x20extr\ + as\x20capabilities\n\n\x0c\n\x05\x06\0\x02\x01\x01\x12\x03\t\x08\x0e\n\ + \x0c\n\x05\x06\0\x02\x01\x02\x12\x03\t\x0f\x1c\n\x0c\n\x05\x06\0\x02\x01\ + \x03\x12\x03\t',\n\xdf\x01\n\x04\x06\0\x02\x02\x12\x03\r\x041\x1a\xd1\ + \x01\x20P2P\x20allows\x20control\x20of\x20generalized\x20p2p\x20streams\ + \x20for\x20tcp/udp\x20based\x20protocol.\n\x20By\x20using\x20this\x20RPC\ + ,\x20we\x20can\x20tunnel\x20traffic\x20similar\x20to\x20ssh\x20tunneling\ + \n\x20except\x20using\x20libp2p\x20as\x20the\x20transport\x20layer,\x20a\ + nd\x20and\x20tcp/udp\x20port.\n\n\x0c\n\x05\x06\0\x02\x02\x01\x12\x03\r\ + \x08\x0b\n\x0c\n\x05\x06\0\x02\x02\x02\x12\x03\r\x0c\x16\n\x0c\n\x05\x06\ + \0\x02\x02\x03\x12\x03\r!,\nR\n\x04\x06\0\x02\x03\x12\x03\x0f\x04F\x1aE\ + \x20Blockstore\x20allows\x20low-level\x20management\x20of\x20the\x20unde\ + rlying\x20blockstore\n\n\x0c\n\x05\x06\0\x02\x03\x01\x12\x03\x0f\x08\x12\ + \n\x0c\n\x05\x06\0\x02\x03\x02\x12\x03\x0f\x13$\n\x0c\n\x05\x06\0\x02\ + \x03\x03\x12\x03\x0f/A\nZ\n\x04\x06\0\x02\x04\x12\x03\x11\x041\x1aM\x20D\ + ag\x20is\x20a\x20unidirectional\x20rpc\x20allowing\x20manipulation\x20of\ + \x20low-level\x20ipld\x20objects\n\n\x0c\n\x05\x06\0\x02\x04\x01\x12\x03\ + \x11\x08\x0b\n\x0c\n\x05\x06\0\x02\x04\x02\x12\x03\x11\x0c\x16\n\x0c\n\ + \x05\x06\0\x02\x04\x03\x12\x03\x11!,\nU\n\x04\x06\0\x02\x05\x12\x03\x13\ + \x04@\x1aH\x20Keystore\x20is\x20a\x20unidirectional\x20RPC\x20allowing\ + \x20management\x20of\x20ipfs\x20keystores\n\n\x0c\n\x05\x06\0\x02\x05\ + \x01\x12\x03\x13\x08\x10\n\x0c\n\x05\x06\0\x02\x05\x02\x12\x03\x13\x11\ + \x20\n\x0c\n\x05\x06\0\x02\x05\x03\x12\x03\x13+;\n^\n\x04\x06\0\x02\x06\ + \x12\x03\x15\x04=\x1aQ\x20Persist\x20is\x20used\x20to\x20retrieve\x20dat\ + a\x20from\x20the\x20network\x20and\x20make\x20it\x20available\x20locally\ + \n\n\x0c\n\x05\x06\0\x02\x06\x01\x12\x03\x15\x08\x0f\n\x0c\n\x05\x06\0\ + \x02\x06\x02\x12\x03\x15\x10\x1e\n\x0c\n\x05\x06\0\x02\x06\x03\x12\x03\ + \x15)8\nY\n\x02\x05\0\x12\x04\x19\0\"\x01\x1aM\x20P2PREQTYPE\x20denotes\ + \x20the\x20particular\x20type\x20of\x20request\x20being\x20used\x20in\ + \x20the\x20p2p\x20rpc\n\n\n\n\x03\x05\0\x01\x12\x03\x19\x05\x0f\n+\n\x04\ + \x05\0\x02\0\x12\x03\x1b\x04\x0e\x1a\x1e\x20equivalent\x20of\x20ipfs\x20\ + p2p\x20close\n\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x1b\x04\t\n\x0c\n\x05\ + \x05\0\x02\0\x02\x12\x03\x1b\x0c\r\n-\n\x04\x05\0\x02\x01\x12\x03\x1d\ + \x04\x10\x1a\x20\x20equivalent\x20of\x20ipfs\x20p2p\x20forward\n\n\x0c\n\ + \x05\x05\0\x02\x01\x01\x12\x03\x1d\x04\x0b\n\x0c\n\x05\x05\0\x02\x01\x02\ + \x12\x03\x1d\x0e\x0f\n,\n\x04\x05\0\x02\x02\x12\x03\x1f\x04\x0f\x1a\x1f\ + \x20equivalent\x20of\x20ipfs\x20p2p\x20listen\n\n\x0c\n\x05\x05\0\x02\ + \x02\x01\x12\x03\x1f\x04\n\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x1f\r\ + \x0e\n(\n\x04\x05\0\x02\x03\x12\x03!\x04\x0b\x1a\x1b\x20equivalent\x20of\ + \x20ipfs\x20p2p\x20ls\n\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03!\x04\x06\n\ + \x0c\n\x05\x05\0\x02\x03\x02\x12\x03!\t\n\n^\n\x02\x04\0\x12\x04%\0;\x01\ + \x1aR\x20P2PRequest\x20is\x20a\x20request\x20message\x20holding\x20the\ + \x20details\x20of\x20a\x20particular\x20P2P\x20rpc\x20call\n\n\n\n\x03\ + \x04\0\x01\x12\x03%\x08\x12\n)\n\x04\x04\0\x02\0\x12\x03'\x04\x1f\x1a\ + \x1c\x20indicates\x20the\x20request\x20type\n\n\r\n\x05\x04\0\x02\0\x04\ + \x12\x04'\x04%\x14\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03'\x04\x0e\n\x0c\n\ + \x05\x04\0\x02\0\x01\x12\x03'\x0f\x1a\n\x0c\n\x05\x04\0\x02\0\x03\x12\ + \x03'\x1d\x1e\n(\n\x04\x04\0\x02\x01\x12\x03)\x04\x11\x1a\x1b\x20used\ + \x20by:\x20P2PREQTYPE.CLOSE\n\n\r\n\x05\x04\0\x02\x01\x04\x12\x04)\x04'\ + \x1f\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03)\x04\x08\n\x0c\n\x05\x04\0\ + \x02\x01\x01\x12\x03)\t\x0c\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03)\x0f\ + \x10\n%\n\x04\x04\0\x02\x02\x12\x03+\x04\x15\x1a\x18\x20used\x20by:\x20P\ + 2PREQTYPE.LS\n\n\r\n\x05\x04\0\x02\x02\x04\x12\x04+\x04)\x11\n\x0c\n\x05\ + \x04\0\x02\x02\x05\x12\x03+\x04\x08\n\x0c\n\x05\x04\0\x02\x02\x01\x12\ + \x03+\t\x10\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03+\x13\x14\nO\n\x04\x04\ + \0\x02\x03\x12\x03-\x04\x1c\x1aB\x20used\x20by:\x20P2PREQTYPE.CLOSE,\x20\ + P2PREQTYPE.FORWARD,\x20P2PREQTYPE.LISTEN\n\n\r\n\x05\x04\0\x02\x03\x04\ + \x12\x04-\x04+\x15\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03-\x04\n\n\x0c\n\ + \x05\x04\0\x02\x03\x01\x12\x03-\x0b\x17\n\x0c\n\x05\x04\0\x02\x03\x03\ + \x12\x03-\x1a\x1b\n^\n\x04\x04\0\x02\x04\x12\x030\x04\x1d\x1aQ\x20used\ + \x20by:\x20P2PREQTYPE.CLOSE,\x20P2PREQTYPE.FORWARD\n\x20must\x20be\x20sp\ + ecified\x20as\x20a\x20multiaddr\n\n\r\n\x05\x04\0\x02\x04\x04\x12\x040\ + \x04-\x1c\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x030\x04\n\n\x0c\n\x05\x04\0\ + \x02\x04\x01\x12\x030\x0b\x18\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x030\x1b\ + \x1c\n^\n\x04\x04\0\x02\x05\x12\x033\x04\x1d\x1aQ\x20used\x20by:\x20P2PR\ + EQTYPE.CLOSE,\x20P2PREQTYPE.FORWARD\n\x20must\x20be\x20specified\x20as\ + \x20a\x20multiaddr\n\n\r\n\x05\x04\0\x02\x05\x04\x12\x043\x040\x1d\n\x0c\ + \n\x05\x04\0\x02\x05\x05\x12\x033\x04\n\n\x0c\n\x05\x04\0\x02\x05\x01\ + \x12\x033\x0b\x18\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x033\x1b\x1c\nK\n\ + \x04\x04\0\x02\x06\x12\x036\x04\x1d\x1a>\x20used\x20by:\x20P2PREQTYPE.LI\ + STEN\n\x20must\x20be\x20specified\x20as\x20a\x20multiaddr\n\n\r\n\x05\ + \x04\0\x02\x06\x04\x12\x046\x043\x1d\n\x0c\n\x05\x04\0\x02\x06\x05\x12\ + \x036\x04\n\n\x0c\n\x05\x04\0\x02\x06\x01\x12\x036\x0b\x18\n\x0c\n\x05\ + \x04\0\x02\x06\x03\x12\x036\x1b\x1c\n=\n\x04\x04\0\x02\x07\x12\x038\x04\ + \"\x1a0\x20used\x20by:\x20P2PREQTYPE.LISTEN,\x20P2PREQTYPE.FORWARD\n\n\r\ + \n\x05\x04\0\x02\x07\x04\x12\x048\x046\x1d\n\x0c\n\x05\x04\0\x02\x07\x05\ + \x12\x038\x04\x08\n\x0c\n\x05\x04\0\x02\x07\x01\x12\x038\t\x1d\n\x0c\n\ + \x05\x04\0\x02\x07\x03\x12\x038\x20!\n)\n\x04\x04\0\x02\x08\x12\x03:\x04\ + \x1a\x1a\x1c\x20used\x20by:\x20P2PREQTYPE.LISTEN\n\n\r\n\x05\x04\0\x02\ + \x08\x04\x12\x04:\x048\"\n\x0c\n\x05\x04\0\x02\x08\x05\x12\x03:\x04\x08\ + \n\x0c\n\x05\x04\0\x02\x08\x01\x12\x03:\t\x15\n\x0c\n\x05\x04\0\x02\x08\ + \x03\x12\x03:\x18\x19\nX\n\x02\x04\x01\x12\x04>\0F\x01\x1aL\x20P2PRespon\ + se\x20is\x20a\x20response\x20message\x20sent\x20in\x20response\x20to\x20\ + a\x20P2PRequest\x20message\n\n\n\n\x03\x04\x01\x01\x12\x03>\x08\x13\n\ + \x0b\n\x04\x04\x01\x02\0\x12\x03?\x04\x1f\n\r\n\x05\x04\x01\x02\0\x04\ + \x12\x04?\x04>\x15\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03?\x04\x0e\n\x0c\ + \n\x05\x04\x01\x02\0\x01\x12\x03?\x0f\x1a\n\x0c\n\x05\x04\x01\x02\0\x03\ + \x12\x03?\x1d\x1e\n)\n\x04\x04\x01\x02\x01\x12\x03A\x04\x1e\x1a\x1c\x20s\ + ent\x20by:\x20P2PREQTYPE.LISTEN\n\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\ + \x03A\x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03A\r\x13\n\x0c\n\x05\ + \x04\x01\x02\x01\x01\x12\x03A\x14\x19\n\x0c\n\x05\x04\x01\x02\x01\x03\ + \x12\x03A\x1c\x1d\nU\n\x04\x04\x01\x02\x02\x12\x03C\x04\x1a\x1aH\x20sent\ + \x20by:\x20P2PREQTYPE.CLOSE\x20to\x20indicate\x20the\x20number\x20of\x20\ + connections\x20closed\n\n\r\n\x05\x04\x01\x02\x02\x04\x12\x04C\x04A\x1e\ + \n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03C\x04\t\n\x0c\n\x05\x04\x01\x02\ + \x02\x01\x12\x03C\n\x15\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03C\x18\x19\ + \nO\n\x04\x04\x01\x02\x03\x12\x03E\x04'\x1aB\x20sent\x20by:\x20P2PREQTYP\ + E.LS\x20and\x20contains\x20all\x20known\x20stream\x20information\n\n\x0c\ + \n\x05\x04\x01\x02\x03\x04\x12\x03E\x04\x0c\n\x0c\n\x05\x04\x01\x02\x03\ + \x06\x12\x03E\r\x16\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03E\x17\"\n\x0c\ + \n\x05\x04\x01\x02\x03\x03\x12\x03E%&\nF\n\x02\x04\x02\x12\x04I\0O\x01\ + \x1a:\x20P2PLsInfo\x20contains\x20information\x20about\x20a\x20single\ + \x20p2p\x20stream\n\n\n\n\x03\x04\x02\x01\x12\x03I\x08\x11\n\x0b\n\x04\ + \x04\x02\x02\0\x12\x03J\x04\x1c\n\r\n\x05\x04\x02\x02\0\x04\x12\x04J\x04\ + I\x13\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03J\x04\n\n\x0c\n\x05\x04\x02\ + \x02\0\x01\x12\x03J\x0b\x17\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03J\x1a\ + \x1b\n\x0b\n\x04\x04\x02\x02\x01\x12\x03K\x04\x1d\n\r\n\x05\x04\x02\x02\ + \x01\x04\x12\x04K\x04J\x1c\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03K\x04\ + \n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03K\x0b\x18\n\x0c\n\x05\x04\x02\ + \x02\x01\x03\x12\x03K\x1b\x1c\n\x0b\n\x04\x04\x02\x02\x02\x12\x03L\x04\ + \x1d\n\r\n\x05\x04\x02\x02\x02\x04\x12\x04L\x04K\x1d\n\x0c\n\x05\x04\x02\ + \x02\x02\x05\x12\x03L\x04\n\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03L\x0b\ + \x18\n\x0c\n\x05\x04\x02\x02\x02\x03\x12\x03L\x1b\x1c\nP\n\x04\x04\x02\ + \x02\x03\x12\x03N\x04\x13\x1aC\x20indicates\x20whether\x20or\x20not\x20t\ + his\x20is\x20a\x20p2p\x20listener\x20or\x20local\x20listener\n\n\r\n\x05\ + \x04\x02\x02\x03\x04\x12\x04N\x04L\x1d\n\x0c\n\x05\x04\x02\x02\x03\x05\ + \x12\x03N\x04\x08\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03N\t\x0e\n\x0c\n\ + \x05\x04\x02\x02\x03\x03\x12\x03N\x11\x12\nW\n\x02\x04\x03\x12\x04R\0U\ + \x01\x1aK\x20GetPeersResponse\x20is\x20a\x20response\x20to\x20GetPeers\ + \x20containing\x20a\x20slice\x20of\x20peer\x20IDs\n\n\n\n\x03\x04\x03\ + \x01\x12\x03R\x08\x18\n\"\n\x04\x04\x03\x02\0\x12\x03T\x04\x20\x1a\x15\ + \x20a\x20slice\x20of\x20peer\x20IDs\n\n\x0c\n\x05\x04\x03\x02\0\x04\x12\ + \x03T\x04\x0c\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03T\r\x13\n\x0c\n\x05\ + \x04\x03\x02\0\x01\x12\x03T\x14\x1b\n\x0c\n\x05\x04\x03\x02\0\x03\x12\ + \x03T\x1e\x1f\nW\n\x02\x05\x01\x12\x04X\0b\x01\x1aK\x20CONNMGMTREQTYPE\ + \x20indicates\x20the\x20particular\x20ConnMgmt\x20request\x20being\x20pe\ + rformed\n\n\n\n\x03\x05\x01\x01\x12\x03X\x05\x14\n=\n\x04\x05\x01\x02\0\ + \x12\x03Z\x04\x13\x1a0\x20CM_CONNECT\x20is\x20used\x20to\x20connect\x20t\ + o\x20a\x20libp2p\x20peer\n\n\x0c\n\x05\x05\x01\x02\0\x01\x12\x03Z\x04\ + \x0e\n\x0c\n\x05\x05\x01\x02\0\x02\x12\x03Z\x11\x12\nE\n\x04\x05\x01\x02\ + \x01\x12\x03\\\x04\x16\x1a8\x20CM_DISCONNECT\x20is\x20used\x20to\x20disc\ + onnect\x20from\x20a\x20libp2p\x20peer\n\n\x0c\n\x05\x05\x01\x02\x01\x01\ + \x12\x03\\\x04\x11\n\x0c\n\x05\x05\x01\x02\x01\x02\x12\x03\\\x14\x15\n\ + \x9f\x01\n\x04\x05\x01\x02\x02\x12\x03_\x04\x12\x1a\x91\x01\x20CM_STATUS\ + \x20is\x20used\x20to\x20return\x20status\x20information\x20about\x20libp\ + 2p\x20peer\x20connections\n\x20useful\x20for\x20determining\x20whether\ + \x20or\x20not\x20we\x20are\x20connected\x20to\x20someone\n\n\x0c\n\x05\ + \x05\x01\x02\x02\x01\x12\x03_\x04\r\n\x0c\n\x05\x05\x01\x02\x02\x02\x12\ + \x03_\x10\x11\n<\n\x04\x05\x01\x02\x03\x12\x03a\x04\x15\x1a/CM_GET_PEERS\ + \x20is\x20used\x20to\x20return\x20all\x20known\x20peers\n\n\x0c\n\x05\ + \x05\x01\x02\x03\x01\x12\x03a\x04\x10\n\x0c\n\x05\x05\x01\x02\x03\x02\ + \x12\x03a\x13\x14\n\n\n\x02\x04\x04\x12\x04d\0m\x01\n\n\n\x03\x04\x04\ + \x01\x12\x03d\x08\x17\nU\n\x04\x04\x04\x02\0\x12\x03f\x04$\x1aH\x20indic\ + ates\x20the\x20particular\x20connection\x20management\x20request\x20bein\ + g\x20performed\n\n\r\n\x05\x04\x04\x02\0\x04\x12\x04f\x04d\x19\n\x0c\n\ + \x05\x04\x04\x02\0\x06\x12\x03f\x04\x13\n\x0c\n\x05\x04\x04\x02\0\x01\ + \x12\x03f\x14\x1f\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03f\"#\n8\n\x04\x04\ + \x04\x02\x01\x12\x03i\x04#\x1a+\x20a\x20list\x20of\x20multiaddrs\n\x20se\ + nt\x20by:\x20CM_CONNECT\n\n\x0c\n\x05\x04\x04\x02\x01\x04\x12\x03i\x04\ + \x0c\n\x0c\n\x05\x04\x04\x02\x01\x05\x12\x03i\r\x13\n\x0c\n\x05\x04\x04\ + \x02\x01\x01\x12\x03i\x14\x1e\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03i!\ + \"\nR\n\x04\x04\x04\x02\x02\x12\x03l\x04\x20\x1aE\x20a\x20list\x20of\x20\ + peer\x20IDs\n\x20sent\x20by:\x20CM_DISCONNECT,\x20CM_STATUS,\x20CM_GET_P\ + EERS\n\n\x0c\n\x05\x04\x04\x02\x02\x04\x12\x03l\x04\x0c\n\x0c\n\x05\x04\ + \x04\x02\x02\x05\x12\x03l\r\x13\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03l\ + \x14\x1b\n\x0c\n\x05\x04\x04\x02\x02\x03\x12\x03l\x1e\x1f\n\n\n\x02\x04\ + \x05\x12\x04o\0v\x01\n\n\n\x03\x04\x05\x01\x12\x03o\x08\x18\nU\n\x04\x04\ + \x05\x02\0\x12\x03q\x04$\x1aH\x20indicates\x20the\x20particular\x20conne\ + ction\x20management\x20request\x20being\x20performed\n\n\r\n\x05\x04\x05\ + \x02\0\x04\x12\x04q\x04o\x1a\n\x0c\n\x05\x04\x05\x02\0\x06\x12\x03q\x04\ + \x13\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03q\x14\x1f\n\x0c\n\x05\x04\x05\ + \x02\0\x03\x12\x03q\"#\n\x0b\n\x04\x04\x05\x02\x01\x12\x03r\x04$\n\r\n\ + \x05\x04\x05\x02\x01\x04\x12\x04r\x04q$\n\x0c\n\x05\x04\x05\x02\x01\x06\ + \x12\x03r\x04\x15\n\x0c\n\x05\x04\x05\x02\x01\x01\x12\x03r\x16\x1f\n\x0c\ + \n\x05\x04\x05\x02\x01\x03\x12\x03r\"#\nh\n\x04\x04\x05\x02\x02\x12\x03t\ + \x04+\x1a[\x20a\x20map\x20of\x20the\x20peer\x20id,\x20and\x20a\x20custom\ + \x20message\x20indicating\x20success,\x20or\x20why\x20there\x20was\x20a\ + \x20failure\n\n\r\n\x05\x04\x05\x02\x02\x04\x12\x04t\x04r$\n\x0c\n\x05\ + \x04\x05\x02\x02\x06\x12\x03t\x04\x1f\n\x0c\n\x05\x04\x05\x02\x02\x01\ + \x12\x03t\x20&\n\x0c\n\x05\x04\x05\x02\x02\x03\x12\x03t)*\n\x0b\n\x04\ + \x04\x05\x02\x03\x12\x03u\x04\x20\n\x0c\n\x05\x04\x05\x02\x03\x04\x12\ + \x03u\x04\x0c\n\x0c\n\x05\x04\x05\x02\x03\x05\x12\x03u\r\x13\n\x0c\n\x05\ + \x04\x05\x02\x03\x01\x12\x03u\x14\x1b\n\x0c\n\x05\x04\x05\x02\x03\x03\ + \x12\x03u\x1e\x1f\nO\n\x02\x04\x06\x12\x04y\0~\x01\x1aC\x20Contains\x20s\ + tatus\x20information\x20about\x20a\x20particular\x20disconnect\x20attemp\ + t\n\n\n\n\x03\x04\x06\x01\x12\x03y\x08\x16\n?\n\x04\x04\x06\x02\0\x12\ + \x03{\x04\x1a\x1a2\x20indicate\x20whether\x20or\x20not\x20we\x20actually\ + \x20disconnected\n\n\r\n\x05\x04\x06\x02\0\x04\x12\x04{\x04y\x18\n\x0c\n\ + \x05\x04\x06\x02\0\x05\x12\x03{\x04\x08\n\x0c\n\x05\x04\x06\x02\0\x01\ + \x12\x03{\t\x15\n\x0c\n\x05\x04\x06\x02\0\x03\x12\x03{\x18\x19\nC\n\x04\ + \x04\x06\x02\x01\x12\x03}\x04\x16\x1a6\x20if\x20disconnected\x20is\x20fa\ + lse,\x20the\x20reason\x20why\x20it\x20is\x20false\n\n\r\n\x05\x04\x06\ + \x02\x01\x04\x12\x04}\x04{\x1a\n\x0c\n\x05\x04\x06\x02\x01\x05\x12\x03}\ + \x04\n\n\x0c\n\x05\x04\x06\x02\x01\x01\x12\x03}\x0b\x11\n\x0c\n\x05\x04\ + \x06\x02\x01\x03\x12\x03}\x14\x15\nU\n\x02\x05\x02\x12\x06\x81\x01\0\x86\ + \x01\x01\x1aG\x20EXTRASREQTYPE\x20indicates\x20the\x20particular\x20Extr\ + as\x20request\x20being\x20performed\n\n\x0b\n\x03\x05\x02\x01\x12\x04\ + \x81\x01\x05\x12\nL\n\x04\x05\x02\x02\0\x12\x04\x83\x01\x04\x12\x1a>\x20\ + EX_ENABLE\x20is\x20used\x20to\x20enable\x20a\x20particular\x20node\x20ex\ + tras\x20feature\n\n\r\n\x05\x05\x02\x02\0\x01\x12\x04\x83\x01\x04\r\n\r\ + \n\x05\x05\x02\x02\0\x02\x12\x04\x83\x01\x10\x11\nN\n\x04\x05\x02\x02\ + \x01\x12\x04\x85\x01\x04\x13\x1a@\x20EX_DISABLE\x20is\x20used\x20to\x20d\ + isable\x20a\x20particular\x20node\x20extras\x20feature\n\n\r\n\x05\x05\ + \x02\x02\x01\x01\x12\x04\x85\x01\x04\x0e\n\r\n\x05\x05\x02\x02\x01\x02\ + \x12\x04\x85\x01\x11\x12\n;\n\x02\x05\x03\x12\x06\x89\x01\0\x92\x01\x01\ + \x1a-\x20EXTRASTYPE\x20denotes\x20a\x20particular\x20extras\x20type\n\n\ + \x0b\n\x03\x05\x03\x01\x12\x04\x89\x01\x05\x0f\n0\n\x04\x05\x03\x02\0\ + \x12\x04\x8b\x01\x04\x11\x1a\"\x20IDENTIFY\x20is\x20the\x20identify\x20s\ + ervice\n\n\r\n\x05\x05\x03\x02\0\x01\x12\x04\x8b\x01\x04\x0c\n\r\n\x05\ + \x05\x03\x02\0\x02\x12\x04\x8b\x01\x0f\x10\n2\n\x04\x05\x03\x02\x01\x12\ + \x04\x8d\x01\x04\x0f\x1a$\x20PUBSUB\x20is\x20the\x20libp2p\x20pubsub\x20\ + system\n\n\r\n\x05\x05\x03\x02\x01\x01\x12\x04\x8d\x01\x04\n\n\r\n\x05\ + \x05\x03\x02\x01\x02\x12\x04\x8d\x01\r\x0e\n7\n\x04\x05\x03\x02\x02\x12\ + \x04\x8f\x01\x04\x12\x1a)\x20DISCOVERY\x20is\x20a\x20libp2p\x20discovery\ + \x20service\n\n\r\n\x05\x05\x03\x02\x02\x01\x12\x04\x8f\x01\x04\r\n\r\n\ + \x05\x05\x03\x02\x02\x02\x12\x04\x8f\x01\x10\x11\n?\n\x04\x05\x03\x02\ + \x03\x12\x04\x91\x01\x04\r\x1a1\x20MDNS\x20is\x20used\x20to\x20discover\ + \x20libp2p\x20hosts\x20over\x20mdns\n\n\r\n\x05\x05\x03\x02\x03\x01\x12\ + \x04\x91\x01\x04\x08\n\r\n\x05\x05\x03\x02\x03\x02\x12\x04\x91\x01\x0b\ + \x0c\n\x0c\n\x02\x04\x07\x12\x06\x94\x01\0\x99\x01\x01\n\x0b\n\x03\x04\ + \x07\x01\x12\x04\x94\x01\x08\x15\n5\n\x04\x04\x07\x02\0\x12\x04\x96\x01\ + \x04\"\x1a'\x20indicates\x20the\x20request\x20being\x20performed\n\n\x0f\ + \n\x05\x04\x07\x02\0\x04\x12\x06\x96\x01\x04\x94\x01\x17\n\r\n\x05\x04\ + \x07\x02\0\x06\x12\x04\x96\x01\x04\x11\n\r\n\x05\x04\x07\x02\0\x01\x12\ + \x04\x96\x01\x12\x1d\n\r\n\x05\x04\x07\x02\0\x03\x12\x04\x96\x01\x20!\nD\ + \n\x04\x04\x07\x02\x01\x12\x04\x98\x01\x04!\x1a6\x20indicates\x20the\x20\ + extras\x20feature\x20this\x20request\x20applies\x20to\n\n\x0f\n\x05\x04\ + \x07\x02\x01\x04\x12\x06\x98\x01\x04\x96\x01\"\n\r\n\x05\x04\x07\x02\x01\ + \x06\x12\x04\x98\x01\x04\x0e\n\r\n\x05\x04\x07\x02\x01\x01\x12\x04\x98\ + \x01\x0f\x1c\n\r\n\x05\x04\x07\x02\x01\x03\x12\x04\x98\x01\x1f\x20\nA\n\ + \x02\x05\x04\x12\x06\x9d\x01\0\xa8\x01\x01\x1a3\x20BSREQTYPE\x20is\x20a\ + \x20particular\x20blockstore\x20request\x20type\n\n\x0b\n\x03\x05\x04\ + \x01\x12\x04\x9d\x01\x05\x0e\nB\n\x04\x05\x04\x02\0\x12\x04\x9f\x01\x04\ + \x12\x1a4\x20BS_DELETE\x20is\x20used\x20to\x20delete\x20a\x20block\x20fr\ + om\x20the\x20store\n\n\r\n\x05\x05\x04\x02\0\x01\x12\x04\x9f\x01\x04\r\n\ + \r\n\x05\x05\x04\x02\0\x02\x12\x04\x9f\x01\x10\x11\nA\n\x04\x05\x04\x02\ + \x01\x12\x04\xa1\x01\x04\x0f\x1a3\x20BS_PUT\x20is\x20used\x20to\x20put\ + \x20a\x20single\x20block\x20in\x20the\x20store\n\n\r\n\x05\x05\x04\x02\ + \x01\x01\x12\x04\xa1\x01\x04\n\n\r\n\x05\x05\x04\x02\x01\x02\x12\x04\xa1\ + \x01\r\x0e\nC\n\x04\x05\x04\x02\x02\x12\x04\xa3\x01\x04\x14\x1a5\x20BS_P\ + UT_MANY\x20is\x20used\x20to\x20put\x20many\x20blocks\x20in\x20the\x20sto\ + re\n\n\r\n\x05\x05\x04\x02\x02\x01\x12\x04\xa3\x01\x04\x0f\n\r\n\x05\x05\ + \x04\x02\x02\x02\x12\x04\xa3\x01\x12\x13\n<\n\x04\x05\x04\x02\x03\x12\ + \x04\xa5\x01\x04\x0f\x1a.\x20BS_GET\x20is\x20used\x20to\x20get\x20a\x20b\ + lock\x20from\x20the\x20store\n\n\r\n\x05\x05\x04\x02\x03\x01\x12\x04\xa5\ + \x01\x04\n\n\r\n\x05\x05\x04\x02\x03\x02\x12\x04\xa5\x01\r\x0e\nE\n\x04\ + \x05\x04\x02\x04\x12\x04\xa7\x01\x04\x14\x1a7\x20BS_GET_MANY\x20is\x20us\ + ed\x20to\x20get\x20many\x20blocks\x20from\x20the\x20store\n\n\r\n\x05\ + \x05\x04\x02\x04\x01\x12\x04\xa7\x01\x04\x0f\n\r\n\x05\x05\x04\x02\x04\ + \x02\x12\x04\xa7\x01\x12\x13\n=\n\x02\x05\x05\x12\x06\xab\x01\0\xb0\x01\ + \x01\x1a/\x20BSREQOPTS\x20are\x20options\x20for\x20blockstore\x20request\ + s\n\n\x0b\n\x03\x05\x05\x01\x12\x04\xab\x01\x05\x0e\n=\n\x04\x05\x05\x02\ + \0\x12\x04\xad\x01\x04\x10\x1a/\x20DEFAULT\x20indicates\x20to\x20use\x20\ + the\x20default\x20settings\n\n\r\n\x05\x05\x05\x02\0\x01\x12\x04\xad\x01\ + \x04\x0b\n\r\n\x05\x05\x05\x02\0\x02\x12\x04\xad\x01\x0e\x0f\nY\n\x04\ + \x05\x05\x02\x01\x12\x04\xaf\x01\x04\x11\x1aK\x20BS_FORCE\x20indicates\ + \x20to\x20force\x20the\x20request\x20regardless\x20of\x20any\x20possible\ + \x20issues\n\n\r\n\x05\x05\x05\x02\x01\x01\x12\x04\xaf\x01\x04\x0c\n\r\n\ + \x05\x05\x05\x02\x01\x02\x12\x04\xaf\x01\x0f\x10\nJ\n\x02\x04\x08\x12\ + \x06\xb3\x01\0\xc4\x01\x01\x1a<\x20BlockstoreRequest\x20is\x20a\x20messa\ + ge\x20used\x20to\x20control\x20blockstores\n\n\x0b\n\x03\x04\x08\x01\x12\ + \x04\xb3\x01\x08\x19\nA\n\x04\x04\x08\x02\0\x12\x04\xb5\x01\x04\x1e\x1a3\ + \x20\x20indicates\x20the\x20particular\x20request\x20type\x20being\x20ma\ + de\n\n\x0f\n\x05\x04\x08\x02\0\x04\x12\x06\xb5\x01\x04\xb3\x01\x1b\n\r\n\ + \x05\x04\x08\x02\0\x06\x12\x04\xb5\x01\x04\r\n\r\n\x05\x04\x08\x02\0\x01\ + \x12\x04\xb5\x01\x0e\x19\n\r\n\x05\x04\x08\x02\0\x03\x12\x04\xb5\x01\x1c\ + \x1d\n)\n\x04\x04\x08\x02\x01\x12\x04\xb7\x01\x04#\x1a\x1b\x20optional\ + \x20request\x20settings\n\n\r\n\x05\x04\x08\x02\x01\x04\x12\x04\xb7\x01\ + \x04\x0c\n\r\n\x05\x04\x08\x02\x01\x06\x12\x04\xb7\x01\r\x16\n\r\n\x05\ + \x04\x08\x02\x01\x01\x12\x04\xb7\x01\x17\x1e\n\r\n\x05\x04\x08\x02\x01\ + \x03\x12\x04\xb7\x01!\"\nG\n\x04\x04\x08\x02\x02\x12\x04\xba\x01\x04\x1d\ + \x1a9\x20cids\x20of\x20blocks\n\x20sent\x20by:\x20BS_DELETE,\x20BS_GET,\ + \x20BS_GET_MANY\n\n\r\n\x05\x04\x08\x02\x02\x04\x12\x04\xba\x01\x04\x0c\ + \n\r\n\x05\x04\x08\x02\x02\x05\x12\x04\xba\x01\r\x13\n\r\n\x05\x04\x08\ + \x02\x02\x01\x12\x04\xba\x01\x14\x18\n\r\n\x05\x04\x08\x02\x02\x03\x12\ + \x04\xba\x01\x1b\x1c\nE\n\x04\x04\x08\x02\x03\x12\x04\xbd\x01\x04\x1c\ + \x1a7\x20the\x20data\x20we\x20are\x20putting\n\x20sent\x20by:\x20BS_PUT,\ + \x20BS_PUT_MANY\n\n\r\n\x05\x04\x08\x02\x03\x04\x12\x04\xbd\x01\x04\x0c\ + \n\r\n\x05\x04\x08\x02\x03\x05\x12\x04\xbd\x01\r\x12\n\r\n\x05\x04\x08\ + \x02\x03\x01\x12\x04\xbd\x01\x13\x17\n\r\n\x05\x04\x08\x02\x03\x03\x12\ + \x04\xbd\x01\x1a\x1b\nl\n\x04\x04\x08\x02\x04\x12\x04\xc0\x01\x04\x1a\ + \x1a^\x20the\x20cid\x20version\x20to\x20use\x20when\x20constructing\x20b\ + locks,\x20default\x20is\x20v1\n\x20sent\x20by:\x20BS_PUT,\x20BS_PUT_MANY\ + \n\n\x0f\n\x05\x04\x08\x02\x04\x04\x12\x06\xc0\x01\x04\xbd\x01\x1c\n\r\n\ + \x05\x04\x08\x02\x04\x05\x12\x04\xc0\x01\x04\n\n\r\n\x05\x04\x08\x02\x04\ + \x01\x12\x04\xc0\x01\x0b\x15\n\r\n\x05\x04\x08\x02\x04\x03\x12\x04\xc0\ + \x01\x18\x19\nt\n\x04\x04\x08\x02\x05\x12\x04\xc3\x01\x04\x18\x1af\x20th\ + e\x20hash\x20function\x20to\x20use\x20when\x20constructing\x20blocks,\ + \x20default\x20is\x20sha2-256\n\x20sent\x20by:\x20BS_PUT,\x20BS_PUT_MANY\ + \n\n\x0f\n\x05\x04\x08\x02\x05\x04\x12\x06\xc3\x01\x04\xc0\x01\x1a\n\r\n\ + \x05\x04\x08\x02\x05\x05\x12\x04\xc3\x01\x04\n\n\r\n\x05\x04\x08\x02\x05\ + \x01\x12\x04\xc3\x01\x0b\x13\n\r\n\x05\x04\x08\x02\x05\x03\x12\x04\xc3\ + \x01\x16\x17\nH\n\x02\x04\t\x12\x06\xc7\x01\0\xd0\x01\x01\x1a:\x20Blocks\ + toreResponse\x20is\x20a\x20response\x20to\x20a\x20BlockstoreqRequest\n\n\ + \x0b\n\x03\x04\t\x01\x12\x04\xc7\x01\x08\x1a\n@\n\x04\x04\t\x02\0\x12\ + \x04\xc9\x01\x04\x1e\x1a2\x20indicates\x20the\x20particular\x20request\ + \x20type\x20being\x20made\n\n\x0f\n\x05\x04\t\x02\0\x04\x12\x06\xc9\x01\ + \x04\xc7\x01\x1c\n\r\n\x05\x04\t\x02\0\x06\x12\x04\xc9\x01\x04\r\n\r\n\ + \x05\x04\t\x02\0\x01\x12\x04\xc9\x01\x0e\x19\n\r\n\x05\x04\t\x02\0\x03\ + \x12\x04\xc9\x01\x1c\x1d\n\xe2\x01\n\x04\x04\t\x02\x01\x12\x04\xcf\x01\ + \x04\x1e\x1a\xd3\x01\x20a\x20copy\x20of\x20blocks\x20from\x20the\x20bloc\ + kstore\n\x20sent\x20by:\x20BS_PUT,\x20BS_PUT_MANY,\x20BS_GET,\x20BS_GET_\ + MANY\n\x20in\x20the\x20case\x20of\x20BS_PUT,\x20and\x20BS_PUT_MANY\x20re\ + quests\n\x20the\x20data\x20field\x20will\x20be\x20empty\x20as\x20this\ + \x20is\x20only\x20populated\n\x20by\x20get\x20requests\n\n\r\n\x05\x04\t\ + \x02\x01\x04\x12\x04\xcf\x01\x04\x0c\n\r\n\x05\x04\t\x02\x01\x06\x12\x04\ + \xcf\x01\r\x12\n\r\n\x05\x04\t\x02\x01\x01\x12\x04\xcf\x01\x13\x19\n\r\n\ + \x05\x04\t\x02\x01\x03\x12\x04\xcf\x01\x1c\x1d\n\x0c\n\x02\x04\n\x12\x06\ + \xd2\x01\0\xd7\x01\x01\n\x0b\n\x03\x04\n\x01\x12\x04\xd2\x01\x08\r\n2\n\ + \x04\x04\n\x02\0\x12\x04\xd4\x01\x04\x13\x1a$\x20cid\x20is\x20the\x20ide\ + ntifier\x20of\x20the\x20block\n\n\x0f\n\x05\x04\n\x02\0\x04\x12\x06\xd4\ + \x01\x04\xd2\x01\x0f\n\r\n\x05\x04\n\x02\0\x05\x12\x04\xd4\x01\x04\n\n\r\ + \n\x05\x04\n\x02\0\x01\x12\x04\xd4\x01\x0b\x0e\n\r\n\x05\x04\n\x02\0\x03\ + \x12\x04\xd4\x01\x11\x12\n8\n\x04\x04\n\x02\x01\x12\x04\xd6\x01\x04\x13\ + \x1a*\x20data\x20is\x20the\x20actual\x20contents\x20of\x20the\x20block\n\ + \n\x0f\n\x05\x04\n\x02\x01\x04\x12\x06\xd6\x01\x04\xd4\x01\x13\n\r\n\x05\ + \x04\n\x02\x01\x05\x12\x04\xd6\x01\x04\t\n\r\n\x05\x04\n\x02\x01\x01\x12\ + \x04\xd6\x01\n\x0e\n\r\n\x05\x04\n\x02\x01\x03\x12\x04\xd6\x01\x11\x12\n\ + R\n\x02\x05\x06\x12\x06\xda\x01\0\xe5\x01\x01\x1aD\x20DAGREQTYPE\x20indi\ + cates\x20the\x20particular\x20DagAPI\x20request\x20being\x20performed\n\ + \n\x0b\n\x03\x05\x06\x01\x12\x04\xda\x01\x05\x0f\n7\n\x04\x05\x06\x02\0\ + \x12\x04\xdc\x01\x04\x10\x1a)\x20DAG_PUT\x20is\x20used\x20to\x20add\x20n\ + ew\x20IPLD\x20objects\n\n\r\n\x05\x05\x06\x02\0\x01\x12\x04\xdc\x01\x04\ + \x0b\n\r\n\x05\x05\x06\x02\0\x02\x12\x04\xdc\x01\x0e\x0f\n<\n\x04\x05\ + \x06\x02\x01\x12\x04\xde\x01\x04\x10\x1a.\x20DAG_GET\x20is\x20used\x20to\ + \x20retrieve\x20IPLD\x20object\x20data\n\n\r\n\x05\x05\x06\x02\x01\x01\ + \x12\x04\xde\x01\x04\x0b\n\r\n\x05\x05\x06\x02\x01\x02\x12\x04\xde\x01\ + \x0e\x0f\nE\n\x04\x05\x06\x02\x02\x12\x04\xe0\x01\x04\x15\x1a7\x20DAG_NE\ + W_NODE\x20is\x20used\x20to\x20create\x20a\x20new\x20IPLD\x20node\x20obje\ + ct\n\n\r\n\x05\x05\x06\x02\x02\x01\x12\x04\xe0\x01\x04\x10\n\r\n\x05\x05\ + \x06\x02\x02\x02\x12\x04\xe0\x01\x13\x14\nI\n\x04\x05\x06\x02\x03\x12\ + \x04\xe2\x01\x04\x16\x1a;\x20DAG_ADD_LINKS\x20is\x20used\x20to\x20add\ + \x20links\x20to\x20an\x20IPLD\x20node\x20object\n\n\r\n\x05\x05\x06\x02\ + \x03\x01\x12\x04\xe2\x01\x04\x11\n\r\n\x05\x05\x06\x02\x03\x02\x12\x04\ + \xe2\x01\x14\x15\n\\\n\x04\x05\x06\x02\x04\x12\x04\xe4\x01\x04\x16\x1aN\ + \x20DAG_GET_LINKS\x20is\x20used\x20to\x20retrieve\x20all\x20links\x20con\ + tained\x20in\x20an\x20IPLD\x20node\x20object\n\n\r\n\x05\x05\x06\x02\x04\ + \x01\x12\x04\xe4\x01\x04\x11\n\r\n\x05\x05\x06\x02\x04\x02\x12\x04\xe4\ + \x01\x14\x15\nA\n\x02\x04\x0b\x12\x06\xe8\x01\0\x81\x02\x01\x1a3\x20Used\ + \x20to\x20submit\x20a\x20request\x20to\x20Dag\x20or\x20DagStream\x20RPCs\ + \n\n\x0b\n\x03\x04\x0b\x01\x12\x04\xe8\x01\x08\x12\nQ\n\x04\x04\x0b\x02\ + \0\x12\x04\xeb\x01\x04\x1f\x1aC\x20indicates\x20the\x20request\x20being\ + \x20performed\n\x20sent\x20by:\x20all\x20request\x20types\n\n\x0f\n\x05\ + \x04\x0b\x02\0\x04\x12\x06\xeb\x01\x04\xe8\x01\x14\n\r\n\x05\x04\x0b\x02\ + \0\x06\x12\x04\xeb\x01\x04\x0e\n\r\n\x05\x04\x0b\x02\0\x01\x12\x04\xeb\ + \x01\x0f\x1a\n\r\n\x05\x04\x0b\x02\0\x03\x12\x04\xeb\x01\x1d\x1e\nL\n\ + \x04\x04\x0b\x02\x01\x12\x04\xee\x01\x04\x13\x1a>\x20data\x20that\x20we\ + \x20will\x20be\x20storing\n\x20sent\x20by:\x20DAG_PUT,\x20DAG_NEW_NODE\n\ + \n\x0f\n\x05\x04\x0b\x02\x01\x04\x12\x06\xee\x01\x04\xeb\x01\x1f\n\r\n\ + \x05\x04\x0b\x02\x01\x05\x12\x04\xee\x01\x04\t\n\r\n\x05\x04\x0b\x02\x01\ + \x01\x12\x04\xee\x01\n\x0e\n\r\n\x05\x04\x0b\x02\x01\x03\x12\x04\xee\x01\ + \x11\x12\nX\n\x04\x04\x0b\x02\x02\x12\x04\xf1\x01\x04\x1e\x1aJ\x20the\ + \x20object\x20encoding\x20type\x20(raw,\x20cbor,\x20protobuf,\x20etc...)\ + \n\x20sent\x20by:\x20DAG_PUT\n\n\x0f\n\x05\x04\x0b\x02\x02\x04\x12\x06\ + \xf1\x01\x04\xee\x01\x13\n\r\n\x05\x04\x0b\x02\x02\x05\x12\x04\xf1\x01\ + \x04\n\n\r\n\x05\x04\x0b\x02\x02\x01\x12\x04\xf1\x01\x0b\x19\n\r\n\x05\ + \x04\x0b\x02\x02\x03\x12\x04\xf1\x01\x1c\x1d\nX\n\x04\x04\x0b\x02\x03\ + \x12\x04\xf4\x01\x04#\x1aJ\x20the\x20serialization\x20format\x20(raw,\ + \x20cbor,\x20protobuf,\x20etc...)\n\x20sent\x20by:\x20DAG_PUT\n\n\x0f\n\ + \x05\x04\x0b\x02\x03\x04\x12\x06\xf4\x01\x04\xf1\x01\x1e\n\r\n\x05\x04\ + \x0b\x02\x03\x05\x12\x04\xf4\x01\x04\n\n\r\n\x05\x04\x0b\x02\x03\x01\x12\ + \x04\xf4\x01\x0b\x1e\n\r\n\x05\x04\x0b\x02\x03\x03\x12\x04\xf4\x01!\"\nw\ + \n\x04\x04\x0b\x02\x04\x12\x04\xf7\x01\x04\x18\x1ai\x20the\x20hash\x20fu\ + nction\x20to\x20to\x20use\x20(sha2-256,\x20sha3-512,\x20etc...)\n\x20sen\ + t\x20by:\x20DAG_PUT,\x20DAG_NEW_NODE,\x20DAG_ADD_LINKS\n\n\x0f\n\x05\x04\ + \x0b\x02\x04\x04\x12\x06\xf7\x01\x04\xf4\x01#\n\r\n\x05\x04\x0b\x02\x04\ + \x05\x12\x04\xf7\x01\x04\n\n\r\n\x05\x04\x0b\x02\x04\x01\x12\x04\xf7\x01\ + \x0b\x13\n\r\n\x05\x04\x0b\x02\x04\x03\x12\x04\xf7\x01\x16\x17\nM\n\x04\ + \x04\x0b\x02\x05\x12\x04\xfa\x01\x04\x19\x1a?\x20the\x20cid\x20version\ + \x20to\x20use\x20(0,\x201)\n\x20sent\x20by:\x20DAG_PUT,\x20DAG_NEW_NODE\ + \n\n\x0f\n\x05\x04\x0b\x02\x05\x04\x12\x06\xfa\x01\x04\xf7\x01\x18\n\r\n\ + \x05\x04\x0b\x02\x05\x05\x12\x04\xfa\x01\x04\t\n\r\n\x05\x04\x0b\x02\x05\ + \x01\x12\x04\xfa\x01\n\x14\n\r\n\x05\x04\x0b\x02\x05\x03\x12\x04\xfa\x01\ + \x17\x18\nv\n\x04\x04\x0b\x02\x06\x12\x04\xfd\x01\x04\x14\x1ah\x20the\ + \x20hash\x20of\x20the\x20object\x20we\x20are\x20processing\n\x20sent\x20\ + by:\x20DAG_GET,\x20DAG_NEW_NODe,\x20DAG_ADD_LINKS,\x20DAG_GET_LINKS\n\n\ + \x0f\n\x05\x04\x0b\x02\x06\x04\x12\x06\xfd\x01\x04\xfa\x01\x19\n\r\n\x05\ + \x04\x0b\x02\x06\x05\x12\x04\xfd\x01\x04\n\n\r\n\x05\x04\x0b\x02\x06\x01\ + \x12\x04\xfd\x01\x0b\x0f\n\r\n\x05\x04\x0b\x02\x06\x03\x12\x04\xfd\x01\ + \x12\x13\nt\n\x04\x04\x0b\x02\x07\x12\x04\x80\x02\x04\"\x1af\x20indicate\ + s\x20links\x20and\x20their\x20names.\x20key\x20=\x20name,\x20value\x20=\ + \x20link\x20hash\n\x20sent\x20by:\x20DAG_NEW_NODE,\x20DAG_ADD_LINKS\n\n\ + \x0f\n\x05\x04\x0b\x02\x07\x04\x12\x06\x80\x02\x04\xfd\x01\x14\n\r\n\x05\ + \x04\x0b\x02\x07\x06\x12\x04\x80\x02\x04\x17\n\r\n\x05\x04\x0b\x02\x07\ + \x01\x12\x04\x80\x02\x18\x1d\n\r\n\x05\x04\x0b\x02\x07\x03\x12\x04\x80\ + \x02\x20!\n:\n\x02\x04\x0c\x12\x06\x84\x02\0\x91\x02\x01\x1a,\x20Used\ + \x20in\x20response\x20to\x20a\x20Dag\x20or\x20DagStream\x20RPC\n\n\x0b\n\ + \x03\x04\x0c\x01\x12\x04\x84\x02\x08\x13\nQ\n\x04\x04\x0c\x02\0\x12\x04\ + \x87\x02\x04\x1f\x1aC\x20indicates\x20the\x20request\x20being\x20perform\ + ed\n\x20sent\x20by:\x20all\x20request\x20types\n\n\x0f\n\x05\x04\x0c\x02\ + \0\x04\x12\x06\x87\x02\x04\x84\x02\x15\n\r\n\x05\x04\x0c\x02\0\x06\x12\ + \x04\x87\x02\x04\x0e\n\r\n\x05\x04\x0c\x02\0\x01\x12\x04\x87\x02\x0f\x1a\ + \n\r\n\x05\x04\x0c\x02\0\x03\x12\x04\x87\x02\x1d\x1e\n\x80\x01\n\x04\x04\ + \x0c\x02\x01\x12\x04\x8a\x02\x04\x1f\x1ar\x20returns\x20the\x20hashes\ + \x20of\x20newly\x20generated\x20IPLD\x20objects\n\x20sent\x20by:\x20DAG_\ + PUT,\x20DAG_NEW_NODE,\x20DAG_ADD_LINKS,\x20DAG_GET_LINKS\n\n\r\n\x05\x04\ + \x0c\x02\x01\x04\x12\x04\x8a\x02\x04\x0c\n\r\n\x05\x04\x0c\x02\x01\x05\ + \x12\x04\x8a\x02\r\x13\n\r\n\x05\x04\x0c\x02\x01\x01\x12\x04\x8a\x02\x14\ + \x1a\n\r\n\x05\x04\x0c\x02\x01\x03\x12\x04\x8a\x02\x1d\x1e\nN\n\x04\x04\ + \x0c\x02\x02\x12\x04\x8d\x02\x04\x16\x1a@\x20the\x20actual\x20data\x20co\ + ntained\x20by\x20the\x20IPLD\x20object\n\x20sent\x20by:\x20DAG_GET\n\n\ + \x0f\n\x05\x04\x0c\x02\x02\x04\x12\x06\x8d\x02\x04\x8a\x02\x1f\n\r\n\x05\ + \x04\x0c\x02\x02\x05\x12\x04\x8d\x02\x04\t\n\r\n\x05\x04\x0c\x02\x02\x01\ + \x12\x04\x8d\x02\n\x11\n\r\n\x05\x04\x0c\x02\x02\x03\x12\x04\x8d\x02\x14\ + \x15\nV\n\x04\x04\x0c\x02\x03\x12\x04\x90\x02\x04\x20\x1aH\x20the\x20lin\ + ks\x20contained\x20within\x20an\x20IPLD\x20node\x20object\n\x20sent\x20b\ + y:\x20DAG_GET_LINKS\n\n\r\n\x05\x04\x0c\x02\x03\x04\x12\x04\x90\x02\x04\ + \x0c\n\r\n\x05\x04\x0c\x02\x03\x06\x12\x04\x90\x02\r\x15\n\r\n\x05\x04\ + \x0c\x02\x03\x01\x12\x04\x90\x02\x16\x1b\n\r\n\x05\x04\x0c\x02\x03\x03\ + \x12\x04\x90\x02\x1e\x1f\n&\n\x02\x04\r\x12\x06\x94\x02\0\x9b\x02\x01\ + \x1a\x18\x20An\x20IPFS\x20MerkleDAG\x20Link\n\n\x0b\n\x03\x04\r\x01\x12\ + \x04\x94\x02\x08\x10\n.\n\x04\x04\r\x02\0\x12\x04\x96\x02\x04\x13\x1a\ + \x20\x20multihash\x20of\x20the\x20target\x20object\n\n\x0f\n\x05\x04\r\ + \x02\0\x04\x12\x06\x96\x02\x04\x94\x02\x12\n\r\n\x05\x04\r\x02\0\x05\x12\ + \x04\x96\x02\x04\t\n\r\n\x05\x04\r\x02\0\x01\x12\x04\x96\x02\n\x0e\n\r\n\ + \x05\x04\r\x02\0\x03\x12\x04\x96\x02\x11\x12\n<\n\x04\x04\r\x02\x01\x12\ + \x04\x98\x02\x04\x14\x1a.\x20utf\x20string\x20name.\x20should\x20be\x20u\ + nique\x20per\x20object\n\n\x0f\n\x05\x04\r\x02\x01\x04\x12\x06\x98\x02\ + \x04\x96\x02\x13\n\r\n\x05\x04\r\x02\x01\x05\x12\x04\x98\x02\x04\n\n\r\n\ + \x05\x04\r\x02\x01\x01\x12\x04\x98\x02\x0b\x0f\n\r\n\x05\x04\r\x02\x01\ + \x03\x12\x04\x98\x02\x12\x13\n0\n\x04\x04\r\x02\x02\x12\x04\x9a\x02\x04\ + \x14\x1a\"\x20cumulative\x20size\x20of\x20target\x20object\n\n\x0f\n\x05\ + \x04\r\x02\x02\x04\x12\x06\x9a\x02\x04\x98\x02\x14\n\r\n\x05\x04\r\x02\ + \x02\x05\x12\x04\x9a\x02\x04\n\n\r\n\x05\x04\r\x02\x02\x01\x12\x04\x9a\ + \x02\x0b\x0f\n\r\n\x05\x04\r\x02\x02\x03\x12\x04\x9a\x02\x12\x13\n&\n\ + \x02\x04\x0e\x12\x06\x9e\x02\0\xa3\x02\x01\x1a\x18\x20An\x20IPFS\x20Merk\ + leDAG\x20Node\n\n\x0b\n\x03\x04\x0e\x01\x12\x04\x9e\x02\x08\x10\n%\n\x04\ + \x04\x0e\x02\0\x12\x04\xa0\x02\x04\x20\x1a\x17\x20refs\x20to\x20other\ + \x20objects\n\n\r\n\x05\x04\x0e\x02\0\x04\x12\x04\xa0\x02\x04\x0c\n\r\n\ + \x05\x04\x0e\x02\0\x06\x12\x04\xa0\x02\r\x15\n\r\n\x05\x04\x0e\x02\0\x01\ + \x12\x04\xa0\x02\x16\x1b\n\r\n\x05\x04\x0e\x02\0\x03\x12\x04\xa0\x02\x1e\ + \x1f\n\x20\n\x04\x04\x0e\x02\x01\x12\x04\xa2\x02\x04\x13\x1a\x12\x20opaq\ + ue\x20user\x20data\n\n\x0f\n\x05\x04\x0e\x02\x01\x04\x12\x06\xa2\x02\x04\ + \xa0\x02\x20\n\r\n\x05\x04\x0e\x02\x01\x05\x12\x04\xa2\x02\x04\t\n\r\n\ + \x05\x04\x0e\x02\x01\x01\x12\x04\xa2\x02\n\x0e\n\r\n\x05\x04\x0e\x02\x01\ + \x03\x12\x04\xa2\x02\x11\x12\nV\n\x02\x05\x07\x12\x06\xa6\x02\0\xb1\x02\ + \x01\x1aH\x20KSREQTYPE\x20indicates\x20the\x20particular\x20KeystoreAPI\ + \x20request\x20being\x20performed\n\n\x0b\n\x03\x05\x07\x01\x12\x04\xa6\ + \x02\x05\x0e\nI\n\x04\x05\x07\x02\0\x12\x04\xa8\x02\x04\x0f\x1a;\x20KS_H\ + AS\x20is\x20used\x20to\x20check\x20if\x20the\x20key\x20exists\x20in\x20o\ + ur\x20keystore\n\n\r\n\x05\x05\x07\x02\0\x01\x12\x04\xa8\x02\x04\n\n\r\n\ + \x05\x05\x07\x02\0\x02\x12\x04\xa8\x02\r\x0e\nN\n\x04\x05\x07\x02\x01\ + \x12\x04\xaa\x02\x04\x0f\x1a@\x20KS_GET\x20is\x20used\x20to\x20retrieve\ + \x20private\x20key\x20bytes\x20from\x20our\x20keystore\n\n\r\n\x05\x05\ + \x07\x02\x01\x01\x12\x04\xaa\x02\x04\n\n\r\n\x05\x05\x07\x02\x01\x02\x12\ + \x04\xaa\x02\r\x0e\nI\n\x04\x05\x07\x02\x02\x12\x04\xac\x02\x04\x0f\x1a;\ + \x20KS_PUT\x20is\x20used\x20to\x20store\x20private\x20key\x20bytes\x20in\ + \x20our\x20keystore\n\n\r\n\x05\x05\x07\x02\x02\x01\x12\x04\xac\x02\x04\ + \n\n\r\n\x05\x05\x07\x02\x02\x02\x12\x04\xac\x02\r\x0e\nJ\n\x04\x05\x07\ + \x02\x03\x12\x04\xae\x02\x04\x12\x1a<\x20KS_DELETE\x20is\x20used\x20to\ + \x20delete\x20private\x20keys\x20from\x20our\x20keystore\n\n\r\n\x05\x05\ + \x07\x02\x03\x01\x12\x04\xae\x02\x04\r\n\r\n\x05\x05\x07\x02\x03\x02\x12\ + \x04\xae\x02\x10\x11\nN\n\x04\x05\x07\x02\x04\x12\x04\xb0\x02\x04\x10\ + \x1a@\x20KS_LIST\x20is\x20used\x20to\x20list\x20all\x20keys\x20in\x20our\ + \x20keystore\x20by\x20their\x20name\n\n\r\n\x05\x05\x07\x02\x04\x01\x12\ + \x04\xb0\x02\x04\x0b\n\r\n\x05\x05\x07\x02\x04\x02\x12\x04\xb0\x02\x0e\ + \x0f\n8\n\x02\x04\x0f\x12\x06\xb4\x02\0\xbd\x02\x01\x1a*\x20Used\x20to\ + \x20submit\x20a\x20request\x20to\x20Keystore\x20RPC\n\n\x0b\n\x03\x04\ + \x0f\x01\x12\x04\xb4\x02\x08\x17\n:\n\x04\x04\x0f\x02\0\x12\x04\xb6\x02\ + \x04\x1e\x1a,\x20indicates\x20the\x20request\x20type\x20being\x20perform\ + ed\n\n\x0f\n\x05\x04\x0f\x02\0\x04\x12\x06\xb6\x02\x04\xb4\x02\x19\n\r\n\ + \x05\x04\x0f\x02\0\x06\x12\x04\xb6\x02\x04\r\n\r\n\x05\x04\x0f\x02\0\x01\ + \x12\x04\xb6\x02\x0e\x19\n\r\n\x05\x04\x0f\x02\0\x03\x12\x04\xb6\x02\x1c\ + \x1d\n^\n\x04\x04\x0f\x02\x01\x12\x04\xb9\x02\x04\x14\x1aP\x20name\x20of\ + \x20the\x20key\x20the\x20request\x20is\x20for\n\x20sent\x20by:\x20KS_HAS\ + ,\x20KS_GET,\x20KS_PUT,\x20KS_DELETE\n\n\x0f\n\x05\x04\x0f\x02\x01\x04\ + \x12\x06\xb9\x02\x04\xb6\x02\x1e\n\r\n\x05\x04\x0f\x02\x01\x05\x12\x04\ + \xb9\x02\x04\n\n\r\n\x05\x04\x0f\x02\x01\x01\x12\x04\xb9\x02\x0b\x0f\n\r\ + \n\x05\x04\x0f\x02\x01\x03\x12\x04\xb9\x02\x12\x13\n=\n\x04\x04\x0f\x02\ + \x02\x12\x04\xbc\x02\x04\x19\x1a/\x20the\x20actual\x20private\x20key\x20\ + bytes\n\x20sent\x20by:\x20KS_PUT\n\n\x0f\n\x05\x04\x0f\x02\x02\x04\x12\ + \x06\xbc\x02\x04\xb9\x02\x14\n\r\n\x05\x04\x0f\x02\x02\x05\x12\x04\xbc\ + \x02\x04\t\n\r\n\x05\x04\x0f\x02\x02\x01\x12\x04\xbc\x02\n\x14\n\r\n\x05\ + \x04\x0f\x02\x02\x03\x12\x04\xbc\x02\x17\x18\n2\n\x02\x04\x10\x12\x06\ + \xc0\x02\0\xcc\x02\x01\x1a$\x20Used\x20in\x20response\x20to\x20a\x20Keys\ + tore\x20RPC\n\n\x0b\n\x03\x04\x10\x01\x12\x04\xc0\x02\x08\x18\n:\n\x04\ + \x04\x10\x02\0\x12\x04\xc2\x02\x04\x1e\x1a,\x20indicates\x20the\x20reque\ + st\x20type\x20being\x20performed\n\n\x0f\n\x05\x04\x10\x02\0\x04\x12\x06\ + \xc2\x02\x04\xc0\x02\x1a\n\r\n\x05\x04\x10\x02\0\x06\x12\x04\xc2\x02\x04\ + \r\n\r\n\x05\x04\x10\x02\0\x01\x12\x04\xc2\x02\x0e\x19\n\r\n\x05\x04\x10\ + \x02\0\x03\x12\x04\xc2\x02\x1c\x1d\n6\n\x04\x04\x10\x02\x01\x12\x04\xc5\ + \x02\x04\x19\x1a(\x20the\x20private\x20key\x20bytes\n\x20sent\x20by:\x20\ + KS_GET\n\n\x0f\n\x05\x04\x10\x02\x01\x04\x12\x06\xc5\x02\x04\xc2\x02\x1e\ + \n\r\n\x05\x04\x10\x02\x01\x05\x12\x04\xc5\x02\x04\t\n\r\n\x05\x04\x10\ + \x02\x01\x01\x12\x04\xc5\x02\n\x14\n\r\n\x05\x04\x10\x02\x01\x03\x12\x04\ + \xc5\x02\x17\x18\n>\n\x04\x04\x10\x02\x02\x12\x04\xc8\x02\x04!\x1a0\x20c\ + ontains\x20all\x20known\x20key\x20names\n\x20sent\x20by:\x20KS_LIST\n\n\ + \r\n\x05\x04\x10\x02\x02\x04\x12\x04\xc8\x02\x04\x0c\n\r\n\x05\x04\x10\ + \x02\x02\x05\x12\x04\xc8\x02\r\x13\n\r\n\x05\x04\x10\x02\x02\x01\x12\x04\ + \xc8\x02\x14\x1c\n\r\n\x05\x04\x10\x02\x02\x03\x12\x04\xc8\x02\x1f\x20\n\ + M\n\x04\x04\x10\x02\x03\x12\x04\xcb\x02\x04\x11\x1a?\x20indicates\x20if\ + \x20we\x20have\x20the\x20key\x20in\x20our\x20keystore\n\x20sent\x20by:\ + \x20KS_HAS\n\n\x0f\n\x05\x04\x10\x02\x03\x04\x12\x06\xcb\x02\x04\xc8\x02\ + !\n\r\n\x05\x04\x10\x02\x03\x05\x12\x04\xcb\x02\x04\x08\n\r\n\x05\x04\ + \x10\x02\x03\x01\x12\x04\xcb\x02\t\x0c\n\r\n\x05\x04\x10\x02\x03\x03\x12\ + \x04\xcb\x02\x0f\x10\n\x0c\n\x02\x04\x11\x12\x06\xce\x02\0\xd1\x02\x01\n\ + \x0b\n\x03\x04\x11\x01\x12\x04\xce\x02\x08\x16\n'\n\x04\x04\x11\x02\0\ + \x12\x04\xd0\x02\x04\x1d\x1a\x19\x20cids\x20to\x20persist\x20locally\n\n\ + \r\n\x05\x04\x11\x02\0\x04\x12\x04\xd0\x02\x04\x0c\n\r\n\x05\x04\x11\x02\ + \0\x05\x12\x04\xd0\x02\r\x13\n\r\n\x05\x04\x11\x02\0\x01\x12\x04\xd0\x02\ + \x14\x18\n\r\n\x05\x04\x11\x02\0\x03\x12\x04\xd0\x02\x1b\x1c\n\x0c\n\x02\ + \x04\x12\x12\x06\xd3\x02\0\xd8\x02\x01\n\x0b\n\x03\x04\x12\x01\x12\x04\ + \xd3\x02\x08\x17\nB\n\x04\x04\x12\x02\0\x12\x04\xd5\x02\x04!\x1a4\x20key\ + \x20=\x20cid,\x20value\x20=\x20whether\x20or\x20not\x20it\x20was\x20pers\ + isted\n\n\x0f\n\x05\x04\x12\x02\0\x04\x12\x06\xd5\x02\x04\xd3\x02\x19\n\ + \r\n\x05\x04\x12\x02\0\x06\x12\x04\xd5\x02\x04\x15\n\r\n\x05\x04\x12\x02\ + \0\x01\x12\x04\xd5\x02\x16\x1c\n\r\n\x05\x04\x12\x02\0\x03\x12\x04\xd5\ + \x02\x1f\x20\n9\n\x04\x04\x12\x02\x01\x12\x04\xd7\x02\x04#\x1a+\x20key\ + \x20=\x20cid,\x20value\x20=\x20error\x20if\x20not\x20persisted\n\n\x0f\n\ + \x05\x04\x12\x02\x01\x04\x12\x06\xd7\x02\x04\xd5\x02!\n\r\n\x05\x04\x12\ + \x02\x01\x06\x12\x04\xd7\x02\x04\x17\n\r\n\x05\x04\x12\x02\x01\x01\x12\ + \x04\xd7\x02\x18\x1e\n\r\n\x05\x04\x12\x02\x01\x03\x12\x04\xd7\x02!\"b\ + \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/node_grpc.rs b/rs/src/node_grpc.rs new file mode 100644 index 0000000..1e7c768 --- /dev/null +++ b/rs/src/node_grpc.rs @@ -0,0 +1,239 @@ +// 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_NODE_API_CONN_MGMT: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.NodeAPI/ConnMgmt", + 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_NODE_API_EXTRAS: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.NodeAPI/Extras", + 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_NODE_API_P2_P: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.NodeAPI/P2P", + 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_NODE_API_BLOCKSTORE: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.NodeAPI/Blockstore", + 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_NODE_API_DAG: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.NodeAPI/Dag", + 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_NODE_API_KEYSTORE: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.NodeAPI/Keystore", + 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_NODE_API_PERSIST: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.NodeAPI/Persist", + 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 NodeApiClient { + client: ::grpcio::Client, +} + +impl NodeApiClient { + pub fn new(channel: ::grpcio::Channel) -> Self { + NodeApiClient { + client: ::grpcio::Client::new(channel), + } + } + + pub fn conn_mgmt_opt(&self, req: &super::node::ConnMgmtRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_NODE_API_CONN_MGMT, req, opt) + } + + pub fn conn_mgmt(&self, req: &super::node::ConnMgmtRequest) -> ::grpcio::Result { + self.conn_mgmt_opt(req, ::grpcio::CallOption::default()) + } + + pub fn conn_mgmt_async_opt(&self, req: &super::node::ConnMgmtRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_NODE_API_CONN_MGMT, req, opt) + } + + pub fn conn_mgmt_async(&self, req: &super::node::ConnMgmtRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.conn_mgmt_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn extras_opt(&self, req: &super::node::ExtrasRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_NODE_API_EXTRAS, req, opt) + } + + pub fn extras(&self, req: &super::node::ExtrasRequest) -> ::grpcio::Result { + self.extras_opt(req, ::grpcio::CallOption::default()) + } + + pub fn extras_async_opt(&self, req: &super::node::ExtrasRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_NODE_API_EXTRAS, req, opt) + } + + pub fn extras_async(&self, req: &super::node::ExtrasRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.extras_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn p2_p_opt(&self, req: &super::node::P2PRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_NODE_API_P2_P, req, opt) + } + + pub fn p2_p(&self, req: &super::node::P2PRequest) -> ::grpcio::Result { + self.p2_p_opt(req, ::grpcio::CallOption::default()) + } + + pub fn p2_p_async_opt(&self, req: &super::node::P2PRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_NODE_API_P2_P, req, opt) + } + + pub fn p2_p_async(&self, req: &super::node::P2PRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.p2_p_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn blockstore_opt(&self, req: &super::node::BlockstoreRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_NODE_API_BLOCKSTORE, req, opt) + } + + pub fn blockstore(&self, req: &super::node::BlockstoreRequest) -> ::grpcio::Result { + self.blockstore_opt(req, ::grpcio::CallOption::default()) + } + + pub fn blockstore_async_opt(&self, req: &super::node::BlockstoreRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_NODE_API_BLOCKSTORE, req, opt) + } + + pub fn blockstore_async(&self, req: &super::node::BlockstoreRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.blockstore_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn dag_opt(&self, req: &super::node::DagRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_NODE_API_DAG, req, opt) + } + + pub fn dag(&self, req: &super::node::DagRequest) -> ::grpcio::Result { + self.dag_opt(req, ::grpcio::CallOption::default()) + } + + pub fn dag_async_opt(&self, req: &super::node::DagRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_NODE_API_DAG, req, opt) + } + + pub fn dag_async(&self, req: &super::node::DagRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.dag_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn keystore_opt(&self, req: &super::node::KeystoreRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_NODE_API_KEYSTORE, req, opt) + } + + pub fn keystore(&self, req: &super::node::KeystoreRequest) -> ::grpcio::Result { + self.keystore_opt(req, ::grpcio::CallOption::default()) + } + + pub fn keystore_async_opt(&self, req: &super::node::KeystoreRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_NODE_API_KEYSTORE, req, opt) + } + + pub fn keystore_async(&self, req: &super::node::KeystoreRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.keystore_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn persist_opt(&self, req: &super::node::PersistRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_NODE_API_PERSIST, req, opt) + } + + pub fn persist(&self, req: &super::node::PersistRequest) -> ::grpcio::Result { + self.persist_opt(req, ::grpcio::CallOption::default()) + } + + pub fn persist_async_opt(&self, req: &super::node::PersistRequest, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_NODE_API_PERSIST, req, opt) + } + + pub fn persist_async(&self, req: &super::node::PersistRequest) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.persist_async_opt(req, ::grpcio::CallOption::default()) + } + pub fn spawn(&self, f: F) where F: ::futures::Future + Send + 'static { + self.client.spawn(f) + } +} + +pub trait NodeApi { + fn conn_mgmt(&mut self, ctx: ::grpcio::RpcContext, req: super::node::ConnMgmtRequest, sink: ::grpcio::UnarySink); + fn extras(&mut self, ctx: ::grpcio::RpcContext, req: super::node::ExtrasRequest, sink: ::grpcio::UnarySink); + fn p2_p(&mut self, ctx: ::grpcio::RpcContext, req: super::node::P2PRequest, sink: ::grpcio::UnarySink); + fn blockstore(&mut self, ctx: ::grpcio::RpcContext, req: super::node::BlockstoreRequest, sink: ::grpcio::UnarySink); + fn dag(&mut self, ctx: ::grpcio::RpcContext, req: super::node::DagRequest, sink: ::grpcio::UnarySink); + fn keystore(&mut self, ctx: ::grpcio::RpcContext, req: super::node::KeystoreRequest, sink: ::grpcio::UnarySink); + fn persist(&mut self, ctx: ::grpcio::RpcContext, req: super::node::PersistRequest, sink: ::grpcio::UnarySink); +} + +pub fn create_node_api(s: S) -> ::grpcio::Service { + let mut builder = ::grpcio::ServiceBuilder::new(); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_NODE_API_CONN_MGMT, move |ctx, req, resp| { + instance.conn_mgmt(ctx, req, resp) + }); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_NODE_API_EXTRAS, move |ctx, req, resp| { + instance.extras(ctx, req, resp) + }); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_NODE_API_P2_P, move |ctx, req, resp| { + instance.p2_p(ctx, req, resp) + }); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_NODE_API_BLOCKSTORE, move |ctx, req, resp| { + instance.blockstore(ctx, req, resp) + }); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_NODE_API_DAG, move |ctx, req, resp| { + instance.dag(ctx, req, resp) + }); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_NODE_API_KEYSTORE, move |ctx, req, resp| { + instance.keystore(ctx, req, resp) + }); + let mut instance = s; + builder = builder.add_unary_handler(&METHOD_NODE_API_PERSIST, move |ctx, req, resp| { + instance.persist(ctx, req, resp) + }); + builder.build() +} diff --git a/rs/src/pubsub.rs b/rs/src/pubsub.rs new file mode 100644 index 0000000..fea678b --- /dev/null +++ b/rs/src/pubsub.rs @@ -0,0 +1,1349 @@ +// 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 `pubsub.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 PubSubRequest { + // message fields + pub requestType: PSREQTYPE, + pub topics: ::protobuf::RepeatedField<::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 PubSubRequest { + fn default() -> &'a PubSubRequest { + ::default_instance() + } +} + +impl PubSubRequest { + pub fn new() -> PubSubRequest { + ::std::default::Default::default() + } + + // .pb.PSREQTYPE requestType = 1; + + + pub fn get_requestType(&self) -> PSREQTYPE { + self.requestType + } + pub fn clear_requestType(&mut self) { + self.requestType = PSREQTYPE::PS_GET_TOPICS; + } + + // Param is passed by value, moved + pub fn set_requestType(&mut self, v: PSREQTYPE) { + self.requestType = v; + } + + // repeated string topics = 2; + + + pub fn get_topics(&self) -> &[::std::string::String] { + &self.topics + } + pub fn clear_topics(&mut self) { + self.topics.clear(); + } + + // Param is passed by value, moved + pub fn set_topics(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.topics = v; + } + + // Mutable pointer to the field. + pub fn mut_topics(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.topics + } + + // Take field + pub fn take_topics(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.topics, ::protobuf::RepeatedField::new()) + } + + // bytes data = 3; + + + 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 PubSubRequest { + 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.topics)?; + }, + 3 => { + ::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.requestType != PSREQTYPE::PS_GET_TOPICS { + my_size += ::protobuf::rt::enum_size(1, self.requestType); + } + for value in &self.topics { + my_size += ::protobuf::rt::string_size(2, &value); + }; + if !self.data.is_empty() { + my_size += ::protobuf::rt::bytes_size(3, &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.requestType != PSREQTYPE::PS_GET_TOPICS { + os.write_enum(1, self.requestType.value())?; + } + for v in &self.topics { + os.write_string(2, &v)?; + }; + if !self.data.is_empty() { + os.write_bytes(3, &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() -> PubSubRequest { + PubSubRequest::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: &PubSubRequest| { &m.requestType }, + |m: &mut PubSubRequest| { &mut m.requestType }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "topics", + |m: &PubSubRequest| { &m.topics }, + |m: &mut PubSubRequest| { &mut m.topics }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "data", + |m: &PubSubRequest| { &m.data }, + |m: &mut PubSubRequest| { &mut m.data }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PubSubRequest", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PubSubRequest { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PubSubRequest, + }; + unsafe { + instance.get(PubSubRequest::new) + } + } +} + +impl ::protobuf::Clear for PubSubRequest { + fn clear(&mut self) { + self.requestType = PSREQTYPE::PS_GET_TOPICS; + self.topics.clear(); + self.data.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PubSubRequest { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PubSubRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PubSubResponse { + // message fields + pub requestType: PSREQTYPE, + pub message: ::protobuf::RepeatedField, + pub topics: ::protobuf::RepeatedField<::std::string::String>, + pub peers: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PubSubResponse { + fn default() -> &'a PubSubResponse { + ::default_instance() + } +} + +impl PubSubResponse { + pub fn new() -> PubSubResponse { + ::std::default::Default::default() + } + + // .pb.PSREQTYPE requestType = 1; + + + pub fn get_requestType(&self) -> PSREQTYPE { + self.requestType + } + pub fn clear_requestType(&mut self) { + self.requestType = PSREQTYPE::PS_GET_TOPICS; + } + + // Param is passed by value, moved + pub fn set_requestType(&mut self, v: PSREQTYPE) { + self.requestType = v; + } + + // repeated .pb.PubSubMessage message = 2; + + + pub fn get_message(&self) -> &[PubSubMessage] { + &self.message + } + pub fn clear_message(&mut self) { + self.message.clear(); + } + + // Param is passed by value, moved + pub fn set_message(&mut self, v: ::protobuf::RepeatedField) { + self.message = v; + } + + // Mutable pointer to the field. + pub fn mut_message(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.message + } + + // Take field + pub fn take_message(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.message, ::protobuf::RepeatedField::new()) + } + + // repeated string topics = 3; + + + pub fn get_topics(&self) -> &[::std::string::String] { + &self.topics + } + pub fn clear_topics(&mut self) { + self.topics.clear(); + } + + // Param is passed by value, moved + pub fn set_topics(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.topics = v; + } + + // Mutable pointer to the field. + pub fn mut_topics(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.topics + } + + // Take field + pub fn take_topics(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.topics, ::protobuf::RepeatedField::new()) + } + + // repeated .pb.PubSubPeer peers = 4; + + + pub fn get_peers(&self) -> &[PubSubPeer] { + &self.peers + } + pub fn clear_peers(&mut self) { + self.peers.clear(); + } + + // Param is passed by value, moved + pub fn set_peers(&mut self, v: ::protobuf::RepeatedField) { + self.peers = v; + } + + // Mutable pointer to the field. + pub fn mut_peers(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.peers + } + + // Take field + pub fn take_peers(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.peers, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for PubSubResponse { + fn is_initialized(&self) -> bool { + for v in &self.message { + if !v.is_initialized() { + return false; + } + }; + for v in &self.peers { + 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.message)?; + }, + 3 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.topics)?; + }, + 4 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.peers)?; + }, + _ => { + ::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 != PSREQTYPE::PS_GET_TOPICS { + my_size += ::protobuf::rt::enum_size(1, self.requestType); + } + for value in &self.message { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.topics { + my_size += ::protobuf::rt::string_size(3, &value); + }; + for value in &self.peers { + 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 != PSREQTYPE::PS_GET_TOPICS { + os.write_enum(1, self.requestType.value())?; + } + for v in &self.message { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.topics { + os.write_string(3, &v)?; + }; + for v in &self.peers { + 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() -> PubSubResponse { + PubSubResponse::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: &PubSubResponse| { &m.requestType }, + |m: &mut PubSubResponse| { &mut m.requestType }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "message", + |m: &PubSubResponse| { &m.message }, + |m: &mut PubSubResponse| { &mut m.message }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "topics", + |m: &PubSubResponse| { &m.topics }, + |m: &mut PubSubResponse| { &mut m.topics }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "peers", + |m: &PubSubResponse| { &m.peers }, + |m: &mut PubSubResponse| { &mut m.peers }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PubSubResponse", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PubSubResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PubSubResponse, + }; + unsafe { + instance.get(PubSubResponse::new) + } + } +} + +impl ::protobuf::Clear for PubSubResponse { + fn clear(&mut self) { + self.requestType = PSREQTYPE::PS_GET_TOPICS; + self.message.clear(); + self.topics.clear(); + self.peers.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PubSubResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PubSubResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PubSubMessage { + // message fields + pub from: ::std::vec::Vec, + pub data: ::std::vec::Vec, + pub seqno: ::std::vec::Vec, + pub topicIDs: ::protobuf::RepeatedField<::std::string::String>, + pub signature: ::std::vec::Vec, + pub key: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PubSubMessage { + fn default() -> &'a PubSubMessage { + ::default_instance() + } +} + +impl PubSubMessage { + pub fn new() -> PubSubMessage { + ::std::default::Default::default() + } + + // bytes from = 1; + + + pub fn get_from(&self) -> &[u8] { + &self.from + } + pub fn clear_from(&mut self) { + self.from.clear(); + } + + // Param is passed by value, moved + pub fn set_from(&mut self, v: ::std::vec::Vec) { + self.from = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_from(&mut self) -> &mut ::std::vec::Vec { + &mut self.from + } + + // Take field + pub fn take_from(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.from, ::std::vec::Vec::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()) + } + + // bytes seqno = 3; + + + pub fn get_seqno(&self) -> &[u8] { + &self.seqno + } + pub fn clear_seqno(&mut self) { + self.seqno.clear(); + } + + // Param is passed by value, moved + pub fn set_seqno(&mut self, v: ::std::vec::Vec) { + self.seqno = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_seqno(&mut self) -> &mut ::std::vec::Vec { + &mut self.seqno + } + + // Take field + pub fn take_seqno(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.seqno, ::std::vec::Vec::new()) + } + + // repeated string topicIDs = 4; + + + pub fn get_topicIDs(&self) -> &[::std::string::String] { + &self.topicIDs + } + pub fn clear_topicIDs(&mut self) { + self.topicIDs.clear(); + } + + // Param is passed by value, moved + pub fn set_topicIDs(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { + self.topicIDs = v; + } + + // Mutable pointer to the field. + pub fn mut_topicIDs(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.topicIDs + } + + // Take field + pub fn take_topicIDs(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { + ::std::mem::replace(&mut self.topicIDs, ::protobuf::RepeatedField::new()) + } + + // bytes signature = 5; + + + pub fn get_signature(&self) -> &[u8] { + &self.signature + } + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + &mut self.signature + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.signature, ::std::vec::Vec::new()) + } + + // bytes key = 6; + + + pub fn get_key(&self) -> &[u8] { + &self.key + } + pub fn clear_key(&mut self) { + self.key.clear(); + } + + // Param is passed by value, moved + pub fn set_key(&mut self, v: ::std::vec::Vec) { + self.key = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_key(&mut self) -> &mut ::std::vec::Vec { + &mut self.key + } + + // Take field + pub fn take_key(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.key, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for PubSubMessage { + 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.from)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.seqno)?; + }, + 4 => { + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.topicIDs)?; + }, + 5 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signature)?; + }, + 6 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.key)?; + }, + _ => { + ::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.from.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.from); + } + if !self.data.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.data); + } + if !self.seqno.is_empty() { + my_size += ::protobuf::rt::bytes_size(3, &self.seqno); + } + for value in &self.topicIDs { + my_size += ::protobuf::rt::string_size(4, &value); + }; + if !self.signature.is_empty() { + my_size += ::protobuf::rt::bytes_size(5, &self.signature); + } + if !self.key.is_empty() { + my_size += ::protobuf::rt::bytes_size(6, &self.key); + } + 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.from.is_empty() { + os.write_bytes(1, &self.from)?; + } + if !self.data.is_empty() { + os.write_bytes(2, &self.data)?; + } + if !self.seqno.is_empty() { + os.write_bytes(3, &self.seqno)?; + } + for v in &self.topicIDs { + os.write_string(4, &v)?; + }; + if !self.signature.is_empty() { + os.write_bytes(5, &self.signature)?; + } + if !self.key.is_empty() { + os.write_bytes(6, &self.key)?; + } + 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() -> PubSubMessage { + PubSubMessage::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>( + "from", + |m: &PubSubMessage| { &m.from }, + |m: &mut PubSubMessage| { &mut m.from }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "data", + |m: &PubSubMessage| { &m.data }, + |m: &mut PubSubMessage| { &mut m.data }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "seqno", + |m: &PubSubMessage| { &m.seqno }, + |m: &mut PubSubMessage| { &mut m.seqno }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "topicIDs", + |m: &PubSubMessage| { &m.topicIDs }, + |m: &mut PubSubMessage| { &mut m.topicIDs }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &PubSubMessage| { &m.signature }, + |m: &mut PubSubMessage| { &mut m.signature }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "key", + |m: &PubSubMessage| { &m.key }, + |m: &mut PubSubMessage| { &mut m.key }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PubSubMessage", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PubSubMessage { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PubSubMessage, + }; + unsafe { + instance.get(PubSubMessage::new) + } + } +} + +impl ::protobuf::Clear for PubSubMessage { + fn clear(&mut self) { + self.from.clear(); + self.data.clear(); + self.seqno.clear(); + self.topicIDs.clear(); + self.signature.clear(); + self.key.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PubSubMessage { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PubSubMessage { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PubSubPeer { + // message fields + pub topic: ::std::string::String, + pub peerID: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PubSubPeer { + fn default() -> &'a PubSubPeer { + ::default_instance() + } +} + +impl PubSubPeer { + pub fn new() -> PubSubPeer { + ::std::default::Default::default() + } + + // string topic = 1; + + + pub fn get_topic(&self) -> &str { + &self.topic + } + pub fn clear_topic(&mut self) { + self.topic.clear(); + } + + // Param is passed by value, moved + pub fn set_topic(&mut self, v: ::std::string::String) { + self.topic = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_topic(&mut self) -> &mut ::std::string::String { + &mut self.topic + } + + // Take field + pub fn take_topic(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.topic, ::std::string::String::new()) + } + + // string peerID = 2; + + + pub fn get_peerID(&self) -> &str { + &self.peerID + } + pub fn clear_peerID(&mut self) { + self.peerID.clear(); + } + + // Param is passed by value, moved + pub fn set_peerID(&mut self, v: ::std::string::String) { + self.peerID = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_peerID(&mut self) -> &mut ::std::string::String { + &mut self.peerID + } + + // Take field + pub fn take_peerID(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.peerID, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for PubSubPeer { + 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.topic)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.peerID)?; + }, + _ => { + ::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.topic.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.topic); + } + if !self.peerID.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.peerID); + } + 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.topic.is_empty() { + os.write_string(1, &self.topic)?; + } + if !self.peerID.is_empty() { + os.write_string(2, &self.peerID)?; + } + 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() -> PubSubPeer { + PubSubPeer::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>( + "topic", + |m: &PubSubPeer| { &m.topic }, + |m: &mut PubSubPeer| { &mut m.topic }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "peerID", + |m: &PubSubPeer| { &m.peerID }, + |m: &mut PubSubPeer| { &mut m.peerID }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PubSubPeer", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PubSubPeer { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PubSubPeer, + }; + unsafe { + instance.get(PubSubPeer::new) + } + } +} + +impl ::protobuf::Clear for PubSubPeer { + fn clear(&mut self) { + self.topic.clear(); + self.peerID.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PubSubPeer { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PubSubPeer { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum PSREQTYPE { + PS_GET_TOPICS = 0, + PS_LIST_PEERS = 1, + PS_SUBSCRIBE = 2, + PS_PUBLISH = 3, +} + +impl ::protobuf::ProtobufEnum for PSREQTYPE { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(PSREQTYPE::PS_GET_TOPICS), + 1 => ::std::option::Option::Some(PSREQTYPE::PS_LIST_PEERS), + 2 => ::std::option::Option::Some(PSREQTYPE::PS_SUBSCRIBE), + 3 => ::std::option::Option::Some(PSREQTYPE::PS_PUBLISH), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [PSREQTYPE] = &[ + PSREQTYPE::PS_GET_TOPICS, + PSREQTYPE::PS_LIST_PEERS, + PSREQTYPE::PS_SUBSCRIBE, + PSREQTYPE::PS_PUBLISH, + ]; + 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("PSREQTYPE", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for PSREQTYPE { +} + +impl ::std::default::Default for PSREQTYPE { + fn default() -> Self { + PSREQTYPE::PS_GET_TOPICS + } +} + +impl ::protobuf::reflect::ProtobufValue for PSREQTYPE { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x0cpubsub.proto\x12\x02pb\"l\n\rPubSubRequest\x12/\n\x0brequestType\ + \x18\x01\x20\x01(\x0e2\r.pb.PSREQTYPER\x0brequestType\x12\x16\n\x06topic\ + s\x18\x02\x20\x03(\tR\x06topics\x12\x12\n\x04data\x18\x03\x20\x01(\x0cR\ + \x04data\"\xac\x01\n\x0ePubSubResponse\x12/\n\x0brequestType\x18\x01\x20\ + \x01(\x0e2\r.pb.PSREQTYPER\x0brequestType\x12+\n\x07message\x18\x02\x20\ + \x03(\x0b2\x11.pb.PubSubMessageR\x07message\x12\x16\n\x06topics\x18\x03\ + \x20\x03(\tR\x06topics\x12$\n\x05peers\x18\x04\x20\x03(\x0b2\x0e.pb.PubS\ + ubPeerR\x05peers\"\x99\x01\n\rPubSubMessage\x12\x12\n\x04from\x18\x01\ + \x20\x01(\x0cR\x04from\x12\x12\n\x04data\x18\x02\x20\x01(\x0cR\x04data\ + \x12\x14\n\x05seqno\x18\x03\x20\x01(\x0cR\x05seqno\x12\x1a\n\x08topicIDs\ + \x18\x04\x20\x03(\tR\x08topicIDs\x12\x1c\n\tsignature\x18\x05\x20\x01(\ + \x0cR\tsignature\x12\x10\n\x03key\x18\x06\x20\x01(\x0cR\x03key\":\n\nPub\ + SubPeer\x12\x14\n\x05topic\x18\x01\x20\x01(\tR\x05topic\x12\x16\n\x06pee\ + rID\x18\x02\x20\x01(\tR\x06peerID*S\n\tPSREQTYPE\x12\x11\n\rPS_GET_TOPIC\ + S\x10\0\x12\x11\n\rPS_LIST_PEERS\x10\x01\x12\x10\n\x0cPS_SUBSCRIBE\x10\ + \x02\x12\x0e\n\nPS_PUBLISH\x10\x032B\n\tPubSubAPI\x125\n\x06PubSub\x12\ + \x11.pb.PubSubRequest\x1a\x12.pb.PubSubResponse\"\0(\x010\x01J\xc7\x15\n\ + \x06\x12\x04\0\0E\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\ + \x12\x03\x01\x08\n\nt\n\x02\x06\0\x12\x04\x05\0\t\x01\x1ah\x20PubSubAPI\ + \x20provides\x20a\x20libp2p\x20pubsub\x20API\x20and\x20is\x20equivalent\ + \x20to\x20go-ipfs\n\x20`ipfs\x20pubsub`\x20subset\x20of\x20commands.\n\n\ + \n\n\x03\x06\0\x01\x12\x03\x05\x08\x11\nt\n\x04\x06\0\x02\0\x12\x03\x08\ + \x04H\x1ag\x20PubSub\x20allows\x20controlling\x20libp2p\x20pubsub\x20top\ + ics\x20and\x20subscriptions\x20using\n\x20a\x20bidirectional\x20streamin\ + g\x20API\n\n\x0c\n\x05\x06\0\x02\0\x01\x12\x03\x08\x08\x0e\n\x0c\n\x05\ + \x06\0\x02\0\x05\x12\x03\x08\x0f\x15\n\x0c\n\x05\x06\0\x02\0\x02\x12\x03\ + \x08\x16#\n\x0c\n\x05\x06\0\x02\0\x06\x12\x03\x08.4\n\x0c\n\x05\x06\0\ + \x02\0\x03\x12\x03\x085C\nR\n\x02\x05\0\x12\x04\x0c\0\x15\x01\x1aF\x20PS\ + REQTYPE\x20indicates\x20the\x20particular\x20PubSubAPI\x20request\x20bei\ + ng\x20performed\n\n\n\n\x03\x05\0\x01\x12\x03\x0c\x05\x0e\nQ\n\x04\x05\0\ + \x02\0\x12\x03\x0e\x04\x16\x1aD\x20PS_GET_TOPICS\x20is\x20used\x20to\x20\ + return\x20a\x20list\x20of\x20subscribed\x20pubsub\x20topics\n\n\x0c\n\ + \x05\x05\0\x02\0\x01\x12\x03\x0e\x04\x11\n\x0c\n\x05\x05\0\x02\0\x02\x12\ + \x03\x0e\x14\x15\nh\n\x04\x05\0\x02\x01\x12\x03\x10\x04\x16\x1a[\x20PS_L\ + IST_PEERS\x20is\x20used\x20to\x20return\x20a\x20list\x20of\x20peers\x20s\ + ubscribed\x20to\x20topics\x20we\x20are\x20subscribed\x20to\n\n\x0c\n\x05\ + \x05\0\x02\x01\x01\x12\x03\x10\x04\x11\n\x0c\n\x05\x05\0\x02\x01\x02\x12\ + \x03\x10\x14\x15\n\\\n\x04\x05\0\x02\x02\x12\x03\x12\x04\x15\x1aO\x20PS_\ + SUBSCRIBE\x20is\x20used\x20to\x20establish\x20a\x20persistent\x20subscri\ + ption\x20to\x20a\x20pubsub\x20topic\n\n\x0c\n\x05\x05\0\x02\x02\x01\x12\ + \x03\x12\x04\x10\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x12\x13\x14\nI\n\ + \x04\x05\0\x02\x03\x12\x03\x14\x04\x13\x1a<\x20PS_PUBLISH\x20is\x20used\ + \x20to\x20publisbh\x20a\x20message\x20to\x20a\x20pubsub\x20topic\n\n\x0c\ + \n\x05\x05\0\x02\x03\x01\x12\x03\x14\x04\x0e\n\x0c\n\x05\x05\0\x02\x03\ + \x02\x12\x03\x14\x11\x12\n\n\n\x02\x04\0\x12\x04\x17\0\x20\x01\n\n\n\x03\ + \x04\0\x01\x12\x03\x17\x08\x15\nI\n\x04\x04\0\x02\0\x12\x03\x19\x04\x1e\ + \x1a<\x20indicates\x20the\x20particular\x20PubSubAPI\x20request\x20being\ + \x20performed\n\n\r\n\x05\x04\0\x02\0\x04\x12\x04\x19\x04\x17\x17\n\x0c\ + \n\x05\x04\0\x02\0\x06\x12\x03\x19\x04\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\ + \x03\x19\x0e\x19\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x19\x1c\x1d\nq\n\ + \x04\x04\0\x02\x01\x12\x03\x1c\x04\x1f\x1ad\x20topics\x20to\x20request\ + \x20peers\x20from,\x20or\x20publish\x20data\x20to\n\x20sent\x20by:\x20PS\ + _LIST_PEERS,\x20PS_SUBSCRIBE,\x20PS_PUBLISH\n\n\x0c\n\x05\x04\0\x02\x01\ + \x04\x12\x03\x1c\x04\x0c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x1c\r\x13\ + \n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x1c\x14\x1a\n\x0c\n\x05\x04\0\x02\ + \x01\x03\x12\x03\x1c\x1d\x1e\n:\n\x04\x04\0\x02\x02\x12\x03\x1f\x04\x13\ + \x1a-\x20data\x20to\x20sent\x20to\x20topics\n\x20sent\x20by:\x20PS_PUBLI\ + SH\n\n\r\n\x05\x04\0\x02\x02\x04\x12\x04\x1f\x04\x1c\x1f\n\x0c\n\x05\x04\ + \0\x02\x02\x05\x12\x03\x1f\x04\t\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\ + \x1f\n\x0e\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x1f\x11\x12\n\n\n\x02\ + \x04\x01\x12\x04\"\0.\x01\n\n\n\x03\x04\x01\x01\x12\x03\"\x08\x16\nI\n\ + \x04\x04\x01\x02\0\x12\x03$\x04\x1e\x1a<\x20indicates\x20the\x20particul\ + ar\x20PubSubAPI\x20request\x20being\x20performed\n\n\r\n\x05\x04\x01\x02\ + \0\x04\x12\x04$\x04\"\x18\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03$\x04\r\n\ + \x0c\n\x05\x04\x01\x02\0\x01\x12\x03$\x0e\x19\n\x0c\n\x05\x04\x01\x02\0\ + \x03\x12\x03$\x1c\x1d\nL\n\x04\x04\x01\x02\x01\x12\x03'\x04'\x1a?\x20mes\ + sages\x20we\x20have\x20received\x20from\x20a\x20topic\n\x20sent\x20by:\ + \x20PS_SUBSCRIBE\n\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\x03'\x04\x0c\n\ + \x0c\n\x05\x04\x01\x02\x01\x06\x12\x03'\r\x1a\n\x0c\n\x05\x04\x01\x02\ + \x01\x01\x12\x03'\x1b\"\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03'%&\n2\n\ + \x04\x04\x01\x02\x02\x12\x03*\x04\x1f\x1a%\x20topic\x20names\n\x20sent\ + \x20by:\x20PS_GET_TOPICS\n\n\x0c\n\x05\x04\x01\x02\x02\x04\x12\x03*\x04\ + \x0c\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03*\r\x13\n\x0c\n\x05\x04\x01\ + \x02\x02\x01\x12\x03*\x14\x1a\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03*\ + \x1d\x1e\n3\n\x04\x04\x01\x02\x03\x12\x03-\x04\"\x1a&\x20pubsub\x20peers\ + \n\x20sent\x20by:\x20PS_LIST_PEERS\n\n\x0c\n\x05\x04\x01\x02\x03\x04\x12\ + \x03-\x04\x0c\n\x0c\n\x05\x04\x01\x02\x03\x06\x12\x03-\r\x17\n\x0c\n\x05\ + \x04\x01\x02\x03\x01\x12\x03-\x18\x1d\n\x0c\n\x05\x04\x01\x02\x03\x03\ + \x12\x03-\x20!\n\n\n\x02\x04\x02\x12\x040\0=\x01\n\n\n\x03\x04\x02\x01\ + \x12\x030\x08\x15\n'\n\x04\x04\x02\x02\0\x12\x032\x04\x13\x1a\x1a\x20who\ + \x20this\x20message\x20is\x20from\n\n\r\n\x05\x04\x02\x02\0\x04\x12\x042\ + \x040\x17\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x032\x04\t\n\x0c\n\x05\x04\ + \x02\x02\0\x01\x12\x032\n\x0e\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x032\x11\ + \x12\n'\n\x04\x04\x02\x02\x01\x12\x034\x04\x13\x1a\x1a\x20the\x20data\ + \x20of\x20this\x20message\n\n\r\n\x05\x04\x02\x02\x01\x04\x12\x044\x042\ + \x13\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x034\x04\t\n\x0c\n\x05\x04\x02\ + \x02\x01\x01\x12\x034\n\x0e\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x034\x11\ + \x12\n2\n\x04\x04\x02\x02\x02\x12\x036\x04\x14\x1a%\x20the\x20sequence\ + \x20number\x20of\x20this\x20message\n\n\r\n\x05\x04\x02\x02\x02\x04\x12\ + \x046\x044\x13\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x036\x04\t\n\x0c\n\ + \x05\x04\x02\x02\x02\x01\x12\x036\n\x0f\n\x0c\n\x05\x04\x02\x02\x02\x03\ + \x12\x036\x12\x13\n4\n\x04\x04\x02\x02\x03\x12\x038\x04!\x1a'\x20the\x20\ + topic\x20IDs\x20this\x20message\x20is\x20sent\x20to\n\n\x0c\n\x05\x04\ + \x02\x02\x03\x04\x12\x038\x04\x0c\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\ + \x038\r\x13\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x038\x14\x1c\n\x0c\n\x05\ + \x04\x02\x02\x03\x03\x12\x038\x1f\x20\n*\n\x04\x04\x02\x02\x04\x12\x03:\ + \x04\x18\x1a\x1d\x20the\x20signature\x20of\x20the\x20sender\n\n\r\n\x05\ + \x04\x02\x02\x04\x04\x12\x04:\x048!\n\x0c\n\x05\x04\x02\x02\x04\x05\x12\ + \x03:\x04\t\n\x0c\n\x05\x04\x02\x02\x04\x01\x12\x03:\n\x13\n\x0c\n\x05\ + \x04\x02\x02\x04\x03\x12\x03:\x16\x17\n$\n\x04\x04\x02\x02\x05\x12\x03<\ + \x04\x12\x1a\x17\x20the\x20key\x20of\x20the\x20sender\n\n\r\n\x05\x04\ + \x02\x02\x05\x04\x12\x04<\x04:\x18\n\x0c\n\x05\x04\x02\x02\x05\x05\x12\ + \x03<\x04\t\n\x0c\n\x05\x04\x02\x02\x05\x01\x12\x03<\n\r\n\x0c\n\x05\x04\ + \x02\x02\x05\x03\x12\x03<\x10\x11\n2\n\x02\x04\x03\x12\x04@\0E\x01\x1a&\ + \x20represents\x20an\x20individual\x20pubsub\x20peer\n\n\n\n\x03\x04\x03\ + \x01\x12\x03@\x08\x12\n-\n\x04\x04\x03\x02\0\x12\x03B\x04\x15\x1a\x20\ + \x20the\x20topic\x20this\x20peer\x20belongs\x20to\n\n\r\n\x05\x04\x03\ + \x02\0\x04\x12\x04B\x04@\x14\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03B\x04\ + \n\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03B\x0b\x10\n\x0c\n\x05\x04\x03\ + \x02\0\x03\x12\x03B\x13\x14\n\"\n\x04\x04\x03\x02\x01\x12\x03D\x04\x16\ + \x1a\x15\x20the\x20id\x20of\x20this\x20peer\n\n\r\n\x05\x04\x03\x02\x01\ + \x04\x12\x04D\x04B\x15\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03D\x04\n\n\ + \x0c\n\x05\x04\x03\x02\x01\x01\x12\x03D\x0b\x11\n\x0c\n\x05\x04\x03\x02\ + \x01\x03\x12\x03D\x14\x15b\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/pubsub_grpc.rs b/rs/src/pubsub_grpc.rs new file mode 100644 index 0000000..5cbf714 --- /dev/null +++ b/rs/src/pubsub_grpc.rs @@ -0,0 +1,63 @@ +// 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_PUB_SUB_API_PUB_SUB: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Duplex, + name: "/pb.PubSubAPI/PubSub", + 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 PubSubApiClient { + client: ::grpcio::Client, +} + +impl PubSubApiClient { + pub fn new(channel: ::grpcio::Channel) -> Self { + PubSubApiClient { + client: ::grpcio::Client::new(channel), + } + } + + pub fn pub_sub_opt(&self, opt: ::grpcio::CallOption) -> ::grpcio::Result<(::grpcio::ClientDuplexSender, ::grpcio::ClientDuplexReceiver)> { + self.client.duplex_streaming(&METHOD_PUB_SUB_API_PUB_SUB, opt) + } + + pub fn pub_sub(&self) -> ::grpcio::Result<(::grpcio::ClientDuplexSender, ::grpcio::ClientDuplexReceiver)> { + self.pub_sub_opt(::grpcio::CallOption::default()) + } + pub fn spawn(&self, f: F) where F: ::futures::Future + Send + 'static { + self.client.spawn(f) + } +} + +pub trait PubSubApi { + fn pub_sub(&mut self, ctx: ::grpcio::RpcContext, stream: ::grpcio::RequestStream, sink: ::grpcio::DuplexSink); +} + +pub fn create_pub_sub_api(s: S) -> ::grpcio::Service { + let mut builder = ::grpcio::ServiceBuilder::new(); + let mut instance = s; + builder = builder.add_duplex_streaming_handler(&METHOD_PUB_SUB_API_PUB_SUB, move |ctx, req, resp| { + instance.pub_sub(ctx, req, resp) + }); + builder.build() +} diff --git a/rs/src/replication.rs b/rs/src/replication.rs new file mode 100644 index 0000000..d1bc177 --- /dev/null +++ b/rs/src/replication.rs @@ -0,0 +1,2020 @@ +// 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 `replication.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 Replication { + // message fields + pub header: ::std::string::String, + pub cids_bytes: ::protobuf::RepeatedField<::std::vec::Vec>, + pub servers: ::protobuf::RepeatedField, + pub replication_factor: i32, + pub refresh_interval_seconds: i32, + pub server_down_delay_seconds: i32, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Replication { + fn default() -> &'a Replication { + ::default_instance() + } +} + +impl Replication { + pub fn new() -> Replication { + ::std::default::Default::default() + } + + // string header = 1; + + + pub fn get_header(&self) -> &str { + &self.header + } + pub fn clear_header(&mut self) { + self.header.clear(); + } + + // Param is passed by value, moved + pub fn set_header(&mut self, v: ::std::string::String) { + self.header = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_header(&mut self) -> &mut ::std::string::String { + &mut self.header + } + + // Take field + pub fn take_header(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.header, ::std::string::String::new()) + } + + // repeated bytes cids_bytes = 2; + + + pub fn get_cids_bytes(&self) -> &[::std::vec::Vec] { + &self.cids_bytes + } + pub fn clear_cids_bytes(&mut self) { + self.cids_bytes.clear(); + } + + // Param is passed by value, moved + pub fn set_cids_bytes(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { + self.cids_bytes = v; + } + + // Mutable pointer to the field. + pub fn mut_cids_bytes(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { + &mut self.cids_bytes + } + + // Take field + pub fn take_cids_bytes(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { + ::std::mem::replace(&mut self.cids_bytes, ::protobuf::RepeatedField::new()) + } + + // repeated .pb.ServerSource servers = 3; + + + pub fn get_servers(&self) -> &[ServerSource] { + &self.servers + } + pub fn clear_servers(&mut self) { + self.servers.clear(); + } + + // Param is passed by value, moved + pub fn set_servers(&mut self, v: ::protobuf::RepeatedField) { + self.servers = v; + } + + // Mutable pointer to the field. + pub fn mut_servers(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.servers + } + + // Take field + pub fn take_servers(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.servers, ::protobuf::RepeatedField::new()) + } + + // int32 replication_factor = 4; + + + pub fn get_replication_factor(&self) -> i32 { + self.replication_factor + } + pub fn clear_replication_factor(&mut self) { + self.replication_factor = 0; + } + + // Param is passed by value, moved + pub fn set_replication_factor(&mut self, v: i32) { + self.replication_factor = v; + } + + // int32 refresh_interval_seconds = 5; + + + pub fn get_refresh_interval_seconds(&self) -> i32 { + self.refresh_interval_seconds + } + pub fn clear_refresh_interval_seconds(&mut self) { + self.refresh_interval_seconds = 0; + } + + // Param is passed by value, moved + pub fn set_refresh_interval_seconds(&mut self, v: i32) { + self.refresh_interval_seconds = v; + } + + // int32 server_down_delay_seconds = 6; + + + pub fn get_server_down_delay_seconds(&self) -> i32 { + self.server_down_delay_seconds + } + pub fn clear_server_down_delay_seconds(&mut self) { + self.server_down_delay_seconds = 0; + } + + // Param is passed by value, moved + pub fn set_server_down_delay_seconds(&mut self, v: i32) { + self.server_down_delay_seconds = v; + } +} + +impl ::protobuf::Message for Replication { + fn is_initialized(&self) -> bool { + for v in &self.servers { + 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_proto3_string_into(wire_type, is, &mut self.header)?; + }, + 2 => { + ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.cids_bytes)?; + }, + 3 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.servers)?; + }, + 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.replication_factor = tmp; + }, + 5 => { + 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.refresh_interval_seconds = tmp; + }, + 6 => { + 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.server_down_delay_seconds = 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.header.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.header); + } + for value in &self.cids_bytes { + my_size += ::protobuf::rt::bytes_size(2, &value); + }; + for value in &self.servers { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if self.replication_factor != 0 { + my_size += ::protobuf::rt::value_size(4, self.replication_factor, ::protobuf::wire_format::WireTypeVarint); + } + if self.refresh_interval_seconds != 0 { + my_size += ::protobuf::rt::value_size(5, self.refresh_interval_seconds, ::protobuf::wire_format::WireTypeVarint); + } + if self.server_down_delay_seconds != 0 { + my_size += ::protobuf::rt::value_size(6, self.server_down_delay_seconds, ::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.header.is_empty() { + os.write_string(1, &self.header)?; + } + for v in &self.cids_bytes { + os.write_bytes(2, &v)?; + }; + for v in &self.servers { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if self.replication_factor != 0 { + os.write_int32(4, self.replication_factor)?; + } + if self.refresh_interval_seconds != 0 { + os.write_int32(5, self.refresh_interval_seconds)?; + } + if self.server_down_delay_seconds != 0 { + os.write_int32(6, self.server_down_delay_seconds)?; + } + 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() -> Replication { + Replication::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>( + "header", + |m: &Replication| { &m.header }, + |m: &mut Replication| { &mut m.header }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "cids_bytes", + |m: &Replication| { &m.cids_bytes }, + |m: &mut Replication| { &mut m.cids_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "servers", + |m: &Replication| { &m.servers }, + |m: &mut Replication| { &mut m.servers }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "replication_factor", + |m: &Replication| { &m.replication_factor }, + |m: &mut Replication| { &mut m.replication_factor }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "refresh_interval_seconds", + |m: &Replication| { &m.refresh_interval_seconds }, + |m: &mut Replication| { &mut m.refresh_interval_seconds }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "server_down_delay_seconds", + |m: &Replication| { &m.server_down_delay_seconds }, + |m: &mut Replication| { &mut m.server_down_delay_seconds }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Replication", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Replication { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Replication, + }; + unsafe { + instance.get(Replication::new) + } + } +} + +impl ::protobuf::Clear for Replication { + fn clear(&mut self) { + self.header.clear(); + self.cids_bytes.clear(); + self.servers.clear(); + self.replication_factor = 0; + self.refresh_interval_seconds = 0; + self.server_down_delay_seconds = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Replication { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Replication { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ServerSource { + // message fields + pub addr_info: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ServerSource { + fn default() -> &'a ServerSource { + ::default_instance() + } +} + +impl ServerSource { + pub fn new() -> ServerSource { + ::std::default::Default::default() + } + + // .pb.AddrInfo addr_info = 1; + + + pub fn get_addr_info(&self) -> &AddrInfo { + self.addr_info.as_ref().unwrap_or_else(|| AddrInfo::default_instance()) + } + pub fn clear_addr_info(&mut self) { + self.addr_info.clear(); + } + + pub fn has_addr_info(&self) -> bool { + self.addr_info.is_some() + } + + // Param is passed by value, moved + pub fn set_addr_info(&mut self, v: AddrInfo) { + self.addr_info = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_addr_info(&mut self) -> &mut AddrInfo { + if self.addr_info.is_none() { + self.addr_info.set_default(); + } + self.addr_info.as_mut().unwrap() + } + + // Take field + pub fn take_addr_info(&mut self) -> AddrInfo { + self.addr_info.take().unwrap_or_else(|| AddrInfo::new()) + } +} + +impl ::protobuf::Message for ServerSource { + fn is_initialized(&self) -> bool { + for v in &self.addr_info { + 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.addr_info)?; + }, + _ => { + ::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.addr_info.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.addr_info.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() -> ServerSource { + ServerSource::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>( + "addr_info", + |m: &ServerSource| { &m.addr_info }, + |m: &mut ServerSource| { &mut m.addr_info }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ServerSource", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ServerSource { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ServerSource, + }; + unsafe { + instance.get(ServerSource::new) + } + } +} + +impl ::protobuf::Clear for ServerSource { + fn clear(&mut self) { + self.addr_info.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ServerSource { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ServerSource { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct AddrInfo { + // message fields + pub id_bytes: ::std::vec::Vec, + pub addrs_bytes: ::protobuf::RepeatedField<::std::vec::Vec>, + pub grpc_port: i32, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a AddrInfo { + fn default() -> &'a AddrInfo { + ::default_instance() + } +} + +impl AddrInfo { + pub fn new() -> AddrInfo { + ::std::default::Default::default() + } + + // bytes id_bytes = 1; + + + pub fn get_id_bytes(&self) -> &[u8] { + &self.id_bytes + } + pub fn clear_id_bytes(&mut self) { + self.id_bytes.clear(); + } + + // Param is passed by value, moved + pub fn set_id_bytes(&mut self, v: ::std::vec::Vec) { + self.id_bytes = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_id_bytes(&mut self) -> &mut ::std::vec::Vec { + &mut self.id_bytes + } + + // Take field + pub fn take_id_bytes(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.id_bytes, ::std::vec::Vec::new()) + } + + // repeated bytes addrs_bytes = 2; + + + pub fn get_addrs_bytes(&self) -> &[::std::vec::Vec] { + &self.addrs_bytes + } + pub fn clear_addrs_bytes(&mut self) { + self.addrs_bytes.clear(); + } + + // Param is passed by value, moved + pub fn set_addrs_bytes(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { + self.addrs_bytes = v; + } + + // Mutable pointer to the field. + pub fn mut_addrs_bytes(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { + &mut self.addrs_bytes + } + + // Take field + pub fn take_addrs_bytes(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { + ::std::mem::replace(&mut self.addrs_bytes, ::protobuf::RepeatedField::new()) + } + + // int32 grpc_port = 3; + + + pub fn get_grpc_port(&self) -> i32 { + self.grpc_port + } + pub fn clear_grpc_port(&mut self) { + self.grpc_port = 0; + } + + // Param is passed by value, moved + pub fn set_grpc_port(&mut self, v: i32) { + self.grpc_port = v; + } +} + +impl ::protobuf::Message for AddrInfo { + 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.id_bytes)?; + }, + 2 => { + ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.addrs_bytes)?; + }, + 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.grpc_port = 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.id_bytes.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.id_bytes); + } + for value in &self.addrs_bytes { + my_size += ::protobuf::rt::bytes_size(2, &value); + }; + if self.grpc_port != 0 { + my_size += ::protobuf::rt::value_size(3, self.grpc_port, ::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.id_bytes.is_empty() { + os.write_bytes(1, &self.id_bytes)?; + } + for v in &self.addrs_bytes { + os.write_bytes(2, &v)?; + }; + if self.grpc_port != 0 { + os.write_int32(3, self.grpc_port)?; + } + 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() -> AddrInfo { + AddrInfo::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>( + "id_bytes", + |m: &AddrInfo| { &m.id_bytes }, + |m: &mut AddrInfo| { &mut m.id_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "addrs_bytes", + |m: &AddrInfo| { &m.addrs_bytes }, + |m: &mut AddrInfo| { &mut m.addrs_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "grpc_port", + |m: &AddrInfo| { &m.grpc_port }, + |m: &mut AddrInfo| { &mut m.grpc_port }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "AddrInfo", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static AddrInfo { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const AddrInfo, + }; + unsafe { + instance.get(AddrInfo::new) + } + } +} + +impl ::protobuf::Clear for AddrInfo { + fn clear(&mut self) { + self.id_bytes.clear(); + self.addrs_bytes.clear(); + self.grpc_port = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for AddrInfo { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for AddrInfo { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Subscription { + // message fields + pub topic: ::std::string::String, + pub author_id_bytes: ::std::vec::Vec, + pub remove: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Subscription { + fn default() -> &'a Subscription { + ::default_instance() + } +} + +impl Subscription { + pub fn new() -> Subscription { + ::std::default::Default::default() + } + + // string topic = 1; + + + pub fn get_topic(&self) -> &str { + &self.topic + } + pub fn clear_topic(&mut self) { + self.topic.clear(); + } + + // Param is passed by value, moved + pub fn set_topic(&mut self, v: ::std::string::String) { + self.topic = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_topic(&mut self) -> &mut ::std::string::String { + &mut self.topic + } + + // Take field + pub fn take_topic(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.topic, ::std::string::String::new()) + } + + // bytes author_id_bytes = 2; + + + pub fn get_author_id_bytes(&self) -> &[u8] { + &self.author_id_bytes + } + pub fn clear_author_id_bytes(&mut self) { + self.author_id_bytes.clear(); + } + + // Param is passed by value, moved + pub fn set_author_id_bytes(&mut self, v: ::std::vec::Vec) { + self.author_id_bytes = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_author_id_bytes(&mut self) -> &mut ::std::vec::Vec { + &mut self.author_id_bytes + } + + // Take field + pub fn take_author_id_bytes(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.author_id_bytes, ::std::vec::Vec::new()) + } + + // bool remove = 3; + + + pub fn get_remove(&self) -> bool { + self.remove + } + pub fn clear_remove(&mut self) { + self.remove = false; + } + + // Param is passed by value, moved + pub fn set_remove(&mut self, v: bool) { + self.remove = v; + } +} + +impl ::protobuf::Message for Subscription { + 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.topic)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.author_id_bytes)?; + }, + 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.remove = 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.topic.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.topic); + } + if !self.author_id_bytes.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.author_id_bytes); + } + if self.remove != 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.topic.is_empty() { + os.write_string(1, &self.topic)?; + } + if !self.author_id_bytes.is_empty() { + os.write_bytes(2, &self.author_id_bytes)?; + } + if self.remove != false { + os.write_bool(3, self.remove)?; + } + 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() -> Subscription { + Subscription::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>( + "topic", + |m: &Subscription| { &m.topic }, + |m: &mut Subscription| { &mut m.topic }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "author_id_bytes", + |m: &Subscription| { &m.author_id_bytes }, + |m: &mut Subscription| { &mut m.author_id_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "remove", + |m: &Subscription| { &m.remove }, + |m: &mut Subscription| { &mut m.remove }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Subscription", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Subscription { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Subscription, + }; + unsafe { + instance.get(Subscription::new) + } + } +} + +impl ::protobuf::Clear for Subscription { + fn clear(&mut self) { + self.topic.clear(); + self.author_id_bytes.clear(); + self.remove = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Subscription { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Subscription { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ReplicationStatus { + // message fields + pub ok: bool, + pub is_active: bool, + pub current_version: i64, + pub target_version: i64, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ReplicationStatus { + fn default() -> &'a ReplicationStatus { + ::default_instance() + } +} + +impl ReplicationStatus { + pub fn new() -> ReplicationStatus { + ::std::default::Default::default() + } + + // bool ok = 1; + + + pub fn get_ok(&self) -> bool { + self.ok + } + pub fn clear_ok(&mut self) { + self.ok = false; + } + + // Param is passed by value, moved + pub fn set_ok(&mut self, v: bool) { + self.ok = v; + } + + // bool is_active = 2; + + + pub fn get_is_active(&self) -> bool { + self.is_active + } + pub fn clear_is_active(&mut self) { + self.is_active = false; + } + + // Param is passed by value, moved + pub fn set_is_active(&mut self, v: bool) { + self.is_active = v; + } + + // int64 current_version = 3; + + + pub fn get_current_version(&self) -> i64 { + self.current_version + } + pub fn clear_current_version(&mut self) { + self.current_version = 0; + } + + // Param is passed by value, moved + pub fn set_current_version(&mut self, v: i64) { + self.current_version = v; + } + + // int64 target_version = 4; + + + pub fn get_target_version(&self) -> i64 { + self.target_version + } + pub fn clear_target_version(&mut self) { + self.target_version = 0; + } + + // Param is passed by value, moved + pub fn set_target_version(&mut self, v: i64) { + self.target_version = v; + } +} + +impl ::protobuf::Message for ReplicationStatus { + 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.ok = tmp; + }, + 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.is_active = 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_int64()?; + self.current_version = 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_int64()?; + self.target_version = 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.ok != false { + my_size += 2; + } + if self.is_active != false { + my_size += 2; + } + if self.current_version != 0 { + my_size += ::protobuf::rt::value_size(3, self.current_version, ::protobuf::wire_format::WireTypeVarint); + } + if self.target_version != 0 { + my_size += ::protobuf::rt::value_size(4, self.target_version, ::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.ok != false { + os.write_bool(1, self.ok)?; + } + if self.is_active != false { + os.write_bool(2, self.is_active)?; + } + if self.current_version != 0 { + os.write_int64(3, self.current_version)?; + } + if self.target_version != 0 { + os.write_int64(4, self.target_version)?; + } + 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() -> ReplicationStatus { + ReplicationStatus::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>( + "ok", + |m: &ReplicationStatus| { &m.ok }, + |m: &mut ReplicationStatus| { &mut m.ok }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "is_active", + |m: &ReplicationStatus| { &m.is_active }, + |m: &mut ReplicationStatus| { &mut m.is_active }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "current_version", + |m: &ReplicationStatus| { &m.current_version }, + |m: &mut ReplicationStatus| { &mut m.current_version }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "target_version", + |m: &ReplicationStatus| { &m.target_version }, + |m: &mut ReplicationStatus| { &mut m.target_version }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "ReplicationStatus", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static ReplicationStatus { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ReplicationStatus, + }; + unsafe { + instance.get(ReplicationStatus::new) + } + } +} + +impl ::protobuf::Clear for ReplicationStatus { + fn clear(&mut self) { + self.ok = false; + self.is_active = false; + self.current_version = 0; + self.target_version = 0; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ReplicationStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ReplicationStatus { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SubscriptionUpdate { + // message fields + pub version: i64, + pub replication_bytes: ::std::vec::Vec, + pub signature: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a SubscriptionUpdate { + fn default() -> &'a SubscriptionUpdate { + ::default_instance() + } +} + +impl SubscriptionUpdate { + pub fn new() -> SubscriptionUpdate { + ::std::default::Default::default() + } + + // int64 version = 1; + + + pub fn get_version(&self) -> i64 { + self.version + } + pub fn clear_version(&mut self) { + self.version = 0; + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: i64) { + self.version = v; + } + + // bytes replication_bytes = 2; + + + pub fn get_replication_bytes(&self) -> &[u8] { + &self.replication_bytes + } + pub fn clear_replication_bytes(&mut self) { + self.replication_bytes.clear(); + } + + // Param is passed by value, moved + pub fn set_replication_bytes(&mut self, v: ::std::vec::Vec) { + self.replication_bytes = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_replication_bytes(&mut self) -> &mut ::std::vec::Vec { + &mut self.replication_bytes + } + + // Take field + pub fn take_replication_bytes(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.replication_bytes, ::std::vec::Vec::new()) + } + + // bytes signature = 3; + + + pub fn get_signature(&self) -> &[u8] { + &self.signature + } + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + &mut self.signature + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.signature, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for SubscriptionUpdate { + 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_int64()?; + self.version = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.replication_bytes)?; + }, + 3 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signature)?; + }, + _ => { + ::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.version != 0 { + my_size += ::protobuf::rt::value_size(1, self.version, ::protobuf::wire_format::WireTypeVarint); + } + if !self.replication_bytes.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.replication_bytes); + } + if !self.signature.is_empty() { + my_size += ::protobuf::rt::bytes_size(3, &self.signature); + } + 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.version != 0 { + os.write_int64(1, self.version)?; + } + if !self.replication_bytes.is_empty() { + os.write_bytes(2, &self.replication_bytes)?; + } + if !self.signature.is_empty() { + os.write_bytes(3, &self.signature)?; + } + 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() -> SubscriptionUpdate { + SubscriptionUpdate::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::ProtobufTypeInt64>( + "version", + |m: &SubscriptionUpdate| { &m.version }, + |m: &mut SubscriptionUpdate| { &mut m.version }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "replication_bytes", + |m: &SubscriptionUpdate| { &m.replication_bytes }, + |m: &mut SubscriptionUpdate| { &mut m.replication_bytes }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &SubscriptionUpdate| { &m.signature }, + |m: &mut SubscriptionUpdate| { &mut m.signature }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SubscriptionUpdate", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SubscriptionUpdate { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SubscriptionUpdate, + }; + unsafe { + instance.get(SubscriptionUpdate::new) + } + } +} + +impl ::protobuf::Clear for SubscriptionUpdate { + fn clear(&mut self) { + self.version = 0; + self.replication_bytes.clear(); + self.signature.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SubscriptionUpdate { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SubscriptionUpdate { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SignedSubscription { + // message fields + pub sub_part: ::protobuf::SingularPtrField, + pub update_part: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a SignedSubscription { + fn default() -> &'a SignedSubscription { + ::default_instance() + } +} + +impl SignedSubscription { + pub fn new() -> SignedSubscription { + ::std::default::Default::default() + } + + // .pb.Subscription sub_part = 1; + + + pub fn get_sub_part(&self) -> &Subscription { + self.sub_part.as_ref().unwrap_or_else(|| Subscription::default_instance()) + } + pub fn clear_sub_part(&mut self) { + self.sub_part.clear(); + } + + pub fn has_sub_part(&self) -> bool { + self.sub_part.is_some() + } + + // Param is passed by value, moved + pub fn set_sub_part(&mut self, v: Subscription) { + self.sub_part = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_sub_part(&mut self) -> &mut Subscription { + if self.sub_part.is_none() { + self.sub_part.set_default(); + } + self.sub_part.as_mut().unwrap() + } + + // Take field + pub fn take_sub_part(&mut self) -> Subscription { + self.sub_part.take().unwrap_or_else(|| Subscription::new()) + } + + // .pb.SubscriptionUpdate update_part = 2; + + + pub fn get_update_part(&self) -> &SubscriptionUpdate { + self.update_part.as_ref().unwrap_or_else(|| SubscriptionUpdate::default_instance()) + } + pub fn clear_update_part(&mut self) { + self.update_part.clear(); + } + + pub fn has_update_part(&self) -> bool { + self.update_part.is_some() + } + + // Param is passed by value, moved + pub fn set_update_part(&mut self, v: SubscriptionUpdate) { + self.update_part = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_update_part(&mut self) -> &mut SubscriptionUpdate { + if self.update_part.is_none() { + self.update_part.set_default(); + } + self.update_part.as_mut().unwrap() + } + + // Take field + pub fn take_update_part(&mut self) -> SubscriptionUpdate { + self.update_part.take().unwrap_or_else(|| SubscriptionUpdate::new()) + } +} + +impl ::protobuf::Message for SignedSubscription { + fn is_initialized(&self) -> bool { + for v in &self.sub_part { + if !v.is_initialized() { + return false; + } + }; + for v in &self.update_part { + 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.sub_part)?; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.update_part)?; + }, + _ => { + ::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.sub_part.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.update_part.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.sub_part.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.update_part.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() -> SignedSubscription { + SignedSubscription::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>( + "sub_part", + |m: &SignedSubscription| { &m.sub_part }, + |m: &mut SignedSubscription| { &mut m.sub_part }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "update_part", + |m: &SignedSubscription| { &m.update_part }, + |m: &mut SignedSubscription| { &mut m.update_part }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "SignedSubscription", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static SignedSubscription { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const SignedSubscription, + }; + unsafe { + instance.get(SignedSubscription::new) + } + } +} + +impl ::protobuf::Clear for SignedSubscription { + fn clear(&mut self) { + self.sub_part.clear(); + self.update_part.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SignedSubscription { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SignedSubscription { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x11replication.proto\x12\x02pb\"\x94\x02\n\x0bReplication\x12\x16\n\ + \x06header\x18\x01\x20\x01(\tR\x06header\x12\x1d\n\ncids_bytes\x18\x02\ + \x20\x03(\x0cR\tcidsBytes\x12*\n\x07servers\x18\x03\x20\x03(\x0b2\x10.pb\ + .ServerSourceR\x07servers\x12-\n\x12replication_factor\x18\x04\x20\x01(\ + \x05R\x11replicationFactor\x128\n\x18refresh_interval_seconds\x18\x05\ + \x20\x01(\x05R\x16refreshIntervalSeconds\x129\n\x19server_down_delay_sec\ + onds\x18\x06\x20\x01(\x05R\x16serverDownDelaySeconds\"9\n\x0cServerSourc\ + e\x12)\n\taddr_info\x18\x01\x20\x01(\x0b2\x0c.pb.AddrInfoR\x08addrInfo\"\ + c\n\x08AddrInfo\x12\x19\n\x08id_bytes\x18\x01\x20\x01(\x0cR\x07idBytes\ + \x12\x1f\n\x0baddrs_bytes\x18\x02\x20\x03(\x0cR\naddrsBytes\x12\x1b\n\tg\ + rpc_port\x18\x03\x20\x01(\x05R\x08grpcPort\"d\n\x0cSubscription\x12\x14\ + \n\x05topic\x18\x01\x20\x01(\tR\x05topic\x12&\n\x0fauthor_id_bytes\x18\ + \x02\x20\x01(\x0cR\rauthorIdBytes\x12\x16\n\x06remove\x18\x03\x20\x01(\ + \x08R\x06remove\"\x90\x01\n\x11ReplicationStatus\x12\x0e\n\x02ok\x18\x01\ + \x20\x01(\x08R\x02ok\x12\x1b\n\tis_active\x18\x02\x20\x01(\x08R\x08isAct\ + ive\x12'\n\x0fcurrent_version\x18\x03\x20\x01(\x03R\x0ecurrentVersion\ + \x12%\n\x0etarget_version\x18\x04\x20\x01(\x03R\rtargetVersion\"y\n\x12S\ + ubscriptionUpdate\x12\x18\n\x07version\x18\x01\x20\x01(\x03R\x07version\ + \x12+\n\x11replication_bytes\x18\x02\x20\x01(\x0cR\x10replicationBytes\ + \x12\x1c\n\tsignature\x18\x03\x20\x01(\x0cR\tsignature\"z\n\x12SignedSub\ + scription\x12+\n\x08sub_part\x18\x01\x20\x01(\x0b2\x10.pb.SubscriptionR\ + \x07subPart\x127\n\x0bupdate_part\x18\x02\x20\x01(\x0b2\x16.pb.Subscript\ + ionUpdateR\nupdatePart2\xfc\x01\n\nreplicator\x120\n\x03Add\x12\x10.pb.S\ + ubscription\x1a\x15.pb.ReplicationStatus0\x01\x123\n\x06Status\x12\x10.p\ + b.Subscription\x1a\x15.pb.ReplicationStatus0\x01\x12A\n\x15GetSubscripti\ + onUpdate\x12\x10.pb.Subscription\x1a\x16.pb.SubscriptionUpdate\x12D\n\ + \x11SubmitReplication\x12\x16.pb.SignedSubscription\x1a\x15.pb.Replicati\ + onStatus0\x01J\xe7%\n\x06\x12\x04\0\0Z\x01\n\x08\n\x01\x0c\x12\x03\0\0\ + \x12\n\x08\n\x01\x02\x12\x03\x01\x08\n\n`\n\x02\x04\0\x12\x04\x04\0\x18\ + \x01\x1aT\x20Replication\x20message\x20is\x20a\x20signable\x20data\x20st\ + ructure\x20to\x20represent\x20a\x20replication\x20scheme\n\n\n\n\x03\x04\ + \0\x01\x12\x03\x04\x08\x13\n\x9f\x02\n\x04\x04\0\x02\0\x12\x03\t\x04\x16\ + \x1a\x91\x02\x20Header\x20must\x20be\x20\"rtrade-replication\x20v0...\"\ + \x20for\x20development\x20stage,\x20this\x20is\x20a\x20required\x20secur\ + ity\x20header.\n\x20-\x20Avoid\x20collision\x20from\x20other\x20signed\ + \x20data.\n\x20-\x20Allow\x20future\x20versions\x20to\x20require\x20diff\ + erent\x20validation\x20rules.\n\x20Any\x20signer\x20must\x20understand\ + \x20every\x20header\x20tag\x20to\x20sign\x20documents.\n\n\r\n\x05\x04\0\ + \x02\0\x04\x12\x04\t\x04\x04\x14\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\t\ + \x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\t\x0b\x11\n\x0c\n\x05\x04\0\ + \x02\0\x03\x12\x03\t\x14\x15\ny\n\x04\x04\0\x02\x01\x12\x03\x0c\x04\"\ + \x1al\x20CIDs\x20is\x20the\x20list\x20of\x20contents\x20to\x20replicate.\ + \n\x20Please\x20use\x20helper\x20functions\x20GetCIDs\x20and\x20AddCIDs\ + \x20for\x20this\x20field\n\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\x0c\x04\ + \x0c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x0c\r\x12\n\x0c\n\x05\x04\0\ + \x02\x01\x01\x12\x03\x0c\x13\x1d\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\ + \x0c\x20!\n]\n\x04\x04\0\x02\x02\x12\x03\x0e\x04&\x1aP\x20Servers\x20lis\ + t\x20the\x20candidate\x20severs\x20to\x20replicate\x20to,\x20in\x20the\ + \x20order\x20of\x20preference.\n\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03\ + \x0e\x04\x0c\n\x0c\n\x05\x04\0\x02\x02\x06\x12\x03\x0e\r\x19\n\x0c\n\x05\ + \x04\0\x02\x02\x01\x12\x03\x0e\x1a!\n\x0c\n\x05\x04\0\x02\x02\x03\x12\ + \x03\x0e$%\nH\n\x04\x04\0\x02\x03\x12\x03\x10\x04!\x1a;\x20replication_f\ + actor\x20is\x20the\x20number\x20of\x20replications\x20desired.\n\n\r\n\ + \x05\x04\0\x02\x03\x04\x12\x04\x10\x04\x0e&\n\x0c\n\x05\x04\0\x02\x03\ + \x05\x12\x03\x10\x04\t\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x10\n\x1c\n\ + \x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x10\x1f\x20\n\xab\x02\n\x04\x04\0\ + \x02\x04\x12\x03\x14\x04'\x1a\x9d\x02\x20refresh_interval_seconds\x20is\ + \x20the\x20*suggested*\x20number\x20of\x20seconds\x20to\x20wait\x20befor\ + e\x20checking\x20\n\x20if\x20a\x20remote\x20server\x20is\x20up.\x20The\ + \x20first\x20check\x20should\x20be\x20random\x20from\x200\x20to\x20refre\ + sh_interval_seconds.\n\x20Each\x20replicator\x20can\x20have\x20it's\x20o\ + wn\x20max_interval.\x20A\x20sensible\x20default\x20value\x20should\x20be\ + \x20used\x20if\x20it\x20is\x200.\n\n\r\n\x05\x04\0\x02\x04\x04\x12\x04\ + \x14\x04\x10!\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\x14\x04\t\n\x0c\n\ + \x05\x04\0\x02\x04\x01\x12\x03\x14\n\"\n\x0c\n\x05\x04\0\x02\x04\x03\x12\ + \x03\x14%&\n\xd2\x01\n\x04\x04\0\x02\x05\x12\x03\x17\x04(\x1a\xc4\x01\ + \x20server_down_delay_seconds\x20is\x20the\x20number\x20of\x20seconds\ + \x20to\x20wait\x20after\x20a\x20server\x20is\x20down\x20before\x20the\ + \x20\n\x20next\x20reserved\x20server\x20is\x20requested\x20to\x20be\x20a\ + ctive.\x20A\x20sensible\x20default\x20value\x20should\x20be\x20used\x20i\ + f\x20it\x20is\x200.\n\n\r\n\x05\x04\0\x02\x05\x04\x12\x04\x17\x04\x14'\n\ + \x0c\n\x05\x04\0\x02\x05\x05\x12\x03\x17\x04\t\n\x0c\n\x05\x04\0\x02\x05\ + \x01\x12\x03\x17\n#\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\x17&'\n\x88\ + \x01\n\x02\x04\x01\x12\x04\x1c\0\x1e\x01\x1a|\x20ServerSource\x20is\x20a\ + \x20list\x20of\x20one\x20or\x20more\x20servers.\n\x20TODO:\x20add\x20fie\ + ld\x20to\x20allow\x20referring\x20to\x20a\x20list\x20of\x20servers\x20fr\ + om\x20another\x20file.\n\n\n\n\x03\x04\x01\x01\x12\x03\x1c\x08\x14\n\x0b\ + \n\x04\x04\x01\x02\0\x12\x03\x1d\x04\x1b\n\r\n\x05\x04\x01\x02\0\x04\x12\ + \x04\x1d\x04\x1c\x16\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x1d\x04\x0c\n\ + \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x1d\r\x16\n\x0c\n\x05\x04\x01\x02\0\ + \x03\x12\x03\x1d\x19\x1a\nk\n\x02\x04\x02\x12\x04!\0*\x01\x1a_\x20AddrIn\ + fo\x20can\x20be\x20used\x20to\x20ID\x20and\x20locate\x20a\x20server\x20(\ + see\x20also\x20libp2p/go-libp2p-core/peer#AddrInfo)\n\n\n\n\x03\x04\x02\ + \x01\x12\x03!\x08\x10\n\x9b\x01\n\x04\x04\x02\x02\0\x12\x03$\x04\x17\x1a\ + \x8d\x01\x20id_bytes\x20is\x20a\x20libp2p\x20peer\x20identity.\x20It\x20\ + is\x20used\x20to\x20verity\x20the\x20Peer's\x20public\x20key.\n\x20Pleas\ + e\x20use\x20helper\x20functions\x20GetID\x20and\x20SetID\x20for\x20this\ + \x20field\n\n\r\n\x05\x04\x02\x02\0\x04\x12\x04$\x04!\x12\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\x12\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03$\x15\x16\n\x96\x01\n\x04\ + \x04\x02\x02\x01\x12\x03'\x04#\x1a\x88\x01\x20addrBytes\x20are\x20bytes\ + \x20of\x20Multiaddr\x20for\x20locating\x20this\x20peer.\n\x20Please\x20u\ + se\x20helper\x20functions\x20GetMultiAddrs,\x20and\x20SetMultiAddrs\x20f\ + or\x20this\x20field.\n\n\x0c\n\x05\x04\x02\x02\x01\x04\x12\x03'\x04\x0c\ + \n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03'\r\x12\n\x0c\n\x05\x04\x02\x02\ + \x01\x01\x12\x03'\x13\x1e\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03'!\"\nm\ + \n\x04\x04\x02\x02\x02\x12\x03)\x04\x18\x1a`\x20grpc\x20port\x20for\x20r\ + eplication\x20protocol.\x20will\x20be\x20optional\x20once\x20grpc\x20is\ + \x20integrated\x20into\x20multistream.\n\n\r\n\x05\x04\x02\x02\x02\x04\ + \x12\x04)\x04'#\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03)\x04\t\n\x0c\n\ + \x05\x04\x02\x02\x02\x01\x12\x03)\n\x13\n\x0c\n\x05\x04\x02\x02\x02\x03\ + \x12\x03)\x16\x17\n;\n\x02\x06\0\x12\x04.\08\x01\x1a/\x20The\x20replicat\ + or\x20provides\x20replication\x20services.\n\n\n\n\x03\x06\0\x01\x12\x03\ + .\x08\x12\nm\n\x04\x06\0\x02\0\x12\x030\x04>\x1a`\x20Add\x20is\x20used\ + \x20to\x20add\x20a\x20replication\x20to\x20this\x20server,\x20changing\ + \x20it's\x20status\x20from\x20reserved\x20to\x20active.\n\n\x0c\n\x05\ + \x06\0\x02\0\x01\x12\x030\x08\x0b\n\x0c\n\x05\x06\0\x02\0\x02\x12\x030\r\ + \x19\n\x0c\n\x05\x06\0\x02\0\x06\x12\x030$*\n\x0c\n\x05\x06\0\x02\0\x03\ + \x12\x030+<\nY\n\x04\x06\0\x02\x01\x12\x032\x04A\x1aL\x20Status\x20retur\ + ns\x20an\x20updating\x20stream\x20of\x20the\x20replication\x20status\x20\ + on\x20the\x20server.\n\n\x0c\n\x05\x06\0\x02\x01\x01\x12\x032\x08\x0e\n\ + \x0c\n\x05\x06\0\x02\x01\x02\x12\x032\x10\x1c\n\x0c\n\x05\x06\0\x02\x01\ + \x06\x12\x032'-\n\x0c\n\x05\x06\0\x02\x01\x03\x12\x032.?\nY\n\x04\x06\0\ + \x02\x02\x12\x034\x04J\x1aL\x20GetSubscriptionUpdate\x20returns\x20the\ + \x20latest\x20version\x20of\x20subscribed\x20replication\n\n\x0c\n\x05\ + \x06\0\x02\x02\x01\x12\x034\x08\x1d\n\x0c\n\x05\x06\0\x02\x02\x02\x12\ + \x034\x1f+\n\x0c\n\x05\x06\0\x02\x02\x03\x12\x0346H\n\xb5\x01\n\x04\x06\ + \0\x02\x03\x12\x037\x04R\x1a\xa7\x01\x20SubmitReplication\x20is\x20used\ + \x20by\x20client\x20agents\x20to\x20start\x20replications,\x20after\x20t\ + hey\x20\n\x20have\x20uploaded\x20the\x20files\x20and\x20retrieved\x20the\ + \x20cid,\x20and\x20collected\x20servers\x20to\x20replicate\x20too.\n\n\ + \x0c\n\x05\x06\0\x02\x03\x01\x12\x037\x08\x19\n\x0c\n\x05\x06\0\x02\x03\ + \x02\x12\x037\x1b-\n\x0c\n\x05\x06\0\x02\x03\x06\x12\x0378>\n\x0c\n\x05\ + \x06\0\x02\x03\x03\x12\x037?P\n\n\n\x02\x04\x03\x12\x04:\0A\x01\n\n\n\ + \x03\x04\x03\x01\x12\x03:\x08\x14\n\x0b\n\x04\x04\x03\x02\0\x12\x03;\x04\ + \x15\n\r\n\x05\x04\x03\x02\0\x04\x12\x04;\x04:\x15\n\x0c\n\x05\x04\x03\ + \x02\0\x05\x12\x03;\x04\n\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03;\x0b\x10\ + \n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03;\x13\x14\n\x0b\n\x04\x04\x03\x02\ + \x01\x12\x03<\x04\x1e\n\r\n\x05\x04\x03\x02\x01\x04\x12\x04<\x04;\x15\n\ + \x0c\n\x05\x04\x03\x02\x01\x05\x12\x03<\x04\t\n\x0c\n\x05\x04\x03\x02\ + \x01\x01\x12\x03<\n\x19\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03<\x1c\x1d\ + \n\x97\x01\n\x04\x04\x03\x02\x02\x12\x03@\x04\x14\x1a\x89\x01if\x20true,\ + \x20remove\x20this\x20Subscription.\nFor\x20replicator.Add,\x20deactive\ + \x20this\x20replication.\nFor\x20replicator.WaitForUpdates,\x20stop\x20r\ + eporting\x20updates.\n\n\r\n\x05\x04\x03\x02\x02\x04\x12\x04@\x04<\x1e\n\ + \x0c\n\x05\x04\x03\x02\x02\x05\x12\x03@\x04\x08\n\x0c\n\x05\x04\x03\x02\ + \x02\x01\x12\x03@\t\x0f\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03@\x12\x13\ + \n\n\n\x02\x04\x04\x12\x04C\0L\x01\n\n\n\x03\x04\x04\x01\x12\x03C\x08\ + \x19\n4\n\x04\x04\x04\x02\0\x12\x03E\x04\x10\x1a'ok\x20report\x20success\ + \x20for\x20action\x20submitted\n\n\r\n\x05\x04\x04\x02\0\x04\x12\x04E\ + \x04C\x1a\n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03E\x04\x08\n\x0c\n\x05\x04\ + \x04\x02\0\x01\x12\x03E\t\x0b\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03E\x0e\ + \x0f\nT\n\x04\x04\x04\x02\x01\x12\x03G\x04\x17\x1aGis_active\x20report\ + \x20if\x20the\x20replication\x20is\x20currently\x20active\x20on\x20this\ + \x20server\n\n\r\n\x05\x04\x04\x02\x01\x04\x12\x04G\x04E\x10\n\x0c\n\x05\ + \x04\x04\x02\x01\x05\x12\x03G\x04\x08\n\x0c\n\x05\x04\x04\x02\x01\x01\ + \x12\x03G\t\x12\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03G\x15\x16\nX\n\ + \x04\x04\x04\x02\x02\x12\x03I\x04\x1e\x1aKcurrent_version\x20is\x20the\ + \x20highest\x20version\x20this\x20replicator/server\x20has\x20locally.\n\ + \n\r\n\x05\x04\x04\x02\x02\x04\x12\x04I\x04G\x17\n\x0c\n\x05\x04\x04\x02\ + \x02\x05\x12\x03I\x04\t\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03I\n\x19\n\ + \x0c\n\x05\x04\x04\x02\x02\x03\x12\x03I\x1c\x1d\no\n\x04\x04\x04\x02\x03\ + \x12\x03K\x04\x1d\x1abtarget_version\x20is\x20the\x20highest\x20version\ + \x20this\x20replicator/server\x20knows\x20about\x20and\x20can\x20verify\ + \x20to\x20exist.\n\n\r\n\x05\x04\x04\x02\x03\x04\x12\x04K\x04I\x1e\n\x0c\ + \n\x05\x04\x04\x02\x03\x05\x12\x03K\x04\t\n\x0c\n\x05\x04\x04\x02\x03\ + \x01\x12\x03K\n\x18\n\x0c\n\x05\x04\x04\x02\x03\x03\x12\x03K\x1b\x1c\n\n\ + \n\x02\x04\x05\x12\x04N\0U\x01\n\n\n\x03\x04\x05\x01\x12\x03N\x08\x1a\n0\ + \n\x04\x04\x05\x02\0\x12\x03P\x04\x16\x1a#strictly\x20increasing\x20vers\ + ion\x20number\n\n\r\n\x05\x04\x05\x02\0\x04\x12\x04P\x04N\x1b\n\x0c\n\ + \x05\x04\x05\x02\0\x05\x12\x03P\x04\t\n\x0c\n\x05\x04\x05\x02\0\x01\x12\ + \x03P\n\x11\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03P\x14\x15\n6\n\x04\x04\ + \x05\x02\x01\x12\x03R\x04\x20\x1a)replication\x20file\x20is\x20in\x20byt\ + es\x20for\x20signing\n\n\r\n\x05\x04\x05\x02\x01\x04\x12\x04R\x04P\x16\n\ + \x0c\n\x05\x04\x05\x02\x01\x05\x12\x03R\x04\t\n\x0c\n\x05\x04\x05\x02\ + \x01\x01\x12\x03R\n\x1b\n\x0c\n\x05\x04\x05\x02\x01\x03\x12\x03R\x1e\x1f\ + \n\x84\x01\n\x04\x04\x05\x02\x02\x12\x03T\x04\x18\x1awsignature\x20signs\ + \x20the\x20Subscription\x20and\x20above\x20data\x20in\x20length\x20delim\ + ited\x20form\x20in\x20the\x20order\x20topic|author|version|replication\n\ + \n\r\n\x05\x04\x05\x02\x02\x04\x12\x04T\x04R\x20\n\x0c\n\x05\x04\x05\x02\ + \x02\x05\x12\x03T\x04\t\n\x0c\n\x05\x04\x05\x02\x02\x01\x12\x03T\n\x13\n\ + \x0c\n\x05\x04\x05\x02\x02\x03\x12\x03T\x16\x17\n\n\n\x02\x04\x06\x12\ + \x04W\0Z\x01\n\n\n\x03\x04\x06\x01\x12\x03W\x08\x1a\n\x0b\n\x04\x04\x06\ + \x02\0\x12\x03X\x04\x1e\n\r\n\x05\x04\x06\x02\0\x04\x12\x04X\x04W\x1b\n\ + \x0c\n\x05\x04\x06\x02\0\x06\x12\x03X\x04\x10\n\x0c\n\x05\x04\x06\x02\0\ + \x01\x12\x03X\x11\x19\n\x0c\n\x05\x04\x06\x02\0\x03\x12\x03X\x1c\x1d\n\ + \x0b\n\x04\x04\x06\x02\x01\x12\x03Y\x04'\n\r\n\x05\x04\x06\x02\x01\x04\ + \x12\x04Y\x04X\x1e\n\x0c\n\x05\x04\x06\x02\x01\x06\x12\x03Y\x04\x16\n\ + \x0c\n\x05\x04\x06\x02\x01\x01\x12\x03Y\x17\"\n\x0c\n\x05\x04\x06\x02\ + \x01\x03\x12\x03Y%&b\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/replication_grpc.rs b/rs/src/replication_grpc.rs new file mode 100644 index 0000000..389f0ba --- /dev/null +++ b/rs/src/replication_grpc.rs @@ -0,0 +1,131 @@ +// 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_REPLICATOR_ADD: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::ServerStreaming, + name: "/pb.replicator/Add", + 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_REPLICATOR_STATUS: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::ServerStreaming, + name: "/pb.replicator/Status", + 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_REPLICATOR_GET_SUBSCRIPTION_UPDATE: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.replicator/GetSubscriptionUpdate", + 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_REPLICATOR_SUBMIT_REPLICATION: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::ServerStreaming, + name: "/pb.replicator/SubmitReplication", + 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 ReplicatorClient { + client: ::grpcio::Client, +} + +impl ReplicatorClient { + pub fn new(channel: ::grpcio::Channel) -> Self { + ReplicatorClient { + client: ::grpcio::Client::new(channel), + } + } + + pub fn add_opt(&self, req: &super::replication::Subscription, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> { + self.client.server_streaming(&METHOD_REPLICATOR_ADD, req, opt) + } + + pub fn add(&self, req: &super::replication::Subscription) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> { + self.add_opt(req, ::grpcio::CallOption::default()) + } + + pub fn status_opt(&self, req: &super::replication::Subscription, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> { + self.client.server_streaming(&METHOD_REPLICATOR_STATUS, req, opt) + } + + pub fn status(&self, req: &super::replication::Subscription) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> { + self.status_opt(req, ::grpcio::CallOption::default()) + } + + pub fn get_subscription_update_opt(&self, req: &super::replication::Subscription, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_REPLICATOR_GET_SUBSCRIPTION_UPDATE, req, opt) + } + + pub fn get_subscription_update(&self, req: &super::replication::Subscription) -> ::grpcio::Result { + self.get_subscription_update_opt(req, ::grpcio::CallOption::default()) + } + + pub fn get_subscription_update_async_opt(&self, req: &super::replication::Subscription, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_REPLICATOR_GET_SUBSCRIPTION_UPDATE, req, opt) + } + + pub fn get_subscription_update_async(&self, req: &super::replication::Subscription) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.get_subscription_update_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn submit_replication_opt(&self, req: &super::replication::SignedSubscription, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> { + self.client.server_streaming(&METHOD_REPLICATOR_SUBMIT_REPLICATION, req, opt) + } + + pub fn submit_replication(&self, req: &super::replication::SignedSubscription) -> ::grpcio::Result<::grpcio::ClientSStreamReceiver> { + self.submit_replication_opt(req, ::grpcio::CallOption::default()) + } + pub fn spawn(&self, f: F) where F: ::futures::Future + Send + 'static { + self.client.spawn(f) + } +} + +pub trait Replicator { + fn add(&mut self, ctx: ::grpcio::RpcContext, req: super::replication::Subscription, sink: ::grpcio::ServerStreamingSink); + fn status(&mut self, ctx: ::grpcio::RpcContext, req: super::replication::Subscription, sink: ::grpcio::ServerStreamingSink); + fn get_subscription_update(&mut self, ctx: ::grpcio::RpcContext, req: super::replication::Subscription, sink: ::grpcio::UnarySink); + fn submit_replication(&mut self, ctx: ::grpcio::RpcContext, req: super::replication::SignedSubscription, sink: ::grpcio::ServerStreamingSink); +} + +pub fn create_replicator(s: S) -> ::grpcio::Service { + let mut builder = ::grpcio::ServiceBuilder::new(); + let mut instance = s.clone(); + builder = builder.add_server_streaming_handler(&METHOD_REPLICATOR_ADD, move |ctx, req, resp| { + instance.add(ctx, req, resp) + }); + let mut instance = s.clone(); + builder = builder.add_server_streaming_handler(&METHOD_REPLICATOR_STATUS, move |ctx, req, resp| { + instance.status(ctx, req, resp) + }); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_REPLICATOR_GET_SUBSCRIPTION_UPDATE, move |ctx, req, resp| { + instance.get_subscription_update(ctx, req, resp) + }); + let mut instance = s; + builder = builder.add_server_streaming_handler(&METHOD_REPLICATOR_SUBMIT_REPLICATION, move |ctx, req, resp| { + instance.submit_replication(ctx, req, resp) + }); + builder.build() +} diff --git a/rs/src/status.rs b/rs/src/status.rs new file mode 100644 index 0000000..1907164 --- /dev/null +++ b/rs/src/status.rs @@ -0,0 +1,537 @@ +// 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 `status.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 VersionResponse { + // message fields + pub version: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a VersionResponse { + fn default() -> &'a VersionResponse { + ::default_instance() + } +} + +impl VersionResponse { + pub fn new() -> VersionResponse { + ::std::default::Default::default() + } + + // string version = 1; + + + pub fn get_version(&self) -> &str { + &self.version + } + pub fn clear_version(&mut self) { + self.version.clear(); + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: ::std::string::String) { + self.version = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_version(&mut self) -> &mut ::std::string::String { + &mut self.version + } + + // Take field + pub fn take_version(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.version, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for VersionResponse { + 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.version)?; + }, + _ => { + ::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.version.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.version); + } + 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.version.is_empty() { + os.write_string(1, &self.version)?; + } + 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() -> VersionResponse { + VersionResponse::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>( + "version", + |m: &VersionResponse| { &m.version }, + |m: &mut VersionResponse| { &mut m.version }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "VersionResponse", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static VersionResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const VersionResponse, + }; + unsafe { + instance.get(VersionResponse::new) + } + } +} + +impl ::protobuf::Clear for VersionResponse { + fn clear(&mut self) { + self.version.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for VersionResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for VersionResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct StatusResponse { + // message fields + pub host: ::std::string::String, + pub status: APISTATUS, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a StatusResponse { + fn default() -> &'a StatusResponse { + ::default_instance() + } +} + +impl StatusResponse { + pub fn new() -> StatusResponse { + ::std::default::Default::default() + } + + // string host = 1; + + + pub fn get_host(&self) -> &str { + &self.host + } + pub fn clear_host(&mut self) { + self.host.clear(); + } + + // Param is passed by value, moved + pub fn set_host(&mut self, v: ::std::string::String) { + self.host = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_host(&mut self) -> &mut ::std::string::String { + &mut self.host + } + + // Take field + pub fn take_host(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.host, ::std::string::String::new()) + } + + // .pb.APISTATUS status = 2; + + + pub fn get_status(&self) -> APISTATUS { + self.status + } + pub fn clear_status(&mut self) { + self.status = APISTATUS::ONLINE; + } + + // Param is passed by value, moved + pub fn set_status(&mut self, v: APISTATUS) { + self.status = v; + } +} + +impl ::protobuf::Message for StatusResponse { + 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.host)?; + }, + 2 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.status, 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.host.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.host); + } + if self.status != APISTATUS::ONLINE { + my_size += ::protobuf::rt::enum_size(2, 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.host.is_empty() { + os.write_string(1, &self.host)?; + } + if self.status != APISTATUS::ONLINE { + os.write_enum(2, self.status.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() -> StatusResponse { + StatusResponse::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>( + "host", + |m: &StatusResponse| { &m.host }, + |m: &mut StatusResponse| { &mut m.host }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "status", + |m: &StatusResponse| { &m.status }, + |m: &mut StatusResponse| { &mut m.status }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "StatusResponse", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static StatusResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const StatusResponse, + }; + unsafe { + instance.get(StatusResponse::new) + } + } +} + +impl ::protobuf::Clear for StatusResponse { + fn clear(&mut self) { + self.host.clear(); + self.status = APISTATUS::ONLINE; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for StatusResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for StatusResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum APISTATUS { + ONLINE = 0, + PURGING = 1, + DEGRADED_PERFORMANCE = 2, + ERROR = 3, +} + +impl ::protobuf::ProtobufEnum for APISTATUS { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(APISTATUS::ONLINE), + 1 => ::std::option::Option::Some(APISTATUS::PURGING), + 2 => ::std::option::Option::Some(APISTATUS::DEGRADED_PERFORMANCE), + 3 => ::std::option::Option::Some(APISTATUS::ERROR), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [APISTATUS] = &[ + APISTATUS::ONLINE, + APISTATUS::PURGING, + APISTATUS::DEGRADED_PERFORMANCE, + APISTATUS::ERROR, + ]; + 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("APISTATUS", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for APISTATUS { +} + +impl ::std::default::Default for APISTATUS { + fn default() -> Self { + APISTATUS::ONLINE + } +} + +impl ::protobuf::reflect::ProtobufValue for APISTATUS { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x0cstatus.proto\x12\x02pb\x1a\nutil.proto\"+\n\x0fVersionResponse\x12\ + \x18\n\x07version\x18\x01\x20\x01(\tR\x07version\"K\n\x0eStatusResponse\ + \x12\x12\n\x04host\x18\x01\x20\x01(\tR\x04host\x12%\n\x06status\x18\x02\ + \x20\x01(\x0e2\r.pb.APISTATUSR\x06status*I\n\tAPISTATUS\x12\n\n\x06ONLIN\ + E\x10\0\x12\x0b\n\x07PURGING\x10\x01\x12\x18\n\x14DEGRADED_PERFORMANCE\ + \x10\x02\x12\t\n\x05ERROR\x10\x032c\n\tStatusAPI\x12+\n\x07Version\x12\t\ + .pb.Empty\x1a\x13.pb.VersionResponse\"\0\x12)\n\x06Status\x12\t.pb.Empty\ + \x1a\x12.pb.StatusResponse\"\0J\x8a\r\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\n\t\n\x02\x03\0\ + \x12\x03\x02\x07\x13\nH\n\x02\x06\0\x12\x04\x05\0\n\x01\x1a<\x20provides\ + \x20utilities\x20to\x20retrieve\x20api\x20status\x20information\x20from\ + \n\n\n\n\x03\x06\0\x01\x12\x03\x05\x08\x11\nB\n\x04\x06\0\x02\0\x12\x03\ + \x07\x044\x1a5\x20Version\x20is\x20used\x20to\x20retrieve\x20api\x20vers\ + ion\x20information\n\n\x0c\n\x05\x06\0\x02\0\x01\x12\x03\x07\x08\x0f\n\ + \x0c\n\x05\x06\0\x02\0\x02\x12\x03\x07\x10\x15\n\x0c\n\x05\x06\0\x02\0\ + \x03\x12\x03\x07\x20/\nA\n\x04\x06\0\x02\x01\x12\x03\t\x042\x1a4\x20Stat\ + us\x20is\x20used\x20to\x20retrieve\x20api\x20status\x20information.\n\n\ + \x0c\n\x05\x06\0\x02\x01\x01\x12\x03\t\x08\x0e\n\x0c\n\x05\x06\0\x02\x01\ + \x02\x12\x03\t\x0f\x14\n\x0c\n\x05\x06\0\x02\x01\x03\x12\x03\t\x1f-\nG\n\ + \x02\x04\0\x12\x04\r\0\x10\x01\x1a;\x20VersionResponse\x20is\x20used\x20\ + to\x20return\x20API\x20version\x20information\n\n\n\n\x03\x04\0\x01\x12\ + \x03\r\x08\x17\nY\n\x04\x04\0\x02\0\x12\x03\x0f\x04\x17\x1aL\x20version\ + \x20denotes\x20the\x20github\x20version\x20that\x20was\x20present\x20whe\ + n\x20the\x20api\x20was\x20built\n\n\r\n\x05\x04\0\x02\0\x04\x12\x04\x0f\ + \x04\r\x19\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x0f\x04\n\n\x0c\n\x05\x04\ + \0\x02\0\x01\x12\x03\x0f\x0b\x12\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x0f\ + \x15\x16\nP\n\x02\x05\0\x12\x04\x13\0\x1d\x01\x1aD\x20APISTATUS\x20is\ + \x20an\x20enum\x20to\x20return\x20a\x20concise\x20description\x20of\x20a\ + pi\x20status\n\n\n\n\x03\x05\0\x01\x12\x03\x13\x05\x0e\nA\n\x04\x05\0\ + \x02\0\x12\x03\x15\x04\x0f\x1a4\x20ONLINE\x20indicates\x20everything\x20\ + is\x20working\x20as\x20expected\n\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\ + \x15\x04\n\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x15\r\x0e\n\x99\x01\n\x04\ + \x05\0\x02\x01\x12\x03\x18\x04\x10\x1a\x8b\x01\x20PURGING\x20indicates\ + \x20the\x20system\x20is\x20undergoing\x20data\x20removal\n\x20a\x20purgi\ + ng\x20system\x20is\x20not\x20available\x20for\x20use\x20unless\x20all\ + \x20other\x20nodes\x20are\x20unavailable\n\n\x0c\n\x05\x05\0\x02\x01\x01\ + \x12\x03\x18\x04\x0b\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x18\x0e\x0f\n\ + V\n\x04\x05\0\x02\x02\x12\x03\x1a\x04\x1d\x1aI\x20DEGRADED_PERFORMANCE\ + \x20indicates\x20the\x20system\x20is\x20currently\x20under\x20heavy\x20l\ + oad\n\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x1a\x04\x18\n\x0c\n\x05\x05\ + \0\x02\x02\x02\x12\x03\x1a\x1b\x1c\nh\n\x04\x05\0\x02\x03\x12\x03\x1c\ + \x04\x0e\x1a[\x20ERROR\x20indicates\x20that\x20the\x20system\x20is\x20cu\ + rrently\x20experiencing\x20an\x20error\x20and\x20should\x20not\x20be\x20\ + used\n\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x1c\x04\t\n\x0c\n\x05\x05\0\ + \x02\x03\x02\x12\x03\x1c\x0c\r\nE\n\x02\x04\x01\x12\x04\x20\0&\x01\x1a9\ + \x20StatusResponse\x20is\x20used\x20to\x20return\x20API\x20status\x20inf\ + ormation\n\n\n\n\x03\x04\x01\x01\x12\x03\x20\x08\x16\n\xc1\x01\n\x04\x04\ + \x01\x02\0\x12\x03#\x04\x14\x1a\xb3\x01\x20host\x20is\x20an\x20identifie\ + r\x20for\x20the\x20host\x20of\x20the\x20system\x20responding\x20to\x20th\ + e\x20request.\n\x20it\x20may\x20or\x20may\x20not\x20be\x20the\x20hostnam\ + e,\x20it\x20is\x20up\x20to\x20the\x20implementer\x20of\x20the\x20service\ + \x20to\x20choose\x20what\x20is\x20here\n\n\r\n\x05\x04\x01\x02\0\x04\x12\ + \x04#\x04\x20\x18\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03#\x04\n\n\x0c\n\ + \x05\x04\x01\x02\0\x01\x12\x03#\x0b\x0f\n\x0c\n\x05\x04\x01\x02\0\x03\ + \x12\x03#\x12\x13\nO\n\x04\x04\x01\x02\x01\x12\x03%\x04\x19\x1aB\x20stat\ + us\x20contains\x20a\x20status\x20enum\x20indicating\x20the\x20state\x20o\ + f\x20the\x20system\n\n\r\n\x05\x04\x01\x02\x01\x04\x12\x04%\x04#\x14\n\ + \x0c\n\x05\x04\x01\x02\x01\x06\x12\x03%\x04\r\n\x0c\n\x05\x04\x01\x02\ + \x01\x01\x12\x03%\x0e\x14\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03%\x17\ + \x18b\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/status_grpc.rs b/rs/src/status_grpc.rs new file mode 100644 index 0000000..38843b9 --- /dev/null +++ b/rs/src/status_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_STATUS_API_VERSION: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.StatusAPI/Version", + 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_STATUS_API_STATUS: ::grpcio::Method = ::grpcio::Method { + ty: ::grpcio::MethodType::Unary, + name: "/pb.StatusAPI/Status", + 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 StatusApiClient { + client: ::grpcio::Client, +} + +impl StatusApiClient { + pub fn new(channel: ::grpcio::Channel) -> Self { + StatusApiClient { + client: ::grpcio::Client::new(channel), + } + } + + pub fn version_opt(&self, req: &super::util::Empty, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_STATUS_API_VERSION, req, opt) + } + + pub fn version(&self, req: &super::util::Empty) -> ::grpcio::Result { + self.version_opt(req, ::grpcio::CallOption::default()) + } + + pub fn version_async_opt(&self, req: &super::util::Empty, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_STATUS_API_VERSION, req, opt) + } + + pub fn version_async(&self, req: &super::util::Empty) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.version_async_opt(req, ::grpcio::CallOption::default()) + } + + pub fn status_opt(&self, req: &super::util::Empty, opt: ::grpcio::CallOption) -> ::grpcio::Result { + self.client.unary_call(&METHOD_STATUS_API_STATUS, req, opt) + } + + pub fn status(&self, req: &super::util::Empty) -> ::grpcio::Result { + self.status_opt(req, ::grpcio::CallOption::default()) + } + + pub fn status_async_opt(&self, req: &super::util::Empty, opt: ::grpcio::CallOption) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.client.unary_call_async(&METHOD_STATUS_API_STATUS, req, opt) + } + + pub fn status_async(&self, req: &super::util::Empty) -> ::grpcio::Result<::grpcio::ClientUnaryReceiver> { + self.status_async_opt(req, ::grpcio::CallOption::default()) + } + pub fn spawn(&self, f: F) where F: ::futures::Future + Send + 'static { + self.client.spawn(f) + } +} + +pub trait StatusApi { + fn version(&mut self, ctx: ::grpcio::RpcContext, req: super::util::Empty, sink: ::grpcio::UnarySink); + fn status(&mut self, ctx: ::grpcio::RpcContext, req: super::util::Empty, sink: ::grpcio::UnarySink); +} + +pub fn create_status_api(s: S) -> ::grpcio::Service { + let mut builder = ::grpcio::ServiceBuilder::new(); + let mut instance = s.clone(); + builder = builder.add_unary_handler(&METHOD_STATUS_API_VERSION, move |ctx, req, resp| { + instance.version(ctx, req, resp) + }); + let mut instance = s; + builder = builder.add_unary_handler(&METHOD_STATUS_API_STATUS, move |ctx, req, resp| { + instance.status(ctx, req, resp) + }); + builder.build() +} diff --git a/rs/src/util.rs b/rs/src/util.rs new file mode 100644 index 0000000..5893336 --- /dev/null +++ b/rs/src/util.rs @@ -0,0 +1,354 @@ +// 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 `util.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 PutResponse { + // message fields + pub hash: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PutResponse { + fn default() -> &'a PutResponse { + ::default_instance() + } +} + +impl PutResponse { + pub fn new() -> PutResponse { + ::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()) + } +} + +impl ::protobuf::Message for PutResponse { + 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)?; + }, + _ => { + ::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); + } + 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)?; + } + 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() -> PutResponse { + PutResponse::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: &PutResponse| { &m.hash }, + |m: &mut PutResponse| { &mut m.hash }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PutResponse", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PutResponse { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PutResponse, + }; + unsafe { + instance.get(PutResponse::new) + } + } +} + +impl ::protobuf::Clear for PutResponse { + fn clear(&mut self) { + self.hash.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PutResponse { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PutResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Empty { + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Empty { + fn default() -> &'a Empty { + ::default_instance() + } +} + +impl Empty { + pub fn new() -> Empty { + ::std::default::Default::default() + } +} + +impl ::protobuf::Message for Empty { + 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 { + _ => { + ::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::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<()> { + 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() -> Empty { + Empty::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 fields = ::std::vec::Vec::new(); + ::protobuf::reflect::MessageDescriptor::new::( + "Empty", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Empty { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Empty, + }; + unsafe { + instance.get(Empty::new) + } + } +} + +impl ::protobuf::Clear for Empty { + fn clear(&mut self) { + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Empty { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Empty { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\nutil.proto\x12\x02pb\"!\n\x0bPutResponse\x12\x12\n\x04hash\x18\x01\ + \x20\x01(\tR\x04hash\"\x07\n\x05EmptyJ\xb3\x02\n\x06\x12\x04\0\0\n\x11\n\ + \x08\n\x01\x0c\x12\x03\0\0\x12\n\x08\n\x01\x02\x12\x03\x01\x08\n\nJ\n\ + \x02\x04\0\x12\x04\x04\0\x07\x01\x1a>\x20PutResponse\x20is\x20a\x20respo\ + nse\x20to\x20any\x20data\x20storage\x20(put)\x20requests\n\n\n\n\x03\x04\ + \0\x01\x12\x03\x04\x08\x13\nP\n\x04\x04\0\x02\0\x12\x03\x06\x04\x14\x1aC\ + \x20hash\x20is\x20hash/cid\x20(content\x20identifier)\x20of\x20the\x20da\ + ta\x20that\x20was\x20stored\n\n\r\n\x05\x04\0\x02\0\x04\x12\x04\x06\x04\ + \x04\x15\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x06\x04\n\n\x0c\n\x05\x04\0\ + \x02\0\x01\x12\x03\x06\x0b\x0f\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x06\ + \x12\x13\n&\n\x02\x04\x01\x12\x03\n\0\x11\x1a\x1b\x20Empty\x20is\x20an\ + \x20empty\x20message\n\n\n\n\x03\x04\x01\x01\x12\x03\n\x08\rb\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() + }) + } +}