diff --git a/floodsub/regen_structs_proto.sh b/floodsub/regen_structs_proto.sh deleted file mode 100755 index f3d4b89d..00000000 --- a/floodsub/regen_structs_proto.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# This script regenerates the `src/rpc_proto.rs` file from `rpc.proto`. - -docker run --rm -v `pwd`:/usr/code:z -w /usr/code rust /bin/bash -c " \ - apt-get update; \ - apt-get install -y protobuf-compiler; \ - cargo install protobuf; \ - protoc --rust_out . rpc.proto" - -mv -f rpc.rs ./src/rpc_proto.rs diff --git a/identify/regen_structs_proto.sh b/identify/regen_structs_proto.sh deleted file mode 100755 index 7c837cdf..00000000 --- a/identify/regen_structs_proto.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# This script regenerates the `src/structs_proto.rs` and `src/keys_proto.rs` files from -# `structs.proto` and `keys.proto`. - -sudo docker run --rm -v `pwd`:/usr/code:z -w /usr/code rust /bin/bash -c " \ - apt-get update; \ - apt-get install -y protobuf-compiler; \ - cargo install protobuf; \ - protoc --rust_out . structs.proto" - -mv -f structs.rs ./src/structs_proto.rs diff --git a/identify/src/structs_proto.rs b/identify/src/structs_proto.rs deleted file mode 100644 index 903b4bba..00000000 --- a/identify/src/structs_proto.rs +++ /dev/null @@ -1,497 +0,0 @@ -// This file is generated by rust-protobuf 2.0.0. Do not edit -// @generated - -// https://github.com/Manishearth/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy)] - -#![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)] - -use protobuf::Message as Message_imported_for_functions; -use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; - -#[derive(PartialEq,Clone,Default)] -pub struct Identify { - // message fields - protocolVersion: ::protobuf::SingularField<::std::string::String>, - agentVersion: ::protobuf::SingularField<::std::string::String>, - publicKey: ::protobuf::SingularField<::std::vec::Vec>, - listenAddrs: ::protobuf::RepeatedField<::std::vec::Vec>, - observedAddr: ::protobuf::SingularField<::std::vec::Vec>, - protocols: ::protobuf::RepeatedField<::std::string::String>, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl Identify { - pub fn new() -> Identify { - ::std::default::Default::default() - } - - // optional string protocolVersion = 5; - - pub fn clear_protocolVersion(&mut self) { - self.protocolVersion.clear(); - } - - pub fn has_protocolVersion(&self) -> bool { - self.protocolVersion.is_some() - } - - // Param is passed by value, moved - pub fn set_protocolVersion(&mut self, v: ::std::string::String) { - self.protocolVersion = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_protocolVersion(&mut self) -> &mut ::std::string::String { - if self.protocolVersion.is_none() { - self.protocolVersion.set_default(); - } - self.protocolVersion.as_mut().unwrap() - } - - // Take field - pub fn take_protocolVersion(&mut self) -> ::std::string::String { - self.protocolVersion.take().unwrap_or_else(|| ::std::string::String::new()) - } - - pub fn get_protocolVersion(&self) -> &str { - match self.protocolVersion.as_ref() { - Some(v) => &v, - None => "", - } - } - - // optional string agentVersion = 6; - - pub fn clear_agentVersion(&mut self) { - self.agentVersion.clear(); - } - - pub fn has_agentVersion(&self) -> bool { - self.agentVersion.is_some() - } - - // Param is passed by value, moved - pub fn set_agentVersion(&mut self, v: ::std::string::String) { - self.agentVersion = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_agentVersion(&mut self) -> &mut ::std::string::String { - if self.agentVersion.is_none() { - self.agentVersion.set_default(); - } - self.agentVersion.as_mut().unwrap() - } - - // Take field - pub fn take_agentVersion(&mut self) -> ::std::string::String { - self.agentVersion.take().unwrap_or_else(|| ::std::string::String::new()) - } - - pub fn get_agentVersion(&self) -> &str { - match self.agentVersion.as_ref() { - Some(v) => &v, - None => "", - } - } - - // optional bytes publicKey = 1; - - pub fn clear_publicKey(&mut self) { - self.publicKey.clear(); - } - - pub fn has_publicKey(&self) -> bool { - self.publicKey.is_some() - } - - // Param is passed by value, moved - pub fn set_publicKey(&mut self, v: ::std::vec::Vec) { - self.publicKey = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_publicKey(&mut self) -> &mut ::std::vec::Vec { - if self.publicKey.is_none() { - self.publicKey.set_default(); - } - self.publicKey.as_mut().unwrap() - } - - // Take field - pub fn take_publicKey(&mut self) -> ::std::vec::Vec { - self.publicKey.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - pub fn get_publicKey(&self) -> &[u8] { - match self.publicKey.as_ref() { - Some(v) => &v, - None => &[], - } - } - - // repeated bytes listenAddrs = 2; - - pub fn clear_listenAddrs(&mut self) { - self.listenAddrs.clear(); - } - - // Param is passed by value, moved - pub fn set_listenAddrs(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { - self.listenAddrs = v; - } - - // Mutable pointer to the field. - pub fn mut_listenAddrs(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { - &mut self.listenAddrs - } - - // Take field - pub fn take_listenAddrs(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { - ::std::mem::replace(&mut self.listenAddrs, ::protobuf::RepeatedField::new()) - } - - pub fn get_listenAddrs(&self) -> &[::std::vec::Vec] { - &self.listenAddrs - } - - // optional bytes observedAddr = 4; - - pub fn clear_observedAddr(&mut self) { - self.observedAddr.clear(); - } - - pub fn has_observedAddr(&self) -> bool { - self.observedAddr.is_some() - } - - // Param is passed by value, moved - pub fn set_observedAddr(&mut self, v: ::std::vec::Vec) { - self.observedAddr = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_observedAddr(&mut self) -> &mut ::std::vec::Vec { - if self.observedAddr.is_none() { - self.observedAddr.set_default(); - } - self.observedAddr.as_mut().unwrap() - } - - // Take field - pub fn take_observedAddr(&mut self) -> ::std::vec::Vec { - self.observedAddr.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - pub fn get_observedAddr(&self) -> &[u8] { - match self.observedAddr.as_ref() { - Some(v) => &v, - None => &[], - } - } - - // repeated string protocols = 3; - - pub fn clear_protocols(&mut self) { - self.protocols.clear(); - } - - // Param is passed by value, moved - pub fn set_protocols(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) { - self.protocols = v; - } - - // Mutable pointer to the field. - pub fn mut_protocols(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { - &mut self.protocols - } - - // Take field - pub fn take_protocols(&mut self) -> ::protobuf::RepeatedField<::std::string::String> { - ::std::mem::replace(&mut self.protocols, ::protobuf::RepeatedField::new()) - } - - pub fn get_protocols(&self) -> &[::std::string::String] { - &self.protocols - } -} - -impl ::protobuf::Message for Identify { - 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 { - 5 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.protocolVersion)?; - }, - 6 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.agentVersion)?; - }, - 1 => { - ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.publicKey)?; - }, - 2 => { - ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.listenAddrs)?; - }, - 4 => { - ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.observedAddr)?; - }, - 3 => { - ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.protocols)?; - }, - _ => { - ::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.protocolVersion.as_ref() { - my_size += ::protobuf::rt::string_size(5, &v); - } - if let Some(ref v) = self.agentVersion.as_ref() { - my_size += ::protobuf::rt::string_size(6, &v); - } - if let Some(ref v) = self.publicKey.as_ref() { - my_size += ::protobuf::rt::bytes_size(1, &v); - } - for value in &self.listenAddrs { - my_size += ::protobuf::rt::bytes_size(2, &value); - }; - if let Some(ref v) = self.observedAddr.as_ref() { - my_size += ::protobuf::rt::bytes_size(4, &v); - } - for value in &self.protocols { - 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 let Some(ref v) = self.protocolVersion.as_ref() { - os.write_string(5, &v)?; - } - if let Some(ref v) = self.agentVersion.as_ref() { - os.write_string(6, &v)?; - } - if let Some(ref v) = self.publicKey.as_ref() { - os.write_bytes(1, &v)?; - } - for v in &self.listenAddrs { - os.write_bytes(2, &v)?; - }; - if let Some(ref v) = self.observedAddr.as_ref() { - os.write_bytes(4, &v)?; - } - for v in &self.protocols { - 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) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Identify { - Identify::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_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "protocolVersion", - |m: &Identify| { &m.protocolVersion }, - |m: &mut Identify| { &mut m.protocolVersion }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "agentVersion", - |m: &Identify| { &m.agentVersion }, - |m: &mut Identify| { &mut m.agentVersion }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "publicKey", - |m: &Identify| { &m.publicKey }, - |m: &mut Identify| { &mut m.publicKey }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "listenAddrs", - |m: &Identify| { &m.listenAddrs }, - |m: &mut Identify| { &mut m.listenAddrs }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "observedAddr", - |m: &Identify| { &m.observedAddr }, - |m: &mut Identify| { &mut m.observedAddr }, - )); - fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "protocols", - |m: &Identify| { &m.protocols }, - |m: &mut Identify| { &mut m.protocols }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "Identify", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static Identify { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Identify, - }; - unsafe { - instance.get(Identify::new) - } - } -} - -impl ::protobuf::Clear for Identify { - fn clear(&mut self) { - self.clear_protocolVersion(); - self.clear_agentVersion(); - self.clear_publicKey(); - self.clear_listenAddrs(); - self.clear_observedAddr(); - self.clear_protocols(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Identify { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Identify { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\rstructs.proto\"\xda\x01\n\x08Identify\x12(\n\x0fprotocolVersion\x18\ - \x05\x20\x01(\tR\x0fprotocolVersion\x12\"\n\x0cagentVersion\x18\x06\x20\ - \x01(\tR\x0cagentVersion\x12\x1c\n\tpublicKey\x18\x01\x20\x01(\x0cR\tpub\ - licKey\x12\x20\n\x0blistenAddrs\x18\x02\x20\x03(\x0cR\x0blistenAddrs\x12\ - \"\n\x0cobservedAddr\x18\x04\x20\x01(\x0cR\x0cobservedAddr\x12\x1c\n\tpr\ - otocols\x18\x03\x20\x03(\tR\tprotocolsJ\xc2\t\n\x06\x12\x04\0\0\x16\x01\ - \n\n\n\x02\x04\0\x12\x04\0\0\x16\x01\n\n\n\x03\x04\0\x01\x12\x03\0\x08\ - \x10\nX\n\x04\x04\0\x02\0\x12\x03\x02\x02&\x1a8\x20protocolVersion\x20de\ - termines\x20compatibility\x20between\x20peers\n\"\x11\x20e.g.\x20ipfs/1.\ - 0.0\n\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x02\x02\n\n\x0c\n\x05\x04\0\ - \x02\0\x05\x12\x03\x02\x0b\x11\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x02\ - \x12!\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x02$%\n\x9f\x01\n\x04\x04\0\ - \x02\x01\x12\x03\x06\x02#\x1a|\x20agentVersion\x20is\x20like\x20a\x20Use\ - rAgent\x20string\x20in\x20browsers,\x20or\x20client\x20version\x20in\x20\ - bittorrent\n\x20includes\x20the\x20client\x20name\x20and\x20client.\n\"\ - \x14\x20e.g.\x20go-ipfs/0.1.0\n\n\x0c\n\x05\x04\0\x02\x01\x04\x12\x03\ - \x06\x02\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x06\x0b\x11\n\x0c\n\x05\ - \x04\0\x02\x01\x01\x12\x03\x06\x12\x1e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\ - \x03\x06!\"\n\xe3\x01\n\x04\x04\0\x02\x02\x12\x03\x0b\x02\x1f\x1a\xd5\ - \x01\x20publicKey\x20is\x20this\x20node's\x20public\x20key\x20(which\x20\ - also\x20gives\x20its\x20node.ID)\n\x20-\x20may\x20not\x20need\x20to\x20b\ - e\x20sent,\x20as\x20secure\x20channel\x20implies\x20it\x20has\x20been\ - \x20sent.\n\x20-\x20then\x20again,\x20if\x20we\x20change\x20/\x20disable\ - \x20secure\x20channel,\x20may\x20still\x20want\x20it.\n\n\x0c\n\x05\x04\ - \0\x02\x02\x04\x12\x03\x0b\x02\n\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\ - \x0b\x0b\x10\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x0b\x11\x1a\n\x0c\n\ - \x05\x04\0\x02\x02\x03\x12\x03\x0b\x1d\x1e\n]\n\x04\x04\0\x02\x03\x12\ - \x03\x0e\x02!\x1aP\x20listenAddrs\x20are\x20the\x20multiaddrs\x20the\x20\ - sender\x20node\x20listens\x20for\x20open\x20connections\x20on\n\n\x0c\n\ - \x05\x04\0\x02\x03\x04\x12\x03\x0e\x02\n\n\x0c\n\x05\x04\0\x02\x03\x05\ - \x12\x03\x0e\x0b\x10\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x0e\x11\x1c\n\ - \x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x0e\x1f\x20\n\x81\x02\n\x04\x04\0\ - \x02\x04\x12\x03\x13\x02\"\x1a\xf3\x01\x20oservedAddr\x20is\x20the\x20mu\ - ltiaddr\x20of\x20the\x20remote\x20endpoint\x20that\x20the\x20sender\x20n\ - ode\x20perceives\n\x20this\x20is\x20useful\x20information\x20to\x20conve\ - y\x20to\x20the\x20other\x20side,\x20as\x20it\x20helps\x20the\x20remote\ - \x20endpoint\n\x20determine\x20whether\x20its\x20connection\x20to\x20the\ - \x20local\x20peer\x20goes\x20through\x20NAT.\n\n\x0c\n\x05\x04\0\x02\x04\ - \x04\x12\x03\x13\x02\n\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\x13\x0b\x10\ - \n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x13\x11\x1d\n\x0c\n\x05\x04\0\x02\ - \x04\x03\x12\x03\x13\x20!\n\x0b\n\x04\x04\0\x02\x05\x12\x03\x15\x02\x20\ - \n\x0c\n\x05\x04\0\x02\x05\x04\x12\x03\x15\x02\n\n\x0c\n\x05\x04\0\x02\ - \x05\x05\x12\x03\x15\x0b\x11\n\x0c\n\x05\x04\0\x02\x05\x01\x12\x03\x15\ - \x12\x1b\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\x15\x1e\x1f\ -"; - -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/secio/regen_structs_proto.sh b/secio/regen_structs_proto.sh deleted file mode 100755 index 3ee8bb71..00000000 --- a/secio/regen_structs_proto.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# This script regenerates the `src/structs_proto.rs` and `src/keys_proto.rs` files from -# `structs.proto` and `keys.proto`. - -sudo docker run --rm -v `pwd`:/usr/code:z -w /usr/code rust /bin/bash -c " \ - apt-get update; \ - apt-get install -y protobuf-compiler; \ - cargo install protobuf; \ - protoc --rust_out . structs.proto; \ - protoc --rust_out . keys.proto" - -mv -f structs.rs ./src/structs_proto.rs -mv -f keys.rs ./src/keys_proto.rs diff --git a/secio/src/keys_proto.rs b/secio/src/keys_proto.rs deleted file mode 100644 index b7c3d284..00000000 --- a/secio/src/keys_proto.rs +++ /dev/null @@ -1,551 +0,0 @@ -// This file is generated by rust-protobuf 2.0.0. Do not edit -// @generated - -// https://github.com/Manishearth/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy)] - -#![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)] - -use protobuf::Message as Message_imported_for_functions; -use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; - -#[derive(PartialEq,Clone,Default)] -pub struct PublicKey { - // message fields - Type: ::std::option::Option, - Data: ::protobuf::SingularField<::std::vec::Vec>, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl PublicKey { - pub fn new() -> PublicKey { - ::std::default::Default::default() - } - - // required .KeyType Type = 1; - - pub fn clear_Type(&mut self) { - self.Type = ::std::option::Option::None; - } - - pub fn has_Type(&self) -> bool { - self.Type.is_some() - } - - // Param is passed by value, moved - pub fn set_Type(&mut self, v: KeyType) { - self.Type = ::std::option::Option::Some(v); - } - - pub fn get_Type(&self) -> KeyType { - self.Type.unwrap_or(KeyType::RSA) - } - - // required bytes Data = 2; - - pub fn clear_Data(&mut self) { - self.Data.clear(); - } - - pub fn has_Data(&self) -> bool { - self.Data.is_some() - } - - // Param is passed by value, moved - pub fn set_Data(&mut self, v: ::std::vec::Vec) { - self.Data = ::protobuf::SingularField::some(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 { - if self.Data.is_none() { - self.Data.set_default(); - } - self.Data.as_mut().unwrap() - } - - // Take field - pub fn take_Data(&mut self) -> ::std::vec::Vec { - self.Data.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - pub fn get_Data(&self) -> &[u8] { - match self.Data.as_ref() { - Some(v) => &v, - None => &[], - } - } -} - -impl ::protobuf::Message for PublicKey { - fn is_initialized(&self) -> bool { - if self.Type.is_none() { - return false; - } - if self.Data.is_none() { - 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_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.Type, 1, &mut self.unknown_fields)? - }, - 2 => { - ::protobuf::rt::read_singular_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 let Some(v) = self.Type { - my_size += ::protobuf::rt::enum_size(1, v); - } - if let Some(ref v) = self.Data.as_ref() { - my_size += ::protobuf::rt::bytes_size(2, &v); - } - 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(v) = self.Type { - os.write_enum(1, v.value())?; - } - if let Some(ref v) = self.Data.as_ref() { - os.write_bytes(2, &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) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PublicKey { - PublicKey::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_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "Type", - |m: &PublicKey| { &m.Type }, - |m: &mut PublicKey| { &mut m.Type }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "Data", - |m: &PublicKey| { &m.Data }, - |m: &mut PublicKey| { &mut m.Data }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "PublicKey", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static PublicKey { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PublicKey, - }; - unsafe { - instance.get(PublicKey::new) - } - } -} - -impl ::protobuf::Clear for PublicKey { - fn clear(&mut self) { - self.clear_Type(); - self.clear_Data(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PublicKey { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PublicKey { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct PrivateKey { - // message fields - Type: ::std::option::Option, - Data: ::protobuf::SingularField<::std::vec::Vec>, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl PrivateKey { - pub fn new() -> PrivateKey { - ::std::default::Default::default() - } - - // required .KeyType Type = 1; - - pub fn clear_Type(&mut self) { - self.Type = ::std::option::Option::None; - } - - pub fn has_Type(&self) -> bool { - self.Type.is_some() - } - - // Param is passed by value, moved - pub fn set_Type(&mut self, v: KeyType) { - self.Type = ::std::option::Option::Some(v); - } - - pub fn get_Type(&self) -> KeyType { - self.Type.unwrap_or(KeyType::RSA) - } - - // required bytes Data = 2; - - pub fn clear_Data(&mut self) { - self.Data.clear(); - } - - pub fn has_Data(&self) -> bool { - self.Data.is_some() - } - - // Param is passed by value, moved - pub fn set_Data(&mut self, v: ::std::vec::Vec) { - self.Data = ::protobuf::SingularField::some(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 { - if self.Data.is_none() { - self.Data.set_default(); - } - self.Data.as_mut().unwrap() - } - - // Take field - pub fn take_Data(&mut self) -> ::std::vec::Vec { - self.Data.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - pub fn get_Data(&self) -> &[u8] { - match self.Data.as_ref() { - Some(v) => &v, - None => &[], - } - } -} - -impl ::protobuf::Message for PrivateKey { - fn is_initialized(&self) -> bool { - if self.Type.is_none() { - return false; - } - if self.Data.is_none() { - 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_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.Type, 1, &mut self.unknown_fields)? - }, - 2 => { - ::protobuf::rt::read_singular_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 let Some(v) = self.Type { - my_size += ::protobuf::rt::enum_size(1, v); - } - if let Some(ref v) = self.Data.as_ref() { - my_size += ::protobuf::rt::bytes_size(2, &v); - } - 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(v) = self.Type { - os.write_enum(1, v.value())?; - } - if let Some(ref v) = self.Data.as_ref() { - os.write_bytes(2, &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) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> PrivateKey { - PrivateKey::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_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( - "Type", - |m: &PrivateKey| { &m.Type }, - |m: &mut PrivateKey| { &mut m.Type }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "Data", - |m: &PrivateKey| { &m.Data }, - |m: &mut PrivateKey| { &mut m.Data }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "PrivateKey", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static PrivateKey { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const PrivateKey, - }; - unsafe { - instance.get(PrivateKey::new) - } - } -} - -impl ::protobuf::Clear for PrivateKey { - fn clear(&mut self) { - self.clear_Type(); - self.clear_Data(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for PrivateKey { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for PrivateKey { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(Clone,PartialEq,Eq,Debug,Hash)] -pub enum KeyType { - RSA = 0, - Ed25519 = 1, - Secp256k1 = 2, -} - -impl ::protobuf::ProtobufEnum for KeyType { - fn value(&self) -> i32 { - *self as i32 - } - - fn from_i32(value: i32) -> ::std::option::Option { - match value { - 0 => ::std::option::Option::Some(KeyType::RSA), - 1 => ::std::option::Option::Some(KeyType::Ed25519), - 2 => ::std::option::Option::Some(KeyType::Secp256k1), - _ => ::std::option::Option::None - } - } - - fn values() -> &'static [Self] { - static values: &'static [KeyType] = &[ - KeyType::RSA, - KeyType::Ed25519, - KeyType::Secp256k1, - ]; - 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("KeyType", file_descriptor_proto()) - }) - } - } -} - -impl ::std::marker::Copy for KeyType { -} - -impl ::protobuf::reflect::ProtobufValue for KeyType { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) - } -} - -static file_descriptor_proto_data: &'static [u8] = b"\ - \n\nkeys.proto\"=\n\tPublicKey\x12\x1c\n\x04Type\x18\x01\x20\x02(\x0e2\ - \x08.KeyTypeR\x04Type\x12\x12\n\x04Data\x18\x02\x20\x02(\x0cR\x04Data\">\ - \n\nPrivateKey\x12\x1c\n\x04Type\x18\x01\x20\x02(\x0e2\x08.KeyTypeR\x04T\ - ype\x12\x12\n\x04Data\x18\x02\x20\x02(\x0cR\x04Data*.\n\x07KeyType\x12\ - \x07\n\x03RSA\x10\0\x12\x0b\n\x07Ed25519\x10\x01\x12\r\n\tSecp256k1\x10\ - \x02J\xdf\x03\n\x06\x12\x04\0\0\x0e\x01\n\n\n\x02\x05\0\x12\x04\0\0\x04\ - \x01\n\n\n\x03\x05\0\x01\x12\x03\0\x05\x0c\n\x0b\n\x04\x05\0\x02\0\x12\ - \x03\x01\x02\n\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x01\x02\x05\n\x0c\n\ - \x05\x05\0\x02\0\x02\x12\x03\x01\x08\t\n\x0b\n\x04\x05\0\x02\x01\x12\x03\ - \x02\x02\x0e\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x02\x02\t\n\x0c\n\x05\ - \x05\0\x02\x01\x02\x12\x03\x02\x0c\r\n\x0b\n\x04\x05\0\x02\x02\x12\x03\ - \x03\x02\x10\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x03\x02\x0b\n\x0c\n\ - \x05\x05\0\x02\x02\x02\x12\x03\x03\x0e\x0f\n\n\n\x02\x04\0\x12\x04\x06\0\ - \t\x01\n\n\n\x03\x04\0\x01\x12\x03\x06\x08\x11\n\x0b\n\x04\x04\0\x02\0\ - \x12\x03\x07\x02\x1c\n\x0c\n\x05\x04\0\x02\0\x04\x12\x03\x07\x02\n\n\x0c\ - \n\x05\x04\0\x02\0\x06\x12\x03\x07\x0b\x12\n\x0c\n\x05\x04\0\x02\0\x01\ - \x12\x03\x07\x13\x17\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x07\x1a\x1b\n\ - \x0b\n\x04\x04\0\x02\x01\x12\x03\x08\x02\x1a\n\x0c\n\x05\x04\0\x02\x01\ - \x04\x12\x03\x08\x02\n\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x08\x0b\x10\ - \n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x08\x11\x15\n\x0c\n\x05\x04\0\x02\ - \x01\x03\x12\x03\x08\x18\x19\n\n\n\x02\x04\x01\x12\x04\x0b\0\x0e\x01\n\n\ - \n\x03\x04\x01\x01\x12\x03\x0b\x08\x12\n\x0b\n\x04\x04\x01\x02\0\x12\x03\ - \x0c\x02\x1c\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x0c\x02\n\n\x0c\n\x05\ - \x04\x01\x02\0\x06\x12\x03\x0c\x0b\x12\n\x0c\n\x05\x04\x01\x02\0\x01\x12\ - \x03\x0c\x13\x17\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x0c\x1a\x1b\n\x0b\ - \n\x04\x04\x01\x02\x01\x12\x03\r\x02\x1a\n\x0c\n\x05\x04\x01\x02\x01\x04\ - \x12\x03\r\x02\n\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\r\x0b\x10\n\x0c\ - \n\x05\x04\x01\x02\x01\x01\x12\x03\r\x11\x15\n\x0c\n\x05\x04\x01\x02\x01\ - \x03\x12\x03\r\x18\x19\ -"; - -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/secio/src/structs_proto.rs b/secio/src/structs_proto.rs deleted file mode 100644 index 4301de8b..00000000 --- a/secio/src/structs_proto.rs +++ /dev/null @@ -1,681 +0,0 @@ -// This file is generated by rust-protobuf 2.0.0. Do not edit -// @generated - -// https://github.com/Manishearth/rust-clippy/issues/702 -#![allow(unknown_lints)] -#![allow(clippy)] - -#![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)] - -use protobuf::Message as Message_imported_for_functions; -use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; - -#[derive(PartialEq,Clone,Default)] -pub struct Propose { - // message fields - rand: ::protobuf::SingularField<::std::vec::Vec>, - pubkey: ::protobuf::SingularField<::std::vec::Vec>, - exchanges: ::protobuf::SingularField<::std::string::String>, - ciphers: ::protobuf::SingularField<::std::string::String>, - hashes: ::protobuf::SingularField<::std::string::String>, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl Propose { - pub fn new() -> Propose { - ::std::default::Default::default() - } - - // optional bytes rand = 1; - - pub fn clear_rand(&mut self) { - self.rand.clear(); - } - - pub fn has_rand(&self) -> bool { - self.rand.is_some() - } - - // Param is passed by value, moved - pub fn set_rand(&mut self, v: ::std::vec::Vec) { - self.rand = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_rand(&mut self) -> &mut ::std::vec::Vec { - if self.rand.is_none() { - self.rand.set_default(); - } - self.rand.as_mut().unwrap() - } - - // Take field - pub fn take_rand(&mut self) -> ::std::vec::Vec { - self.rand.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - pub fn get_rand(&self) -> &[u8] { - match self.rand.as_ref() { - Some(v) => &v, - None => &[], - } - } - - // optional bytes pubkey = 2; - - pub fn clear_pubkey(&mut self) { - self.pubkey.clear(); - } - - pub fn has_pubkey(&self) -> bool { - self.pubkey.is_some() - } - - // Param is passed by value, moved - pub fn set_pubkey(&mut self, v: ::std::vec::Vec) { - self.pubkey = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_pubkey(&mut self) -> &mut ::std::vec::Vec { - if self.pubkey.is_none() { - self.pubkey.set_default(); - } - self.pubkey.as_mut().unwrap() - } - - // Take field - pub fn take_pubkey(&mut self) -> ::std::vec::Vec { - 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 clear_exchanges(&mut self) { - self.exchanges.clear(); - } - - pub fn has_exchanges(&self) -> bool { - self.exchanges.is_some() - } - - // Param is passed by value, moved - pub fn set_exchanges(&mut self, v: ::std::string::String) { - self.exchanges = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_exchanges(&mut self) -> &mut ::std::string::String { - if self.exchanges.is_none() { - self.exchanges.set_default(); - } - self.exchanges.as_mut().unwrap() - } - - // Take field - pub fn take_exchanges(&mut self) -> ::std::string::String { - self.exchanges.take().unwrap_or_else(|| ::std::string::String::new()) - } - - pub fn get_exchanges(&self) -> &str { - match self.exchanges.as_ref() { - Some(v) => &v, - None => "", - } - } - - // optional string ciphers = 4; - - pub fn clear_ciphers(&mut self) { - self.ciphers.clear(); - } - - pub fn has_ciphers(&self) -> bool { - self.ciphers.is_some() - } - - // Param is passed by value, moved - pub fn set_ciphers(&mut self, v: ::std::string::String) { - self.ciphers = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_ciphers(&mut self) -> &mut ::std::string::String { - if self.ciphers.is_none() { - self.ciphers.set_default(); - } - self.ciphers.as_mut().unwrap() - } - - // Take field - pub fn take_ciphers(&mut self) -> ::std::string::String { - self.ciphers.take().unwrap_or_else(|| ::std::string::String::new()) - } - - pub fn get_ciphers(&self) -> &str { - match self.ciphers.as_ref() { - Some(v) => &v, - None => "", - } - } - - // optional string hashes = 5; - - pub fn clear_hashes(&mut self) { - self.hashes.clear(); - } - - pub fn has_hashes(&self) -> bool { - self.hashes.is_some() - } - - // Param is passed by value, moved - pub fn set_hashes(&mut self, v: ::std::string::String) { - self.hashes = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_hashes(&mut self) -> &mut ::std::string::String { - if self.hashes.is_none() { - self.hashes.set_default(); - } - self.hashes.as_mut().unwrap() - } - - // Take field - 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 { - 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_bytes_into(wire_type, is, &mut self.rand)?; - }, - 2 => { - ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.pubkey)?; - }, - 3 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.exchanges)?; - }, - 4 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ciphers)?; - }, - 5 => { - ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.hashes)?; - }, - _ => { - ::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.rand.as_ref() { - my_size += ::protobuf::rt::bytes_size(1, &v); - } - if let Some(ref v) = self.pubkey.as_ref() { - my_size += ::protobuf::rt::bytes_size(2, &v); - } - if let Some(ref v) = self.exchanges.as_ref() { - my_size += ::protobuf::rt::string_size(3, &v); - } - if let Some(ref v) = self.ciphers.as_ref() { - my_size += ::protobuf::rt::string_size(4, &v); - } - if let Some(ref v) = self.hashes.as_ref() { - my_size += ::protobuf::rt::string_size(5, &v); - } - 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.rand.as_ref() { - os.write_bytes(1, &v)?; - } - if let Some(ref v) = self.pubkey.as_ref() { - os.write_bytes(2, &v)?; - } - if let Some(ref v) = self.exchanges.as_ref() { - os.write_string(3, &v)?; - } - if let Some(ref v) = self.ciphers.as_ref() { - os.write_string(4, &v)?; - } - if let Some(ref v) = self.hashes.as_ref() { - os.write_string(5, &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) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Propose { - Propose::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_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "rand", - |m: &Propose| { &m.rand }, - |m: &mut Propose| { &mut m.rand }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "pubkey", - |m: &Propose| { &m.pubkey }, - |m: &mut Propose| { &mut m.pubkey }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "exchanges", - |m: &Propose| { &m.exchanges }, - |m: &mut Propose| { &mut m.exchanges }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "ciphers", - |m: &Propose| { &m.ciphers }, - |m: &mut Propose| { &mut m.ciphers }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( - "hashes", - |m: &Propose| { &m.hashes }, - |m: &mut Propose| { &mut m.hashes }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "Propose", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static Propose { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Propose, - }; - unsafe { - instance.get(Propose::new) - } - } -} - -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.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Propose { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Propose { - fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { - ::protobuf::reflect::ProtobufValueRef::Message(self) - } -} - -#[derive(PartialEq,Clone,Default)] -pub struct Exchange { - // message fields - epubkey: ::protobuf::SingularField<::std::vec::Vec>, - signature: ::protobuf::SingularField<::std::vec::Vec>, - // special fields - unknown_fields: ::protobuf::UnknownFields, - cached_size: ::protobuf::CachedSize, -} - -impl Exchange { - pub fn new() -> Exchange { - ::std::default::Default::default() - } - - // optional bytes epubkey = 1; - - pub fn clear_epubkey(&mut self) { - self.epubkey.clear(); - } - - pub fn has_epubkey(&self) -> bool { - self.epubkey.is_some() - } - - // Param is passed by value, moved - pub fn set_epubkey(&mut self, v: ::std::vec::Vec) { - self.epubkey = ::protobuf::SingularField::some(v); - } - - // Mutable pointer to the field. - // If field is not initialized, it is initialized with default value first. - pub fn mut_epubkey(&mut self) -> &mut ::std::vec::Vec { - if self.epubkey.is_none() { - self.epubkey.set_default(); - } - self.epubkey.as_mut().unwrap() - } - - // Take field - pub fn take_epubkey(&mut self) -> ::std::vec::Vec { - self.epubkey.take().unwrap_or_else(|| ::std::vec::Vec::new()) - } - - pub fn get_epubkey(&self) -> &[u8] { - match self.epubkey.as_ref() { - Some(v) => &v, - None => &[], - } - } - - // optional bytes signature = 2; - - pub fn clear_signature(&mut self) { - self.signature.clear(); - } - - pub fn has_signature(&self) -> bool { - self.signature.is_some() - } - - // Param is passed by value, moved - pub fn set_signature(&mut self, v: ::std::vec::Vec) { - self.signature = ::protobuf::SingularField::some(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 { - if self.signature.is_none() { - self.signature.set_default(); - } - self.signature.as_mut().unwrap() - } - - // Take field - pub fn take_signature(&mut self) -> ::std::vec::Vec { - 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 { - 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_bytes_into(wire_type, is, &mut self.epubkey)?; - }, - 2 => { - ::protobuf::rt::read_singular_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 let Some(ref v) = self.epubkey.as_ref() { - my_size += ::protobuf::rt::bytes_size(1, &v); - } - if let Some(ref v) = self.signature.as_ref() { - my_size += ::protobuf::rt::bytes_size(2, &v); - } - 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.epubkey.as_ref() { - os.write_bytes(1, &v)?; - } - if let Some(ref v) = self.signature.as_ref() { - os.write_bytes(2, &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) -> &::std::any::Any { - self as &::std::any::Any - } - fn as_any_mut(&mut self) -> &mut ::std::any::Any { - self as &mut ::std::any::Any - } - fn into_any(self: Box) -> ::std::boxed::Box<::std::any::Any> { - self - } - - fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { - Self::descriptor_static() - } - - fn new() -> Exchange { - Exchange::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_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "epubkey", - |m: &Exchange| { &m.epubkey }, - |m: &mut Exchange| { &mut m.epubkey }, - )); - fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( - "signature", - |m: &Exchange| { &m.signature }, - |m: &mut Exchange| { &mut m.signature }, - )); - ::protobuf::reflect::MessageDescriptor::new::( - "Exchange", - fields, - file_descriptor_proto() - ) - }) - } - } - - fn default_instance() -> &'static Exchange { - static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { - lock: ::protobuf::lazy::ONCE_INIT, - ptr: 0 as *const Exchange, - }; - unsafe { - instance.get(Exchange::new) - } - } -} - -impl ::protobuf::Clear for Exchange { - fn clear(&mut self) { - self.clear_epubkey(); - self.clear_signature(); - self.unknown_fields.clear(); - } -} - -impl ::std::fmt::Debug for Exchange { - fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - ::protobuf::text_format::fmt(self, f) - } -} - -impl ::protobuf::reflect::ProtobufValue for Exchange { - 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#$\ -"; - -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() - }) - } -}