Upgrade and unify protobuf version(1.x => 2.0.2) (#283)

* Update and unify protobuf version(1.x => 2.0.2)

* Update protobuf codegen shell script
This commit is contained in:
Qian LinFeng
2018-07-10 20:07:28 +08:00
committed by Pierre Krieger
parent 18075f4eaa
commit fd01b18e53
18 changed files with 292 additions and 721 deletions

View File

@ -1,4 +1,4 @@
// This file is generated. Do not edit
// This file is generated by rust-protobuf 2.0.2. Do not edit
// @generated
// https://github.com/Manishearth/rust-clippy/issues/702
@ -31,24 +31,11 @@ pub struct PublicKey {
cached_size: ::protobuf::CachedSize,
}
// see codegen.rs for the explanation why impl Sync explicitly
unsafe impl ::std::marker::Sync for PublicKey {}
impl PublicKey {
pub fn new() -> PublicKey {
::std::default::Default::default()
}
pub fn default_instance() -> &'static PublicKey {
static mut instance: ::protobuf::lazy::Lazy<PublicKey> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const PublicKey,
};
unsafe {
instance.get(PublicKey::new)
}
}
// required .KeyType Type = 1;
pub fn clear_Type(&mut self) {
@ -68,14 +55,6 @@ impl PublicKey {
self.Type.unwrap_or(KeyType::RSA)
}
fn get_Type_for_reflect(&self) -> &::std::option::Option<KeyType> {
&self.Type
}
fn mut_Type_for_reflect(&mut self) -> &mut ::std::option::Option<KeyType> {
&mut self.Type
}
// required bytes Data = 2;
pub fn clear_Data(&mut self) {
@ -111,14 +90,6 @@ impl PublicKey {
None => &[],
}
}
fn get_Data_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
&self.Data
}
fn mut_Data_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
&mut self.Data
}
}
impl ::protobuf::Message for PublicKey {
@ -199,16 +170,14 @@ impl ::protobuf::Message for PublicKey {
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
::protobuf::MessageStatic::descriptor_static(None::<Self>)
Self::descriptor_static()
}
}
impl ::protobuf::MessageStatic for PublicKey {
fn new() -> PublicKey {
PublicKey::new()
}
fn descriptor_static(_: ::std::option::Option<PublicKey>) -> &'static ::protobuf::reflect::MessageDescriptor {
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,
@ -218,13 +187,13 @@ impl ::protobuf::MessageStatic for PublicKey {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<KeyType>>(
"Type",
PublicKey::get_Type_for_reflect,
PublicKey::mut_Type_for_reflect,
|m: &PublicKey| { &m.Type },
|m: &mut PublicKey| { &mut m.Type },
));
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"Data",
PublicKey::get_Data_for_reflect,
PublicKey::mut_Data_for_reflect,
|m: &PublicKey| { &m.Data },
|m: &mut PublicKey| { &mut m.Data },
));
::protobuf::reflect::MessageDescriptor::new::<PublicKey>(
"PublicKey",
@ -234,6 +203,16 @@ impl ::protobuf::MessageStatic for PublicKey {
})
}
}
fn default_instance() -> &'static PublicKey {
static mut instance: ::protobuf::lazy::Lazy<PublicKey> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const PublicKey,
};
unsafe {
instance.get(PublicKey::new)
}
}
}
impl ::protobuf::Clear for PublicKey {
@ -266,24 +245,11 @@ pub struct PrivateKey {
cached_size: ::protobuf::CachedSize,
}
// see codegen.rs for the explanation why impl Sync explicitly
unsafe impl ::std::marker::Sync for PrivateKey {}
impl PrivateKey {
pub fn new() -> PrivateKey {
::std::default::Default::default()
}
pub fn default_instance() -> &'static PrivateKey {
static mut instance: ::protobuf::lazy::Lazy<PrivateKey> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const PrivateKey,
};
unsafe {
instance.get(PrivateKey::new)
}
}
// required .KeyType Type = 1;
pub fn clear_Type(&mut self) {
@ -303,14 +269,6 @@ impl PrivateKey {
self.Type.unwrap_or(KeyType::RSA)
}
fn get_Type_for_reflect(&self) -> &::std::option::Option<KeyType> {
&self.Type
}
fn mut_Type_for_reflect(&mut self) -> &mut ::std::option::Option<KeyType> {
&mut self.Type
}
// required bytes Data = 2;
pub fn clear_Data(&mut self) {
@ -346,14 +304,6 @@ impl PrivateKey {
None => &[],
}
}
fn get_Data_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec<u8>> {
&self.Data
}
fn mut_Data_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> {
&mut self.Data
}
}
impl ::protobuf::Message for PrivateKey {
@ -434,16 +384,14 @@ impl ::protobuf::Message for PrivateKey {
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
::protobuf::MessageStatic::descriptor_static(None::<Self>)
Self::descriptor_static()
}
}
impl ::protobuf::MessageStatic for PrivateKey {
fn new() -> PrivateKey {
PrivateKey::new()
}
fn descriptor_static(_: ::std::option::Option<PrivateKey>) -> &'static ::protobuf::reflect::MessageDescriptor {
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,
@ -453,13 +401,13 @@ impl ::protobuf::MessageStatic for PrivateKey {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum<KeyType>>(
"Type",
PrivateKey::get_Type_for_reflect,
PrivateKey::mut_Type_for_reflect,
|m: &PrivateKey| { &m.Type },
|m: &mut PrivateKey| { &mut m.Type },
));
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"Data",
PrivateKey::get_Data_for_reflect,
PrivateKey::mut_Data_for_reflect,
|m: &PrivateKey| { &m.Data },
|m: &mut PrivateKey| { &mut m.Data },
));
::protobuf::reflect::MessageDescriptor::new::<PrivateKey>(
"PrivateKey",
@ -469,6 +417,16 @@ impl ::protobuf::MessageStatic for PrivateKey {
})
}
}
fn default_instance() -> &'static PrivateKey {
static mut instance: ::protobuf::lazy::Lazy<PrivateKey> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const PrivateKey,
};
unsafe {
instance.get(PrivateKey::new)
}
}
}
impl ::protobuf::Clear for PrivateKey {
@ -521,7 +479,7 @@ impl ::protobuf::ProtobufEnum for KeyType {
values
}
fn enum_descriptor_static(_: ::std::option::Option<KeyType>) -> &'static ::protobuf::reflect::EnumDescriptor {
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,