mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-30 16:31:57 +00:00
*: Consolidate protobuf scripts and update to rust-protobuf 2.8.1 (#1275)
* *: Consolidate protobuf generation scripts * *: Update to rust-protobuf 2.8.1 * *: Mark protobuf generated modules with '_proto'
This commit is contained in:
committed by
Pierre Krieger
parent
b90aa37b95
commit
206e4e7553
16
protocols/secio/src/structs.proto
Normal file
16
protocols/secio/src/structs.proto
Normal file
@@ -0,0 +1,16 @@
|
||||
syntax = "proto2";
|
||||
|
||||
package spipe.pb;
|
||||
|
||||
message Propose {
|
||||
optional bytes rand = 1;
|
||||
optional bytes pubkey = 2;
|
||||
optional string exchanges = 3;
|
||||
optional string ciphers = 4;
|
||||
optional string hashes = 5;
|
||||
}
|
||||
|
||||
message Exchange {
|
||||
optional bytes epubkey = 1;
|
||||
optional bytes signature = 2;
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
// This file is generated by rust-protobuf 2.3.0. Do not edit
|
||||
// This file is generated by rust-protobuf 2.8.1. Do not edit
|
||||
// @generated
|
||||
|
||||
// https://github.com/Manishearth/rust-clippy/issues/702
|
||||
@@ -17,10 +17,15 @@
|
||||
#![allow(unsafe_code)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(unused_results)]
|
||||
//! Generated file from `src/structs.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_8_1;
|
||||
|
||||
#[derive(PartialEq,Clone,Default)]
|
||||
pub struct Propose {
|
||||
// message fields
|
||||
@@ -34,6 +39,12 @@ pub struct Propose {
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a Propose {
|
||||
fn default() -> &'a Propose {
|
||||
<Propose as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl Propose {
|
||||
pub fn new() -> Propose {
|
||||
::std::default::Default::default()
|
||||
@@ -41,6 +52,13 @@ impl Propose {
|
||||
|
||||
// optional bytes rand = 1;
|
||||
|
||||
|
||||
pub fn get_rand(&self) -> &[u8] {
|
||||
match self.rand.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => &[],
|
||||
}
|
||||
}
|
||||
pub fn clear_rand(&mut self) {
|
||||
self.rand.clear();
|
||||
}
|
||||
@@ -68,15 +86,15 @@ impl Propose {
|
||||
self.rand.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
||||
}
|
||||
|
||||
pub fn get_rand(&self) -> &[u8] {
|
||||
match self.rand.as_ref() {
|
||||
// optional bytes pubkey = 2;
|
||||
|
||||
|
||||
pub fn get_pubkey(&self) -> &[u8] {
|
||||
match self.pubkey.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => &[],
|
||||
}
|
||||
}
|
||||
|
||||
// optional bytes pubkey = 2;
|
||||
|
||||
pub fn clear_pubkey(&mut self) {
|
||||
self.pubkey.clear();
|
||||
}
|
||||
@@ -104,15 +122,15 @@ impl Propose {
|
||||
self.pubkey.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
||||
}
|
||||
|
||||
pub fn get_pubkey(&self) -> &[u8] {
|
||||
match self.pubkey.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => &[],
|
||||
}
|
||||
}
|
||||
|
||||
// optional string exchanges = 3;
|
||||
|
||||
|
||||
pub fn get_exchanges(&self) -> &str {
|
||||
match self.exchanges.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => "",
|
||||
}
|
||||
}
|
||||
pub fn clear_exchanges(&mut self) {
|
||||
self.exchanges.clear();
|
||||
}
|
||||
@@ -140,15 +158,15 @@ impl Propose {
|
||||
self.exchanges.take().unwrap_or_else(|| ::std::string::String::new())
|
||||
}
|
||||
|
||||
pub fn get_exchanges(&self) -> &str {
|
||||
match self.exchanges.as_ref() {
|
||||
// optional string ciphers = 4;
|
||||
|
||||
|
||||
pub fn get_ciphers(&self) -> &str {
|
||||
match self.ciphers.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => "",
|
||||
}
|
||||
}
|
||||
|
||||
// optional string ciphers = 4;
|
||||
|
||||
pub fn clear_ciphers(&mut self) {
|
||||
self.ciphers.clear();
|
||||
}
|
||||
@@ -176,15 +194,15 @@ impl Propose {
|
||||
self.ciphers.take().unwrap_or_else(|| ::std::string::String::new())
|
||||
}
|
||||
|
||||
pub fn get_ciphers(&self) -> &str {
|
||||
match self.ciphers.as_ref() {
|
||||
// optional string hashes = 5;
|
||||
|
||||
|
||||
pub fn get_hashes(&self) -> &str {
|
||||
match self.hashes.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => "",
|
||||
}
|
||||
}
|
||||
|
||||
// optional string hashes = 5;
|
||||
|
||||
pub fn clear_hashes(&mut self) {
|
||||
self.hashes.clear();
|
||||
}
|
||||
@@ -211,13 +229,6 @@ impl Propose {
|
||||
pub fn take_hashes(&mut self) -> ::std::string::String {
|
||||
self.hashes.take().unwrap_or_else(|| ::std::string::String::new())
|
||||
}
|
||||
|
||||
pub fn get_hashes(&self) -> &str {
|
||||
match self.hashes.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => "",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for Propose {
|
||||
@@ -381,11 +392,11 @@ impl ::protobuf::Message for Propose {
|
||||
|
||||
impl ::protobuf::Clear for Propose {
|
||||
fn clear(&mut self) {
|
||||
self.clear_rand();
|
||||
self.clear_pubkey();
|
||||
self.clear_exchanges();
|
||||
self.clear_ciphers();
|
||||
self.clear_hashes();
|
||||
self.rand.clear();
|
||||
self.pubkey.clear();
|
||||
self.exchanges.clear();
|
||||
self.ciphers.clear();
|
||||
self.hashes.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
@@ -397,7 +408,7 @@ impl ::std::fmt::Debug for Propose {
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for Propose {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef<'_> {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
|
||||
::protobuf::reflect::ProtobufValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
@@ -412,6 +423,12 @@ pub struct Exchange {
|
||||
pub cached_size: ::protobuf::CachedSize,
|
||||
}
|
||||
|
||||
impl<'a> ::std::default::Default for &'a Exchange {
|
||||
fn default() -> &'a Exchange {
|
||||
<Exchange as ::protobuf::Message>::default_instance()
|
||||
}
|
||||
}
|
||||
|
||||
impl Exchange {
|
||||
pub fn new() -> Exchange {
|
||||
::std::default::Default::default()
|
||||
@@ -419,6 +436,13 @@ impl Exchange {
|
||||
|
||||
// optional bytes epubkey = 1;
|
||||
|
||||
|
||||
pub fn get_epubkey(&self) -> &[u8] {
|
||||
match self.epubkey.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => &[],
|
||||
}
|
||||
}
|
||||
pub fn clear_epubkey(&mut self) {
|
||||
self.epubkey.clear();
|
||||
}
|
||||
@@ -446,15 +470,15 @@ impl Exchange {
|
||||
self.epubkey.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
||||
}
|
||||
|
||||
pub fn get_epubkey(&self) -> &[u8] {
|
||||
match self.epubkey.as_ref() {
|
||||
// optional bytes signature = 2;
|
||||
|
||||
|
||||
pub fn get_signature(&self) -> &[u8] {
|
||||
match self.signature.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => &[],
|
||||
}
|
||||
}
|
||||
|
||||
// optional bytes signature = 2;
|
||||
|
||||
pub fn clear_signature(&mut self) {
|
||||
self.signature.clear();
|
||||
}
|
||||
@@ -481,13 +505,6 @@ impl Exchange {
|
||||
pub fn take_signature(&mut self) -> ::std::vec::Vec<u8> {
|
||||
self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new())
|
||||
}
|
||||
|
||||
pub fn get_signature(&self) -> &[u8] {
|
||||
match self.signature.as_ref() {
|
||||
Some(v) => &v,
|
||||
None => &[],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::protobuf::Message for Exchange {
|
||||
@@ -609,8 +626,8 @@ impl ::protobuf::Message for Exchange {
|
||||
|
||||
impl ::protobuf::Clear for Exchange {
|
||||
fn clear(&mut self) {
|
||||
self.clear_epubkey();
|
||||
self.clear_signature();
|
||||
self.epubkey.clear();
|
||||
self.signature.clear();
|
||||
self.unknown_fields.clear();
|
||||
}
|
||||
}
|
||||
@@ -622,45 +639,46 @@ impl ::std::fmt::Debug for Exchange {
|
||||
}
|
||||
|
||||
impl ::protobuf::reflect::ProtobufValue for Exchange {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef<'_> {
|
||||
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
|
||||
::protobuf::reflect::ProtobufValueRef::Message(self)
|
||||
}
|
||||
}
|
||||
|
||||
static file_descriptor_proto_data: &'static [u8] = b"\
|
||||
\n\rstructs.proto\x12\x08spipe.pb\"\x85\x01\n\x07Propose\x12\x12\n\x04ra\
|
||||
nd\x18\x01\x20\x01(\x0cR\x04rand\x12\x16\n\x06pubkey\x18\x02\x20\x01(\
|
||||
\x0cR\x06pubkey\x12\x1c\n\texchanges\x18\x03\x20\x01(\tR\texchanges\x12\
|
||||
\x18\n\x07ciphers\x18\x04\x20\x01(\tR\x07ciphers\x12\x16\n\x06hashes\x18\
|
||||
\x05\x20\x01(\tR\x06hashes\"B\n\x08Exchange\x12\x18\n\x07epubkey\x18\x01\
|
||||
\x20\x01(\x0cR\x07epubkey\x12\x1c\n\tsignature\x18\x02\x20\x01(\x0cR\tsi\
|
||||
gnatureJ\xa5\x04\n\x06\x12\x04\0\0\r\x01\n\x08\n\x01\x02\x12\x03\0\x08\
|
||||
\x10\n\n\n\x02\x04\0\x12\x04\x02\0\x08\x01\n\n\n\x03\x04\0\x01\x12\x03\
|
||||
\x02\x08\x0f\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x08\x20\n\x0c\n\x05\x04\
|
||||
\0\x02\0\x04\x12\x03\x03\x08\x10\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\
|
||||
\x11\x16\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x17\x1b\n\x0c\n\x05\x04\
|
||||
\0\x02\0\x03\x12\x03\x03\x1e\x1f\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\
|
||||
\x08\"\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\x04\x08\x10\n\x0c\n\x05\x04\
|
||||
\0\x02\x01\x05\x12\x03\x04\x11\x16\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\
|
||||
\x04\x17\x1d\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x20!\n\x0b\n\x04\
|
||||
\x04\0\x02\x02\x12\x03\x05\x08&\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03\
|
||||
\x05\x08\x10\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x05\x11\x17\n\x0c\n\
|
||||
\x05\x04\0\x02\x02\x01\x12\x03\x05\x18!\n\x0c\n\x05\x04\0\x02\x02\x03\
|
||||
\x12\x03\x05$%\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x08$\n\x0c\n\x05\
|
||||
\x04\0\x02\x03\x04\x12\x03\x06\x08\x10\n\x0c\n\x05\x04\0\x02\x03\x05\x12\
|
||||
\x03\x06\x11\x17\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x06\x18\x1f\n\x0c\
|
||||
\n\x05\x04\0\x02\x03\x03\x12\x03\x06\"#\n\x0b\n\x04\x04\0\x02\x04\x12\
|
||||
\x03\x07\x08#\n\x0c\n\x05\x04\0\x02\x04\x04\x12\x03\x07\x08\x10\n\x0c\n\
|
||||
\x05\x04\0\x02\x04\x05\x12\x03\x07\x11\x17\n\x0c\n\x05\x04\0\x02\x04\x01\
|
||||
\x12\x03\x07\x18\x1e\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x07!\"\n\n\n\
|
||||
\x02\x04\x01\x12\x04\n\0\r\x01\n\n\n\x03\x04\x01\x01\x12\x03\n\x08\x10\n\
|
||||
\x0b\n\x04\x04\x01\x02\0\x12\x03\x0b\x08#\n\x0c\n\x05\x04\x01\x02\0\x04\
|
||||
\x12\x03\x0b\x08\x10\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x0b\x11\x16\n\
|
||||
\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x0b\x17\x1e\n\x0c\n\x05\x04\x01\x02\
|
||||
\0\x03\x12\x03\x0b!\"\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x0c\x08%\n\x0c\
|
||||
\n\x05\x04\x01\x02\x01\x04\x12\x03\x0c\x08\x10\n\x0c\n\x05\x04\x01\x02\
|
||||
\x01\x05\x12\x03\x0c\x11\x16\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x0c\
|
||||
\x17\x20\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x0c#$\
|
||||
\n\x11src/structs.proto\x12\x08spipe.pb\"\x85\x01\n\x07Propose\x12\x12\n\
|
||||
\x04rand\x18\x01\x20\x01(\x0cR\x04rand\x12\x16\n\x06pubkey\x18\x02\x20\
|
||||
\x01(\x0cR\x06pubkey\x12\x1c\n\texchanges\x18\x03\x20\x01(\tR\texchanges\
|
||||
\x12\x18\n\x07ciphers\x18\x04\x20\x01(\tR\x07ciphers\x12\x16\n\x06hashes\
|
||||
\x18\x05\x20\x01(\tR\x06hashes\"B\n\x08Exchange\x12\x18\n\x07epubkey\x18\
|
||||
\x01\x20\x01(\x0cR\x07epubkey\x12\x1c\n\tsignature\x18\x02\x20\x01(\x0cR\
|
||||
\tsignatureJ\xaf\x04\n\x06\x12\x04\0\0\x0f\x01\n\x08\n\x01\x0c\x12\x03\0\
|
||||
\0\x12\n\x08\n\x01\x02\x12\x03\x02\x08\x10\n\n\n\x02\x04\0\x12\x04\x04\0\
|
||||
\n\x01\n\n\n\x03\x04\0\x01\x12\x03\x04\x08\x0f\n\x0b\n\x04\x04\0\x02\0\
|
||||
\x12\x03\x05\x08\x20\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x05\x08\x10\n\
|
||||
\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x05\x11\x16\n\x0c\n\x05\x04\0\x02\0\
|
||||
\x01\x12\x03\x05\x17\x1b\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x05\x1e\x1f\
|
||||
\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x06\x08\"\n\x0c\n\x05\x04\0\x02\x01\
|
||||
\x04\x12\x03\x06\x08\x10\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x06\x11\
|
||||
\x16\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x06\x17\x1d\n\x0c\n\x05\x04\0\
|
||||
\x02\x01\x03\x12\x03\x06\x20!\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x07\x08&\
|
||||
\n\x0c\n\x05\x04\0\x02\x02\x04\x12\x03\x07\x08\x10\n\x0c\n\x05\x04\0\x02\
|
||||
\x02\x05\x12\x03\x07\x11\x17\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x07\
|
||||
\x18!\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x07$%\n\x0b\n\x04\x04\0\x02\
|
||||
\x03\x12\x03\x08\x08$\n\x0c\n\x05\x04\0\x02\x03\x04\x12\x03\x08\x08\x10\
|
||||
\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x08\x11\x17\n\x0c\n\x05\x04\0\x02\
|
||||
\x03\x01\x12\x03\x08\x18\x1f\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x08\"\
|
||||
#\n\x0b\n\x04\x04\0\x02\x04\x12\x03\t\x08#\n\x0c\n\x05\x04\0\x02\x04\x04\
|
||||
\x12\x03\t\x08\x10\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\t\x11\x17\n\x0c\
|
||||
\n\x05\x04\0\x02\x04\x01\x12\x03\t\x18\x1e\n\x0c\n\x05\x04\0\x02\x04\x03\
|
||||
\x12\x03\t!\"\n\n\n\x02\x04\x01\x12\x04\x0c\0\x0f\x01\n\n\n\x03\x04\x01\
|
||||
\x01\x12\x03\x0c\x08\x10\n\x0b\n\x04\x04\x01\x02\0\x12\x03\r\x08#\n\x0c\
|
||||
\n\x05\x04\x01\x02\0\x04\x12\x03\r\x08\x10\n\x0c\n\x05\x04\x01\x02\0\x05\
|
||||
\x12\x03\r\x11\x16\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\r\x17\x1e\n\x0c\
|
||||
\n\x05\x04\x01\x02\0\x03\x12\x03\r!\"\n\x0b\n\x04\x04\x01\x02\x01\x12\
|
||||
\x03\x0e\x08%\n\x0c\n\x05\x04\x01\x02\x01\x04\x12\x03\x0e\x08\x10\n\x0c\
|
||||
\n\x05\x04\x01\x02\x01\x05\x12\x03\x0e\x11\x16\n\x0c\n\x05\x04\x01\x02\
|
||||
\x01\x01\x12\x03\x0e\x17\x20\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x0e\
|
||||
#$\
|
||||
";
|
||||
|
||||
static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
|
||||
|
Reference in New Issue
Block a user