diff --git a/protocol/src/authentication.rs b/protocol/src/authentication.rs index 2c14b4d0..38decf94 100644 --- a/protocol/src/authentication.rs +++ b/protocol/src/authentication.rs @@ -20,7 +20,7 @@ use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; -#[derive(Clone,Default)] +#[derive(PartialEq,Clone,Default)] pub struct ClientResponseEncrypted { // message fields login_credentials: ::protobuf::SingularPtrField, @@ -34,7 +34,7 @@ pub struct ClientResponseEncrypted { client_info: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -51,21 +51,7 @@ impl ClientResponseEncrypted { ptr: 0 as *const ClientResponseEncrypted, }; unsafe { - instance.get(|| { - ClientResponseEncrypted { - login_credentials: ::protobuf::SingularPtrField::none(), - account_creation: ::std::option::Option::None, - fingerprint_response: ::protobuf::SingularPtrField::none(), - peer_ticket: ::protobuf::SingularPtrField::none(), - system_info: ::protobuf::SingularPtrField::none(), - platform_model: ::protobuf::SingularField::none(), - version_string: ::protobuf::SingularField::none(), - appkey: ::protobuf::SingularPtrField::none(), - client_info: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ClientResponseEncrypted::new) } } @@ -102,6 +88,14 @@ impl ClientResponseEncrypted { self.login_credentials.as_ref().unwrap_or_else(|| LoginCredentials::default_instance()) } + fn get_login_credentials_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.login_credentials + } + + fn mut_login_credentials_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.login_credentials + } + // optional .AccountCreation account_creation = 20; pub fn clear_account_creation(&mut self) { @@ -121,6 +115,14 @@ impl ClientResponseEncrypted { self.account_creation.unwrap_or(AccountCreation::ACCOUNT_CREATION_ALWAYS_PROMPT) } + fn get_account_creation_for_reflect(&self) -> &::std::option::Option { + &self.account_creation + } + + fn mut_account_creation_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.account_creation + } + // optional .FingerprintResponseUnion fingerprint_response = 30; pub fn clear_fingerprint_response(&mut self) { @@ -154,6 +156,14 @@ impl ClientResponseEncrypted { self.fingerprint_response.as_ref().unwrap_or_else(|| FingerprintResponseUnion::default_instance()) } + fn get_fingerprint_response_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.fingerprint_response + } + + fn mut_fingerprint_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.fingerprint_response + } + // optional .PeerTicketUnion peer_ticket = 40; pub fn clear_peer_ticket(&mut self) { @@ -187,6 +197,14 @@ impl ClientResponseEncrypted { self.peer_ticket.as_ref().unwrap_or_else(|| PeerTicketUnion::default_instance()) } + fn get_peer_ticket_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.peer_ticket + } + + fn mut_peer_ticket_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.peer_ticket + } + // required .SystemInfo system_info = 50; pub fn clear_system_info(&mut self) { @@ -220,6 +238,14 @@ impl ClientResponseEncrypted { self.system_info.as_ref().unwrap_or_else(|| SystemInfo::default_instance()) } + fn get_system_info_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.system_info + } + + fn mut_system_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.system_info + } + // optional string platform_model = 60; pub fn clear_platform_model(&mut self) { @@ -256,6 +282,14 @@ impl ClientResponseEncrypted { } } + fn get_platform_model_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.platform_model + } + + fn mut_platform_model_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.platform_model + } + // optional string version_string = 70; pub fn clear_version_string(&mut self) { @@ -292,6 +326,14 @@ impl ClientResponseEncrypted { } } + fn get_version_string_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.version_string + } + + fn mut_version_string_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.version_string + } + // optional .LibspotifyAppKey appkey = 80; pub fn clear_appkey(&mut self) { @@ -325,6 +367,14 @@ impl ClientResponseEncrypted { self.appkey.as_ref().unwrap_or_else(|| LibspotifyAppKey::default_instance()) } + fn get_appkey_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.appkey + } + + fn mut_appkey_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.appkey + } + // optional .ClientInfo client_info = 90; pub fn clear_client_info(&mut self) { @@ -357,6 +407,14 @@ impl ClientResponseEncrypted { pub fn get_client_info(&self) -> &ClientInfo { self.client_info.as_ref().unwrap_or_else(|| ClientInfo::default_instance()) } + + fn get_client_info_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.client_info + } + + fn mut_client_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.client_info + } } impl ::protobuf::Message for ClientResponseEncrypted { @@ -371,42 +429,42 @@ impl ::protobuf::Message for ClientResponseEncrypted { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_credentials)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_credentials)?; }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.account_creation = ::std::option::Option::Some(tmp); }, 30 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fingerprint_response)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fingerprint_response)?; }, 40 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.peer_ticket)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.peer_ticket)?; }, 50 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.system_info)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.system_info)?; }, 60 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.platform_model)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.platform_model)?; }, 70 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.version_string)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.version_string)?; }, 80 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.appkey)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.appkey)?; }, 90 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.client_info)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.client_info)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -417,37 +475,37 @@ impl ::protobuf::Message for ClientResponseEncrypted { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.login_credentials { - let len = value.compute_size(); + if let Some(v) = self.login_credentials.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.account_creation { - my_size += ::protobuf::rt::enum_size(20, *value); + if let Some(v) = self.account_creation { + my_size += ::protobuf::rt::enum_size(20, v); }; - for value in &self.fingerprint_response { - let len = value.compute_size(); + if let Some(v) = self.fingerprint_response.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.peer_ticket { - let len = value.compute_size(); + if let Some(v) = self.peer_ticket.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.system_info { - let len = value.compute_size(); + if let Some(v) = self.system_info.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.platform_model { - my_size += ::protobuf::rt::string_size(60, &value); + if let Some(v) = self.platform_model.as_ref() { + my_size += ::protobuf::rt::string_size(60, &v); }; - for value in &self.version_string { - my_size += ::protobuf::rt::string_size(70, &value); + if let Some(v) = self.version_string.as_ref() { + my_size += ::protobuf::rt::string_size(70, &v); }; - for value in &self.appkey { - let len = value.compute_size(); + if let Some(v) = self.appkey.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.client_info { - let len = value.compute_size(); + if let Some(v) = self.client_info.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -457,45 +515,45 @@ impl ::protobuf::Message for ClientResponseEncrypted { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.login_credentials.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.account_creation { - try!(os.write_enum(20, v.value())); + os.write_enum(20, v.value())?; }; if let Some(v) = self.fingerprint_response.as_ref() { - try!(os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.peer_ticket.as_ref() { - try!(os.write_tag(40, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(40, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.system_info.as_ref() { - try!(os.write_tag(50, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(50, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.platform_model.as_ref() { - try!(os.write_string(60, &v)); + os.write_string(60, &v)?; }; if let Some(v) = self.version_string.as_ref() { - try!(os.write_string(70, &v)); + os.write_string(70, &v)?; }; if let Some(v) = self.appkey.as_ref() { - try!(os.write_tag(80, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(80, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.client_info.as_ref() { - try!(os.write_tag(90, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(90, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -511,10 +569,6 @@ impl ::protobuf::Message for ClientResponseEncrypted { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -537,50 +591,50 @@ impl ::protobuf::MessageStatic for ClientResponseEncrypted { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_credentials", - ClientResponseEncrypted::has_login_credentials, - ClientResponseEncrypted::get_login_credentials, + ClientResponseEncrypted::get_login_credentials_for_reflect, + ClientResponseEncrypted::mut_login_credentials_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "account_creation", - ClientResponseEncrypted::has_account_creation, - ClientResponseEncrypted::get_account_creation, + ClientResponseEncrypted::get_account_creation_for_reflect, + ClientResponseEncrypted::mut_account_creation_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fingerprint_response", - ClientResponseEncrypted::has_fingerprint_response, - ClientResponseEncrypted::get_fingerprint_response, + ClientResponseEncrypted::get_fingerprint_response_for_reflect, + ClientResponseEncrypted::mut_fingerprint_response_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "peer_ticket", - ClientResponseEncrypted::has_peer_ticket, - ClientResponseEncrypted::get_peer_ticket, + ClientResponseEncrypted::get_peer_ticket_for_reflect, + ClientResponseEncrypted::mut_peer_ticket_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "system_info", - ClientResponseEncrypted::has_system_info, - ClientResponseEncrypted::get_system_info, + ClientResponseEncrypted::get_system_info_for_reflect, + ClientResponseEncrypted::mut_system_info_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "platform_model", - ClientResponseEncrypted::has_platform_model, - ClientResponseEncrypted::get_platform_model, + ClientResponseEncrypted::get_platform_model_for_reflect, + ClientResponseEncrypted::mut_platform_model_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "version_string", - ClientResponseEncrypted::has_version_string, - ClientResponseEncrypted::get_version_string, + ClientResponseEncrypted::get_version_string_for_reflect, + ClientResponseEncrypted::mut_version_string_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "appkey", - ClientResponseEncrypted::has_appkey, - ClientResponseEncrypted::get_appkey, + ClientResponseEncrypted::get_appkey_for_reflect, + ClientResponseEncrypted::mut_appkey_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "client_info", - ClientResponseEncrypted::has_client_info, - ClientResponseEncrypted::get_client_info, + ClientResponseEncrypted::get_client_info_for_reflect, + ClientResponseEncrypted::mut_client_info_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientResponseEncrypted", @@ -607,28 +661,19 @@ impl ::protobuf::Clear for ClientResponseEncrypted { } } -impl ::std::cmp::PartialEq for ClientResponseEncrypted { - fn eq(&self, other: &ClientResponseEncrypted) -> bool { - self.login_credentials == other.login_credentials && - self.account_creation == other.account_creation && - self.fingerprint_response == other.fingerprint_response && - self.peer_ticket == other.peer_ticket && - self.system_info == other.system_info && - self.platform_model == other.platform_model && - self.version_string == other.version_string && - self.appkey == other.appkey && - self.client_info == other.client_info && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ClientResponseEncrypted { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ClientResponseEncrypted { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LoginCredentials { // message fields username: ::protobuf::SingularField<::std::string::String>, @@ -636,7 +681,7 @@ pub struct LoginCredentials { auth_data: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -653,15 +698,7 @@ impl LoginCredentials { ptr: 0 as *const LoginCredentials, }; unsafe { - instance.get(|| { - LoginCredentials { - username: ::protobuf::SingularField::none(), - typ: ::std::option::Option::None, - auth_data: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LoginCredentials::new) } } @@ -701,6 +738,14 @@ impl LoginCredentials { } } + fn get_username_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.username + } + + fn mut_username_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.username + } + // required .AuthenticationType typ = 20; pub fn clear_typ(&mut self) { @@ -720,6 +765,14 @@ impl LoginCredentials { self.typ.unwrap_or(AuthenticationType::AUTHENTICATION_USER_PASS) } + fn get_typ_for_reflect(&self) -> &::std::option::Option { + &self.typ + } + + fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.typ + } + // optional bytes auth_data = 30; pub fn clear_auth_data(&mut self) { @@ -755,6 +808,14 @@ impl LoginCredentials { None => &[], } } + + fn get_auth_data_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.auth_data + } + + fn mut_auth_data_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.auth_data + } } impl ::protobuf::Message for LoginCredentials { @@ -766,24 +827,24 @@ impl ::protobuf::Message for LoginCredentials { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.username)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.username)?; }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.typ = ::std::option::Option::Some(tmp); }, 30 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.auth_data)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.auth_data)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -794,14 +855,14 @@ impl ::protobuf::Message for LoginCredentials { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.username { - my_size += ::protobuf::rt::string_size(10, &value); + if let Some(v) = self.username.as_ref() { + my_size += ::protobuf::rt::string_size(10, &v); }; - for value in &self.typ { - my_size += ::protobuf::rt::enum_size(20, *value); + if let Some(v) = self.typ { + my_size += ::protobuf::rt::enum_size(20, v); }; - for value in &self.auth_data { - my_size += ::protobuf::rt::bytes_size(30, &value); + if let Some(v) = self.auth_data.as_ref() { + my_size += ::protobuf::rt::bytes_size(30, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -810,15 +871,15 @@ impl ::protobuf::Message for LoginCredentials { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.username.as_ref() { - try!(os.write_string(10, &v)); + os.write_string(10, &v)?; }; if let Some(v) = self.typ { - try!(os.write_enum(20, v.value())); + os.write_enum(20, v.value())?; }; if let Some(v) = self.auth_data.as_ref() { - try!(os.write_bytes(30, &v)); + os.write_bytes(30, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -834,10 +895,6 @@ impl ::protobuf::Message for LoginCredentials { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -860,20 +917,20 @@ impl ::protobuf::MessageStatic for LoginCredentials { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "username", - LoginCredentials::has_username, - LoginCredentials::get_username, + LoginCredentials::get_username_for_reflect, + LoginCredentials::mut_username_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - LoginCredentials::has_typ, - LoginCredentials::get_typ, + LoginCredentials::get_typ_for_reflect, + LoginCredentials::mut_typ_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "auth_data", - LoginCredentials::has_auth_data, - LoginCredentials::get_auth_data, + LoginCredentials::get_auth_data_for_reflect, + LoginCredentials::mut_auth_data_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCredentials", @@ -894,29 +951,26 @@ impl ::protobuf::Clear for LoginCredentials { } } -impl ::std::cmp::PartialEq for LoginCredentials { - fn eq(&self, other: &LoginCredentials) -> bool { - self.username == other.username && - self.typ == other.typ && - self.auth_data == other.auth_data && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LoginCredentials { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LoginCredentials { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct FingerprintResponseUnion { // message fields grain: ::protobuf::SingularPtrField, hmac_ripemd: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -933,14 +987,7 @@ impl FingerprintResponseUnion { ptr: 0 as *const FingerprintResponseUnion, }; unsafe { - instance.get(|| { - FingerprintResponseUnion { - grain: ::protobuf::SingularPtrField::none(), - hmac_ripemd: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(FingerprintResponseUnion::new) } } @@ -977,6 +1024,14 @@ impl FingerprintResponseUnion { self.grain.as_ref().unwrap_or_else(|| FingerprintGrainResponse::default_instance()) } + fn get_grain_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.grain + } + + fn mut_grain_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.grain + } + // optional .FingerprintHmacRipemdResponse hmac_ripemd = 20; pub fn clear_hmac_ripemd(&mut self) { @@ -1009,6 +1064,14 @@ impl FingerprintResponseUnion { pub fn get_hmac_ripemd(&self) -> &FingerprintHmacRipemdResponse { self.hmac_ripemd.as_ref().unwrap_or_else(|| FingerprintHmacRipemdResponse::default_instance()) } + + fn get_hmac_ripemd_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.hmac_ripemd + } + + fn mut_hmac_ripemd_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.hmac_ripemd + } } impl ::protobuf::Message for FingerprintResponseUnion { @@ -1017,17 +1080,17 @@ impl ::protobuf::Message for FingerprintResponseUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.grain)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.grain)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hmac_ripemd)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hmac_ripemd)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1038,12 +1101,12 @@ impl ::protobuf::Message for FingerprintResponseUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.grain { - let len = value.compute_size(); + if let Some(v) = self.grain.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.hmac_ripemd { - let len = value.compute_size(); + if let Some(v) = self.hmac_ripemd.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -1053,16 +1116,16 @@ impl ::protobuf::Message for FingerprintResponseUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.grain.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.hmac_ripemd.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1078,10 +1141,6 @@ impl ::protobuf::Message for FingerprintResponseUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1104,15 +1163,15 @@ impl ::protobuf::MessageStatic for FingerprintResponseUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "grain", - FingerprintResponseUnion::has_grain, - FingerprintResponseUnion::get_grain, + FingerprintResponseUnion::get_grain_for_reflect, + FingerprintResponseUnion::mut_grain_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hmac_ripemd", - FingerprintResponseUnion::has_hmac_ripemd, - FingerprintResponseUnion::get_hmac_ripemd, + FingerprintResponseUnion::get_hmac_ripemd_for_reflect, + FingerprintResponseUnion::mut_hmac_ripemd_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintResponseUnion", @@ -1132,27 +1191,25 @@ impl ::protobuf::Clear for FingerprintResponseUnion { } } -impl ::std::cmp::PartialEq for FingerprintResponseUnion { - fn eq(&self, other: &FingerprintResponseUnion) -> bool { - self.grain == other.grain && - self.hmac_ripemd == other.hmac_ripemd && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for FingerprintResponseUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for FingerprintResponseUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct FingerprintGrainResponse { // message fields encrypted_key: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1169,13 +1226,7 @@ impl FingerprintGrainResponse { ptr: 0 as *const FingerprintGrainResponse, }; unsafe { - instance.get(|| { - FingerprintGrainResponse { - encrypted_key: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(FingerprintGrainResponse::new) } } @@ -1214,6 +1265,14 @@ impl FingerprintGrainResponse { None => &[], } } + + fn get_encrypted_key_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.encrypted_key + } + + fn mut_encrypted_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.encrypted_key + } } impl ::protobuf::Message for FingerprintGrainResponse { @@ -1225,14 +1284,14 @@ impl ::protobuf::Message for FingerprintGrainResponse { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.encrypted_key)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.encrypted_key)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1243,8 +1302,8 @@ impl ::protobuf::Message for FingerprintGrainResponse { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.encrypted_key { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.encrypted_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -1253,9 +1312,9 @@ impl ::protobuf::Message for FingerprintGrainResponse { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.encrypted_key.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1271,10 +1330,6 @@ impl ::protobuf::Message for FingerprintGrainResponse { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1297,10 +1352,10 @@ impl ::protobuf::MessageStatic for FingerprintGrainResponse { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "encrypted_key", - FingerprintGrainResponse::has_encrypted_key, - FingerprintGrainResponse::get_encrypted_key, + FingerprintGrainResponse::get_encrypted_key_for_reflect, + FingerprintGrainResponse::mut_encrypted_key_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintGrainResponse", @@ -1319,26 +1374,25 @@ impl ::protobuf::Clear for FingerprintGrainResponse { } } -impl ::std::cmp::PartialEq for FingerprintGrainResponse { - fn eq(&self, other: &FingerprintGrainResponse) -> bool { - self.encrypted_key == other.encrypted_key && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for FingerprintGrainResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for FingerprintGrainResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct FingerprintHmacRipemdResponse { // message fields hmac: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1355,13 +1409,7 @@ impl FingerprintHmacRipemdResponse { ptr: 0 as *const FingerprintHmacRipemdResponse, }; unsafe { - instance.get(|| { - FingerprintHmacRipemdResponse { - hmac: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(FingerprintHmacRipemdResponse::new) } } @@ -1400,6 +1448,14 @@ impl FingerprintHmacRipemdResponse { None => &[], } } + + fn get_hmac_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.hmac + } + + fn mut_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.hmac + } } impl ::protobuf::Message for FingerprintHmacRipemdResponse { @@ -1411,14 +1467,14 @@ impl ::protobuf::Message for FingerprintHmacRipemdResponse { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hmac)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hmac)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1429,8 +1485,8 @@ impl ::protobuf::Message for FingerprintHmacRipemdResponse { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.hmac { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -1439,9 +1495,9 @@ impl ::protobuf::Message for FingerprintHmacRipemdResponse { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.hmac.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1457,10 +1513,6 @@ impl ::protobuf::Message for FingerprintHmacRipemdResponse { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1483,10 +1535,10 @@ impl ::protobuf::MessageStatic for FingerprintHmacRipemdResponse { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "hmac", - FingerprintHmacRipemdResponse::has_hmac, - FingerprintHmacRipemdResponse::get_hmac, + FingerprintHmacRipemdResponse::get_hmac_for_reflect, + FingerprintHmacRipemdResponse::mut_hmac_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintHmacRipemdResponse", @@ -1505,27 +1557,26 @@ impl ::protobuf::Clear for FingerprintHmacRipemdResponse { } } -impl ::std::cmp::PartialEq for FingerprintHmacRipemdResponse { - fn eq(&self, other: &FingerprintHmacRipemdResponse) -> bool { - self.hmac == other.hmac && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for FingerprintHmacRipemdResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for FingerprintHmacRipemdResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct PeerTicketUnion { // message fields public_key: ::protobuf::SingularPtrField, old_ticket: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1542,14 +1593,7 @@ impl PeerTicketUnion { ptr: 0 as *const PeerTicketUnion, }; unsafe { - instance.get(|| { - PeerTicketUnion { - public_key: ::protobuf::SingularPtrField::none(), - old_ticket: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(PeerTicketUnion::new) } } @@ -1586,6 +1630,14 @@ impl PeerTicketUnion { self.public_key.as_ref().unwrap_or_else(|| PeerTicketPublicKey::default_instance()) } + fn get_public_key_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.public_key + } + + fn mut_public_key_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.public_key + } + // optional .PeerTicketOld old_ticket = 20; pub fn clear_old_ticket(&mut self) { @@ -1618,6 +1670,14 @@ impl PeerTicketUnion { pub fn get_old_ticket(&self) -> &PeerTicketOld { self.old_ticket.as_ref().unwrap_or_else(|| PeerTicketOld::default_instance()) } + + fn get_old_ticket_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.old_ticket + } + + fn mut_old_ticket_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.old_ticket + } } impl ::protobuf::Message for PeerTicketUnion { @@ -1626,17 +1686,17 @@ impl ::protobuf::Message for PeerTicketUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.public_key)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.public_key)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.old_ticket)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.old_ticket)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1647,12 +1707,12 @@ impl ::protobuf::Message for PeerTicketUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.public_key { - let len = value.compute_size(); + if let Some(v) = self.public_key.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.old_ticket { - let len = value.compute_size(); + if let Some(v) = self.old_ticket.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -1662,16 +1722,16 @@ impl ::protobuf::Message for PeerTicketUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.public_key.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.old_ticket.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1687,10 +1747,6 @@ impl ::protobuf::Message for PeerTicketUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1713,15 +1769,15 @@ impl ::protobuf::MessageStatic for PeerTicketUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "public_key", - PeerTicketUnion::has_public_key, - PeerTicketUnion::get_public_key, + PeerTicketUnion::get_public_key_for_reflect, + PeerTicketUnion::mut_public_key_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "old_ticket", - PeerTicketUnion::has_old_ticket, - PeerTicketUnion::get_old_ticket, + PeerTicketUnion::get_old_ticket_for_reflect, + PeerTicketUnion::mut_old_ticket_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "PeerTicketUnion", @@ -1741,27 +1797,25 @@ impl ::protobuf::Clear for PeerTicketUnion { } } -impl ::std::cmp::PartialEq for PeerTicketUnion { - fn eq(&self, other: &PeerTicketUnion) -> bool { - self.public_key == other.public_key && - self.old_ticket == other.old_ticket && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for PeerTicketUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for PeerTicketUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct PeerTicketPublicKey { // message fields public_key: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1778,13 +1832,7 @@ impl PeerTicketPublicKey { ptr: 0 as *const PeerTicketPublicKey, }; unsafe { - instance.get(|| { - PeerTicketPublicKey { - public_key: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(PeerTicketPublicKey::new) } } @@ -1823,6 +1871,14 @@ impl PeerTicketPublicKey { None => &[], } } + + fn get_public_key_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.public_key + } + + fn mut_public_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.public_key + } } impl ::protobuf::Message for PeerTicketPublicKey { @@ -1834,14 +1890,14 @@ impl ::protobuf::Message for PeerTicketPublicKey { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.public_key)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.public_key)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1852,8 +1908,8 @@ impl ::protobuf::Message for PeerTicketPublicKey { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.public_key { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.public_key.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -1862,9 +1918,9 @@ impl ::protobuf::Message for PeerTicketPublicKey { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.public_key.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1880,10 +1936,6 @@ impl ::protobuf::Message for PeerTicketPublicKey { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1906,10 +1958,10 @@ impl ::protobuf::MessageStatic for PeerTicketPublicKey { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "public_key", - PeerTicketPublicKey::has_public_key, - PeerTicketPublicKey::get_public_key, + PeerTicketPublicKey::get_public_key_for_reflect, + PeerTicketPublicKey::mut_public_key_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "PeerTicketPublicKey", @@ -1928,27 +1980,26 @@ impl ::protobuf::Clear for PeerTicketPublicKey { } } -impl ::std::cmp::PartialEq for PeerTicketPublicKey { - fn eq(&self, other: &PeerTicketPublicKey) -> bool { - self.public_key == other.public_key && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for PeerTicketPublicKey { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for PeerTicketPublicKey { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct PeerTicketOld { // message fields peer_ticket: ::protobuf::SingularField<::std::vec::Vec>, peer_ticket_signature: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1965,14 +2016,7 @@ impl PeerTicketOld { ptr: 0 as *const PeerTicketOld, }; unsafe { - instance.get(|| { - PeerTicketOld { - peer_ticket: ::protobuf::SingularField::none(), - peer_ticket_signature: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(PeerTicketOld::new) } } @@ -2012,6 +2056,14 @@ impl PeerTicketOld { } } + fn get_peer_ticket_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.peer_ticket + } + + fn mut_peer_ticket_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.peer_ticket + } + // required bytes peer_ticket_signature = 20; pub fn clear_peer_ticket_signature(&mut self) { @@ -2047,6 +2099,14 @@ impl PeerTicketOld { None => &[], } } + + fn get_peer_ticket_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.peer_ticket_signature + } + + fn mut_peer_ticket_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.peer_ticket_signature + } } impl ::protobuf::Message for PeerTicketOld { @@ -2061,17 +2121,17 @@ impl ::protobuf::Message for PeerTicketOld { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.peer_ticket)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.peer_ticket)?; }, 20 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.peer_ticket_signature)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.peer_ticket_signature)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2082,11 +2142,11 @@ impl ::protobuf::Message for PeerTicketOld { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.peer_ticket { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.peer_ticket.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; - for value in &self.peer_ticket_signature { - my_size += ::protobuf::rt::bytes_size(20, &value); + if let Some(v) = self.peer_ticket_signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(20, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -2095,12 +2155,12 @@ impl ::protobuf::Message for PeerTicketOld { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.peer_ticket.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; if let Some(v) = self.peer_ticket_signature.as_ref() { - try!(os.write_bytes(20, &v)); + os.write_bytes(20, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2116,10 +2176,6 @@ impl ::protobuf::Message for PeerTicketOld { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2142,15 +2198,15 @@ impl ::protobuf::MessageStatic for PeerTicketOld { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "peer_ticket", - PeerTicketOld::has_peer_ticket, - PeerTicketOld::get_peer_ticket, + PeerTicketOld::get_peer_ticket_for_reflect, + PeerTicketOld::mut_peer_ticket_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "peer_ticket_signature", - PeerTicketOld::has_peer_ticket_signature, - PeerTicketOld::get_peer_ticket_signature, + PeerTicketOld::get_peer_ticket_signature_for_reflect, + PeerTicketOld::mut_peer_ticket_signature_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "PeerTicketOld", @@ -2170,21 +2226,19 @@ impl ::protobuf::Clear for PeerTicketOld { } } -impl ::std::cmp::PartialEq for PeerTicketOld { - fn eq(&self, other: &PeerTicketOld) -> bool { - self.peer_ticket == other.peer_ticket && - self.peer_ticket_signature == other.peer_ticket_signature && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for PeerTicketOld { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for PeerTicketOld { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct SystemInfo { // message fields cpu_family: ::std::option::Option, @@ -2199,7 +2253,7 @@ pub struct SystemInfo { device_id: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2216,22 +2270,7 @@ impl SystemInfo { ptr: 0 as *const SystemInfo, }; unsafe { - instance.get(|| { - SystemInfo { - cpu_family: ::std::option::Option::None, - cpu_subtype: ::std::option::Option::None, - cpu_ext: ::std::option::Option::None, - brand: ::std::option::Option::None, - brand_flags: ::std::option::Option::None, - os: ::std::option::Option::None, - os_version: ::std::option::Option::None, - os_ext: ::std::option::Option::None, - system_information_string: ::protobuf::SingularField::none(), - device_id: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(SystemInfo::new) } } @@ -2254,6 +2293,14 @@ impl SystemInfo { self.cpu_family.unwrap_or(CpuFamily::CPU_UNKNOWN) } + fn get_cpu_family_for_reflect(&self) -> &::std::option::Option { + &self.cpu_family + } + + fn mut_cpu_family_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.cpu_family + } + // optional uint32 cpu_subtype = 20; pub fn clear_cpu_subtype(&mut self) { @@ -2273,6 +2320,14 @@ impl SystemInfo { self.cpu_subtype.unwrap_or(0) } + fn get_cpu_subtype_for_reflect(&self) -> &::std::option::Option { + &self.cpu_subtype + } + + fn mut_cpu_subtype_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.cpu_subtype + } + // optional uint32 cpu_ext = 30; pub fn clear_cpu_ext(&mut self) { @@ -2292,6 +2347,14 @@ impl SystemInfo { self.cpu_ext.unwrap_or(0) } + fn get_cpu_ext_for_reflect(&self) -> &::std::option::Option { + &self.cpu_ext + } + + fn mut_cpu_ext_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.cpu_ext + } + // optional .Brand brand = 40; pub fn clear_brand(&mut self) { @@ -2311,6 +2374,14 @@ impl SystemInfo { self.brand.unwrap_or(Brand::BRAND_UNBRANDED) } + fn get_brand_for_reflect(&self) -> &::std::option::Option { + &self.brand + } + + fn mut_brand_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.brand + } + // optional uint32 brand_flags = 50; pub fn clear_brand_flags(&mut self) { @@ -2330,6 +2401,14 @@ impl SystemInfo { self.brand_flags.unwrap_or(0) } + fn get_brand_flags_for_reflect(&self) -> &::std::option::Option { + &self.brand_flags + } + + fn mut_brand_flags_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.brand_flags + } + // required .Os os = 60; pub fn clear_os(&mut self) { @@ -2349,6 +2428,14 @@ impl SystemInfo { self.os.unwrap_or(Os::OS_UNKNOWN) } + fn get_os_for_reflect(&self) -> &::std::option::Option { + &self.os + } + + fn mut_os_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.os + } + // optional uint32 os_version = 70; pub fn clear_os_version(&mut self) { @@ -2368,6 +2455,14 @@ impl SystemInfo { self.os_version.unwrap_or(0) } + fn get_os_version_for_reflect(&self) -> &::std::option::Option { + &self.os_version + } + + fn mut_os_version_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.os_version + } + // optional uint32 os_ext = 80; pub fn clear_os_ext(&mut self) { @@ -2387,6 +2482,14 @@ impl SystemInfo { self.os_ext.unwrap_or(0) } + fn get_os_ext_for_reflect(&self) -> &::std::option::Option { + &self.os_ext + } + + fn mut_os_ext_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.os_ext + } + // optional string system_information_string = 90; pub fn clear_system_information_string(&mut self) { @@ -2423,6 +2526,14 @@ impl SystemInfo { } } + fn get_system_information_string_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.system_information_string + } + + fn mut_system_information_string_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.system_information_string + } + // optional string device_id = 100; pub fn clear_device_id(&mut self) { @@ -2458,6 +2569,14 @@ impl SystemInfo { None => "", } } + + fn get_device_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.device_id + } + + fn mut_device_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.device_id + } } impl ::protobuf::Message for SystemInfo { @@ -2472,73 +2591,73 @@ impl ::protobuf::Message for SystemInfo { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.cpu_family = ::std::option::Option::Some(tmp); }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.cpu_subtype = ::std::option::Option::Some(tmp); }, 30 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.cpu_ext = ::std::option::Option::Some(tmp); }, 40 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.brand = ::std::option::Option::Some(tmp); }, 50 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.brand_flags = ::std::option::Option::Some(tmp); }, 60 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.os = ::std::option::Option::Some(tmp); }, 70 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.os_version = ::std::option::Option::Some(tmp); }, 80 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.os_ext = ::std::option::Option::Some(tmp); }, 90 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.system_information_string)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.system_information_string)?; }, 100 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.device_id)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.device_id)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2549,35 +2668,35 @@ impl ::protobuf::Message for SystemInfo { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.cpu_family { - my_size += ::protobuf::rt::enum_size(10, *value); + if let Some(v) = self.cpu_family { + my_size += ::protobuf::rt::enum_size(10, v); }; - for value in &self.cpu_subtype { - my_size += ::protobuf::rt::value_size(20, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.cpu_subtype { + my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.cpu_ext { - my_size += ::protobuf::rt::value_size(30, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.cpu_ext { + my_size += ::protobuf::rt::value_size(30, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.brand { - my_size += ::protobuf::rt::enum_size(40, *value); + if let Some(v) = self.brand { + my_size += ::protobuf::rt::enum_size(40, v); }; - for value in &self.brand_flags { - my_size += ::protobuf::rt::value_size(50, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.brand_flags { + my_size += ::protobuf::rt::value_size(50, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.os { - my_size += ::protobuf::rt::enum_size(60, *value); + if let Some(v) = self.os { + my_size += ::protobuf::rt::enum_size(60, v); }; - for value in &self.os_version { - my_size += ::protobuf::rt::value_size(70, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.os_version { + my_size += ::protobuf::rt::value_size(70, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.os_ext { - my_size += ::protobuf::rt::value_size(80, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.os_ext { + my_size += ::protobuf::rt::value_size(80, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.system_information_string { - my_size += ::protobuf::rt::string_size(90, &value); + if let Some(v) = self.system_information_string.as_ref() { + my_size += ::protobuf::rt::string_size(90, &v); }; - for value in &self.device_id { - my_size += ::protobuf::rt::string_size(100, &value); + if let Some(v) = self.device_id.as_ref() { + my_size += ::protobuf::rt::string_size(100, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -2586,36 +2705,36 @@ impl ::protobuf::Message for SystemInfo { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.cpu_family { - try!(os.write_enum(10, v.value())); + os.write_enum(10, v.value())?; }; if let Some(v) = self.cpu_subtype { - try!(os.write_uint32(20, v)); + os.write_uint32(20, v)?; }; if let Some(v) = self.cpu_ext { - try!(os.write_uint32(30, v)); + os.write_uint32(30, v)?; }; if let Some(v) = self.brand { - try!(os.write_enum(40, v.value())); + os.write_enum(40, v.value())?; }; if let Some(v) = self.brand_flags { - try!(os.write_uint32(50, v)); + os.write_uint32(50, v)?; }; if let Some(v) = self.os { - try!(os.write_enum(60, v.value())); + os.write_enum(60, v.value())?; }; if let Some(v) = self.os_version { - try!(os.write_uint32(70, v)); + os.write_uint32(70, v)?; }; if let Some(v) = self.os_ext { - try!(os.write_uint32(80, v)); + os.write_uint32(80, v)?; }; if let Some(v) = self.system_information_string.as_ref() { - try!(os.write_string(90, &v)); + os.write_string(90, &v)?; }; if let Some(v) = self.device_id.as_ref() { - try!(os.write_string(100, &v)); + os.write_string(100, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2631,10 +2750,6 @@ impl ::protobuf::Message for SystemInfo { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2657,55 +2772,55 @@ impl ::protobuf::MessageStatic for SystemInfo { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "cpu_family", - SystemInfo::has_cpu_family, - SystemInfo::get_cpu_family, + SystemInfo::get_cpu_family_for_reflect, + SystemInfo::mut_cpu_family_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "cpu_subtype", - SystemInfo::has_cpu_subtype, - SystemInfo::get_cpu_subtype, + SystemInfo::get_cpu_subtype_for_reflect, + SystemInfo::mut_cpu_subtype_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "cpu_ext", - SystemInfo::has_cpu_ext, - SystemInfo::get_cpu_ext, + SystemInfo::get_cpu_ext_for_reflect, + SystemInfo::mut_cpu_ext_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "brand", - SystemInfo::has_brand, - SystemInfo::get_brand, + SystemInfo::get_brand_for_reflect, + SystemInfo::mut_brand_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "brand_flags", - SystemInfo::has_brand_flags, - SystemInfo::get_brand_flags, + SystemInfo::get_brand_flags_for_reflect, + SystemInfo::mut_brand_flags_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "os", - SystemInfo::has_os, - SystemInfo::get_os, + SystemInfo::get_os_for_reflect, + SystemInfo::mut_os_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "os_version", - SystemInfo::has_os_version, - SystemInfo::get_os_version, + SystemInfo::get_os_version_for_reflect, + SystemInfo::mut_os_version_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "os_ext", - SystemInfo::has_os_ext, - SystemInfo::get_os_ext, + SystemInfo::get_os_ext_for_reflect, + SystemInfo::mut_os_ext_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "system_information_string", - SystemInfo::has_system_information_string, - SystemInfo::get_system_information_string, + SystemInfo::get_system_information_string_for_reflect, + SystemInfo::mut_system_information_string_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "device_id", - SystemInfo::has_device_id, - SystemInfo::get_device_id, + SystemInfo::get_device_id_for_reflect, + SystemInfo::mut_device_id_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "SystemInfo", @@ -2733,29 +2848,19 @@ impl ::protobuf::Clear for SystemInfo { } } -impl ::std::cmp::PartialEq for SystemInfo { - fn eq(&self, other: &SystemInfo) -> bool { - self.cpu_family == other.cpu_family && - self.cpu_subtype == other.cpu_subtype && - self.cpu_ext == other.cpu_ext && - self.brand == other.brand && - self.brand_flags == other.brand_flags && - self.os == other.os && - self.os_version == other.os_version && - self.os_ext == other.os_ext && - self.system_information_string == other.system_information_string && - self.device_id == other.device_id && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for SystemInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for SystemInfo { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LibspotifyAppKey { // message fields version: ::std::option::Option, @@ -2765,7 +2870,7 @@ pub struct LibspotifyAppKey { callback_hash: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2782,17 +2887,7 @@ impl LibspotifyAppKey { ptr: 0 as *const LibspotifyAppKey, }; unsafe { - instance.get(|| { - LibspotifyAppKey { - version: ::std::option::Option::None, - devkey: ::protobuf::SingularField::none(), - signature: ::protobuf::SingularField::none(), - useragent: ::protobuf::SingularField::none(), - callback_hash: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LibspotifyAppKey::new) } } @@ -2815,6 +2910,14 @@ impl LibspotifyAppKey { self.version.unwrap_or(0) } + fn get_version_for_reflect(&self) -> &::std::option::Option { + &self.version + } + + fn mut_version_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.version + } + // required bytes devkey = 2; pub fn clear_devkey(&mut self) { @@ -2851,6 +2954,14 @@ impl LibspotifyAppKey { } } + fn get_devkey_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.devkey + } + + fn mut_devkey_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.devkey + } + // required bytes signature = 3; pub fn clear_signature(&mut self) { @@ -2887,6 +2998,14 @@ impl LibspotifyAppKey { } } + fn get_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.signature + } + + fn mut_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.signature + } + // required string useragent = 4; pub fn clear_useragent(&mut self) { @@ -2923,6 +3042,14 @@ impl LibspotifyAppKey { } } + fn get_useragent_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.useragent + } + + fn mut_useragent_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.useragent + } + // required bytes callback_hash = 5; pub fn clear_callback_hash(&mut self) { @@ -2958,6 +3085,14 @@ impl LibspotifyAppKey { None => &[], } } + + fn get_callback_hash_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.callback_hash + } + + fn mut_callback_hash_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.callback_hash + } } impl ::protobuf::Message for LibspotifyAppKey { @@ -2981,30 +3116,30 @@ impl ::protobuf::Message for LibspotifyAppKey { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.version = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.devkey)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.devkey)?; }, 3 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?; }, 4 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.useragent)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.useragent)?; }, 5 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.callback_hash)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.callback_hash)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3015,20 +3150,20 @@ impl ::protobuf::Message for LibspotifyAppKey { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.version { - my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.version { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.devkey { - my_size += ::protobuf::rt::bytes_size(2, &value); + if let Some(v) = self.devkey.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); }; - for value in &self.signature { - my_size += ::protobuf::rt::bytes_size(3, &value); + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); }; - for value in &self.useragent { - my_size += ::protobuf::rt::string_size(4, &value); + if let Some(v) = self.useragent.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); }; - for value in &self.callback_hash { - my_size += ::protobuf::rt::bytes_size(5, &value); + if let Some(v) = self.callback_hash.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3037,21 +3172,21 @@ impl ::protobuf::Message for LibspotifyAppKey { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.version { - try!(os.write_uint32(1, v)); + os.write_uint32(1, v)?; }; if let Some(v) = self.devkey.as_ref() { - try!(os.write_bytes(2, &v)); + os.write_bytes(2, &v)?; }; if let Some(v) = self.signature.as_ref() { - try!(os.write_bytes(3, &v)); + os.write_bytes(3, &v)?; }; if let Some(v) = self.useragent.as_ref() { - try!(os.write_string(4, &v)); + os.write_string(4, &v)?; }; if let Some(v) = self.callback_hash.as_ref() { - try!(os.write_bytes(5, &v)); + os.write_bytes(5, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3067,10 +3202,6 @@ impl ::protobuf::Message for LibspotifyAppKey { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3093,30 +3224,30 @@ impl ::protobuf::MessageStatic for LibspotifyAppKey { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "version", - LibspotifyAppKey::has_version, - LibspotifyAppKey::get_version, + LibspotifyAppKey::get_version_for_reflect, + LibspotifyAppKey::mut_version_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "devkey", - LibspotifyAppKey::has_devkey, - LibspotifyAppKey::get_devkey, + LibspotifyAppKey::get_devkey_for_reflect, + LibspotifyAppKey::mut_devkey_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "signature", - LibspotifyAppKey::has_signature, - LibspotifyAppKey::get_signature, + LibspotifyAppKey::get_signature_for_reflect, + LibspotifyAppKey::mut_signature_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "useragent", - LibspotifyAppKey::has_useragent, - LibspotifyAppKey::get_useragent, + LibspotifyAppKey::get_useragent_for_reflect, + LibspotifyAppKey::mut_useragent_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "callback_hash", - LibspotifyAppKey::has_callback_hash, - LibspotifyAppKey::get_callback_hash, + LibspotifyAppKey::get_callback_hash_for_reflect, + LibspotifyAppKey::mut_callback_hash_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LibspotifyAppKey", @@ -3139,24 +3270,19 @@ impl ::protobuf::Clear for LibspotifyAppKey { } } -impl ::std::cmp::PartialEq for LibspotifyAppKey { - fn eq(&self, other: &LibspotifyAppKey) -> bool { - self.version == other.version && - self.devkey == other.devkey && - self.signature == other.signature && - self.useragent == other.useragent && - self.callback_hash == other.callback_hash && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LibspotifyAppKey { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LibspotifyAppKey { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct ClientInfo { // message fields limited: ::std::option::Option, @@ -3164,7 +3290,7 @@ pub struct ClientInfo { language: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3181,15 +3307,7 @@ impl ClientInfo { ptr: 0 as *const ClientInfo, }; unsafe { - instance.get(|| { - ClientInfo { - limited: ::std::option::Option::None, - fb: ::protobuf::SingularPtrField::none(), - language: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ClientInfo::new) } } @@ -3212,6 +3330,14 @@ impl ClientInfo { self.limited.unwrap_or(false) } + fn get_limited_for_reflect(&self) -> &::std::option::Option { + &self.limited + } + + fn mut_limited_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.limited + } + // optional .ClientInfoFacebook fb = 2; pub fn clear_fb(&mut self) { @@ -3245,6 +3371,14 @@ impl ClientInfo { self.fb.as_ref().unwrap_or_else(|| ClientInfoFacebook::default_instance()) } + fn get_fb_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.fb + } + + fn mut_fb_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.fb + } + // optional string language = 3; pub fn clear_language(&mut self) { @@ -3280,6 +3414,14 @@ impl ClientInfo { None => "", } } + + fn get_language_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.language + } + + fn mut_language_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.language + } } impl ::protobuf::Message for ClientInfo { @@ -3288,24 +3430,24 @@ impl ::protobuf::Message for ClientInfo { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_bool()); + let tmp = is.read_bool()?; self.limited = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fb)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fb)?; }, 3 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3316,15 +3458,15 @@ impl ::protobuf::Message for ClientInfo { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - if self.limited.is_some() { + if let Some(v) = self.limited { my_size += 2; }; - for value in &self.fb { - let len = value.compute_size(); + if let Some(v) = self.fb.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.language { - my_size += ::protobuf::rt::string_size(3, &value); + if let Some(v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3333,17 +3475,17 @@ impl ::protobuf::Message for ClientInfo { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.limited { - try!(os.write_bool(1, v)); + os.write_bool(1, v)?; }; if let Some(v) = self.fb.as_ref() { - try!(os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.language.as_ref() { - try!(os.write_string(3, &v)); + os.write_string(3, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3359,10 +3501,6 @@ impl ::protobuf::Message for ClientInfo { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3385,20 +3523,20 @@ impl ::protobuf::MessageStatic for ClientInfo { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "limited", - ClientInfo::has_limited, - ClientInfo::get_limited, + ClientInfo::get_limited_for_reflect, + ClientInfo::mut_limited_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fb", - ClientInfo::has_fb, - ClientInfo::get_fb, + ClientInfo::get_fb_for_reflect, + ClientInfo::mut_fb_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "language", - ClientInfo::has_language, - ClientInfo::get_language, + ClientInfo::get_language_for_reflect, + ClientInfo::mut_language_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientInfo", @@ -3419,28 +3557,25 @@ impl ::protobuf::Clear for ClientInfo { } } -impl ::std::cmp::PartialEq for ClientInfo { - fn eq(&self, other: &ClientInfo) -> bool { - self.limited == other.limited && - self.fb == other.fb && - self.language == other.language && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ClientInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ClientInfo { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct ClientInfoFacebook { // message fields machine_id: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3457,13 +3592,7 @@ impl ClientInfoFacebook { ptr: 0 as *const ClientInfoFacebook, }; unsafe { - instance.get(|| { - ClientInfoFacebook { - machine_id: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ClientInfoFacebook::new) } } @@ -3502,6 +3631,14 @@ impl ClientInfoFacebook { None => "", } } + + fn get_machine_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.machine_id + } + + fn mut_machine_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.machine_id + } } impl ::protobuf::Message for ClientInfoFacebook { @@ -3510,14 +3647,14 @@ impl ::protobuf::Message for ClientInfoFacebook { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.machine_id)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.machine_id)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3528,8 +3665,8 @@ impl ::protobuf::Message for ClientInfoFacebook { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.machine_id { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.machine_id.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3538,9 +3675,9 @@ impl ::protobuf::Message for ClientInfoFacebook { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.machine_id.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3556,10 +3693,6 @@ impl ::protobuf::Message for ClientInfoFacebook { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3582,10 +3715,10 @@ impl ::protobuf::MessageStatic for ClientInfoFacebook { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "machine_id", - ClientInfoFacebook::has_machine_id, - ClientInfoFacebook::get_machine_id, + ClientInfoFacebook::get_machine_id_for_reflect, + ClientInfoFacebook::mut_machine_id_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientInfoFacebook", @@ -3604,20 +3737,19 @@ impl ::protobuf::Clear for ClientInfoFacebook { } } -impl ::std::cmp::PartialEq for ClientInfoFacebook { - fn eq(&self, other: &ClientInfoFacebook) -> bool { - self.machine_id == other.machine_id && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ClientInfoFacebook { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ClientInfoFacebook { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct APWelcome { // message fields canonical_username: ::protobuf::SingularField<::std::string::String>, @@ -3630,7 +3762,7 @@ pub struct APWelcome { fb: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3647,20 +3779,7 @@ impl APWelcome { ptr: 0 as *const APWelcome, }; unsafe { - instance.get(|| { - APWelcome { - canonical_username: ::protobuf::SingularField::none(), - account_type_logged_in: ::std::option::Option::None, - credentials_type_logged_in: ::std::option::Option::None, - reusable_auth_credentials_type: ::std::option::Option::None, - reusable_auth_credentials: ::protobuf::SingularField::none(), - lfs_secret: ::protobuf::SingularField::none(), - account_info: ::protobuf::SingularPtrField::none(), - fb: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(APWelcome::new) } } @@ -3700,6 +3819,14 @@ impl APWelcome { } } + fn get_canonical_username_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.canonical_username + } + + fn mut_canonical_username_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.canonical_username + } + // required .AccountType account_type_logged_in = 20; pub fn clear_account_type_logged_in(&mut self) { @@ -3719,6 +3846,14 @@ impl APWelcome { self.account_type_logged_in.unwrap_or(AccountType::Spotify) } + fn get_account_type_logged_in_for_reflect(&self) -> &::std::option::Option { + &self.account_type_logged_in + } + + fn mut_account_type_logged_in_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.account_type_logged_in + } + // required .AccountType credentials_type_logged_in = 25; pub fn clear_credentials_type_logged_in(&mut self) { @@ -3738,6 +3873,14 @@ impl APWelcome { self.credentials_type_logged_in.unwrap_or(AccountType::Spotify) } + fn get_credentials_type_logged_in_for_reflect(&self) -> &::std::option::Option { + &self.credentials_type_logged_in + } + + fn mut_credentials_type_logged_in_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.credentials_type_logged_in + } + // required .AuthenticationType reusable_auth_credentials_type = 30; pub fn clear_reusable_auth_credentials_type(&mut self) { @@ -3757,6 +3900,14 @@ impl APWelcome { self.reusable_auth_credentials_type.unwrap_or(AuthenticationType::AUTHENTICATION_USER_PASS) } + fn get_reusable_auth_credentials_type_for_reflect(&self) -> &::std::option::Option { + &self.reusable_auth_credentials_type + } + + fn mut_reusable_auth_credentials_type_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.reusable_auth_credentials_type + } + // required bytes reusable_auth_credentials = 40; pub fn clear_reusable_auth_credentials(&mut self) { @@ -3793,6 +3944,14 @@ impl APWelcome { } } + fn get_reusable_auth_credentials_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.reusable_auth_credentials + } + + fn mut_reusable_auth_credentials_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.reusable_auth_credentials + } + // optional bytes lfs_secret = 50; pub fn clear_lfs_secret(&mut self) { @@ -3829,6 +3988,14 @@ impl APWelcome { } } + fn get_lfs_secret_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.lfs_secret + } + + fn mut_lfs_secret_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.lfs_secret + } + // optional .AccountInfo account_info = 60; pub fn clear_account_info(&mut self) { @@ -3862,6 +4029,14 @@ impl APWelcome { self.account_info.as_ref().unwrap_or_else(|| AccountInfo::default_instance()) } + fn get_account_info_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.account_info + } + + fn mut_account_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.account_info + } + // optional .AccountInfoFacebook fb = 70; pub fn clear_fb(&mut self) { @@ -3894,6 +4069,14 @@ impl APWelcome { pub fn get_fb(&self) -> &AccountInfoFacebook { self.fb.as_ref().unwrap_or_else(|| AccountInfoFacebook::default_instance()) } + + fn get_fb_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.fb + } + + fn mut_fb_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.fb + } } impl ::protobuf::Message for APWelcome { @@ -3917,47 +4100,47 @@ impl ::protobuf::Message for APWelcome { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.canonical_username)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.canonical_username)?; }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.account_type_logged_in = ::std::option::Option::Some(tmp); }, 25 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.credentials_type_logged_in = ::std::option::Option::Some(tmp); }, 30 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.reusable_auth_credentials_type = ::std::option::Option::Some(tmp); }, 40 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.reusable_auth_credentials)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.reusable_auth_credentials)?; }, 50 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.lfs_secret)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.lfs_secret)?; }, 60 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.account_info)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.account_info)?; }, 70 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fb)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fb)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3968,30 +4151,30 @@ impl ::protobuf::Message for APWelcome { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.canonical_username { - my_size += ::protobuf::rt::string_size(10, &value); + if let Some(v) = self.canonical_username.as_ref() { + my_size += ::protobuf::rt::string_size(10, &v); }; - for value in &self.account_type_logged_in { - my_size += ::protobuf::rt::enum_size(20, *value); + if let Some(v) = self.account_type_logged_in { + my_size += ::protobuf::rt::enum_size(20, v); }; - for value in &self.credentials_type_logged_in { - my_size += ::protobuf::rt::enum_size(25, *value); + if let Some(v) = self.credentials_type_logged_in { + my_size += ::protobuf::rt::enum_size(25, v); }; - for value in &self.reusable_auth_credentials_type { - my_size += ::protobuf::rt::enum_size(30, *value); + if let Some(v) = self.reusable_auth_credentials_type { + my_size += ::protobuf::rt::enum_size(30, v); }; - for value in &self.reusable_auth_credentials { - my_size += ::protobuf::rt::bytes_size(40, &value); + if let Some(v) = self.reusable_auth_credentials.as_ref() { + my_size += ::protobuf::rt::bytes_size(40, &v); }; - for value in &self.lfs_secret { - my_size += ::protobuf::rt::bytes_size(50, &value); + if let Some(v) = self.lfs_secret.as_ref() { + my_size += ::protobuf::rt::bytes_size(50, &v); }; - for value in &self.account_info { - let len = value.compute_size(); + if let Some(v) = self.account_info.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.fb { - let len = value.compute_size(); + if let Some(v) = self.fb.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -4001,34 +4184,34 @@ impl ::protobuf::Message for APWelcome { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.canonical_username.as_ref() { - try!(os.write_string(10, &v)); + os.write_string(10, &v)?; }; if let Some(v) = self.account_type_logged_in { - try!(os.write_enum(20, v.value())); + os.write_enum(20, v.value())?; }; if let Some(v) = self.credentials_type_logged_in { - try!(os.write_enum(25, v.value())); + os.write_enum(25, v.value())?; }; if let Some(v) = self.reusable_auth_credentials_type { - try!(os.write_enum(30, v.value())); + os.write_enum(30, v.value())?; }; if let Some(v) = self.reusable_auth_credentials.as_ref() { - try!(os.write_bytes(40, &v)); + os.write_bytes(40, &v)?; }; if let Some(v) = self.lfs_secret.as_ref() { - try!(os.write_bytes(50, &v)); + os.write_bytes(50, &v)?; }; if let Some(v) = self.account_info.as_ref() { - try!(os.write_tag(60, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(60, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.fb.as_ref() { - try!(os.write_tag(70, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(70, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4044,10 +4227,6 @@ impl ::protobuf::Message for APWelcome { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4070,45 +4249,45 @@ impl ::protobuf::MessageStatic for APWelcome { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "canonical_username", - APWelcome::has_canonical_username, - APWelcome::get_canonical_username, + APWelcome::get_canonical_username_for_reflect, + APWelcome::mut_canonical_username_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "account_type_logged_in", - APWelcome::has_account_type_logged_in, - APWelcome::get_account_type_logged_in, + APWelcome::get_account_type_logged_in_for_reflect, + APWelcome::mut_account_type_logged_in_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "credentials_type_logged_in", - APWelcome::has_credentials_type_logged_in, - APWelcome::get_credentials_type_logged_in, + APWelcome::get_credentials_type_logged_in_for_reflect, + APWelcome::mut_credentials_type_logged_in_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "reusable_auth_credentials_type", - APWelcome::has_reusable_auth_credentials_type, - APWelcome::get_reusable_auth_credentials_type, + APWelcome::get_reusable_auth_credentials_type_for_reflect, + APWelcome::mut_reusable_auth_credentials_type_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "reusable_auth_credentials", - APWelcome::has_reusable_auth_credentials, - APWelcome::get_reusable_auth_credentials, + APWelcome::get_reusable_auth_credentials_for_reflect, + APWelcome::mut_reusable_auth_credentials_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "lfs_secret", - APWelcome::has_lfs_secret, - APWelcome::get_lfs_secret, + APWelcome::get_lfs_secret_for_reflect, + APWelcome::mut_lfs_secret_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "account_info", - APWelcome::has_account_info, - APWelcome::get_account_info, + APWelcome::get_account_info_for_reflect, + APWelcome::mut_account_info_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fb", - APWelcome::has_fb, - APWelcome::get_fb, + APWelcome::get_fb_for_reflect, + APWelcome::mut_fb_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "APWelcome", @@ -4134,34 +4313,26 @@ impl ::protobuf::Clear for APWelcome { } } -impl ::std::cmp::PartialEq for APWelcome { - fn eq(&self, other: &APWelcome) -> bool { - self.canonical_username == other.canonical_username && - self.account_type_logged_in == other.account_type_logged_in && - self.credentials_type_logged_in == other.credentials_type_logged_in && - self.reusable_auth_credentials_type == other.reusable_auth_credentials_type && - self.reusable_auth_credentials == other.reusable_auth_credentials && - self.lfs_secret == other.lfs_secret && - self.account_info == other.account_info && - self.fb == other.fb && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for APWelcome { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for APWelcome { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct AccountInfo { // message fields spotify: ::protobuf::SingularPtrField, facebook: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4178,14 +4349,7 @@ impl AccountInfo { ptr: 0 as *const AccountInfo, }; unsafe { - instance.get(|| { - AccountInfo { - spotify: ::protobuf::SingularPtrField::none(), - facebook: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(AccountInfo::new) } } @@ -4222,6 +4386,14 @@ impl AccountInfo { self.spotify.as_ref().unwrap_or_else(|| AccountInfoSpotify::default_instance()) } + fn get_spotify_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.spotify + } + + fn mut_spotify_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.spotify + } + // optional .AccountInfoFacebook facebook = 2; pub fn clear_facebook(&mut self) { @@ -4254,6 +4426,14 @@ impl AccountInfo { pub fn get_facebook(&self) -> &AccountInfoFacebook { self.facebook.as_ref().unwrap_or_else(|| AccountInfoFacebook::default_instance()) } + + fn get_facebook_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.facebook + } + + fn mut_facebook_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.facebook + } } impl ::protobuf::Message for AccountInfo { @@ -4262,17 +4442,17 @@ impl ::protobuf::Message for AccountInfo { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.spotify)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.spotify)?; }, 2 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.facebook)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.facebook)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4283,12 +4463,12 @@ impl ::protobuf::Message for AccountInfo { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.spotify { - let len = value.compute_size(); + if let Some(v) = self.spotify.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.facebook { - let len = value.compute_size(); + if let Some(v) = self.facebook.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()); @@ -4298,16 +4478,16 @@ impl ::protobuf::Message for AccountInfo { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.spotify.as_ref() { - try!(os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + 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(v) = self.facebook.as_ref() { - try!(os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4323,10 +4503,6 @@ impl ::protobuf::Message for AccountInfo { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4349,15 +4525,15 @@ impl ::protobuf::MessageStatic for AccountInfo { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "spotify", - AccountInfo::has_spotify, - AccountInfo::get_spotify, + AccountInfo::get_spotify_for_reflect, + AccountInfo::mut_spotify_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "facebook", - AccountInfo::has_facebook, - AccountInfo::get_facebook, + AccountInfo::get_facebook_for_reflect, + AccountInfo::mut_facebook_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "AccountInfo", @@ -4377,25 +4553,23 @@ impl ::protobuf::Clear for AccountInfo { } } -impl ::std::cmp::PartialEq for AccountInfo { - fn eq(&self, other: &AccountInfo) -> bool { - self.spotify == other.spotify && - self.facebook == other.facebook && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for AccountInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for AccountInfo { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct AccountInfoSpotify { // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4412,12 +4586,7 @@ impl AccountInfoSpotify { ptr: 0 as *const AccountInfoSpotify, }; unsafe { - instance.get(|| { - AccountInfoSpotify { - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(AccountInfoSpotify::new) } } } @@ -4428,11 +4597,11 @@ impl ::protobuf::Message for AccountInfoSpotify { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4449,7 +4618,7 @@ impl ::protobuf::Message for AccountInfoSpotify { } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4465,10 +4634,6 @@ impl ::protobuf::Message for AccountInfoSpotify { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4507,26 +4672,26 @@ impl ::protobuf::Clear for AccountInfoSpotify { } } -impl ::std::cmp::PartialEq for AccountInfoSpotify { - fn eq(&self, other: &AccountInfoSpotify) -> bool { - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for AccountInfoSpotify { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for AccountInfoSpotify { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct AccountInfoFacebook { // message fields access_token: ::protobuf::SingularField<::std::string::String>, machine_id: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4543,14 +4708,7 @@ impl AccountInfoFacebook { ptr: 0 as *const AccountInfoFacebook, }; unsafe { - instance.get(|| { - AccountInfoFacebook { - access_token: ::protobuf::SingularField::none(), - machine_id: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(AccountInfoFacebook::new) } } @@ -4590,6 +4748,14 @@ impl AccountInfoFacebook { } } + fn get_access_token_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.access_token + } + + fn mut_access_token_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.access_token + } + // optional string machine_id = 2; pub fn clear_machine_id(&mut self) { @@ -4625,6 +4791,14 @@ impl AccountInfoFacebook { None => "", } } + + fn get_machine_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.machine_id + } + + fn mut_machine_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.machine_id + } } impl ::protobuf::Message for AccountInfoFacebook { @@ -4633,17 +4807,17 @@ impl ::protobuf::Message for AccountInfoFacebook { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.access_token)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.access_token)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.machine_id)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.machine_id)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4654,11 +4828,11 @@ impl ::protobuf::Message for AccountInfoFacebook { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.access_token { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.access_token.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; - for value in &self.machine_id { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.machine_id.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -4667,12 +4841,12 @@ impl ::protobuf::Message for AccountInfoFacebook { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.access_token.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; if let Some(v) = self.machine_id.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4688,10 +4862,6 @@ impl ::protobuf::Message for AccountInfoFacebook { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4714,15 +4884,15 @@ impl ::protobuf::MessageStatic for AccountInfoFacebook { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "access_token", - AccountInfoFacebook::has_access_token, - AccountInfoFacebook::get_access_token, + AccountInfoFacebook::get_access_token_for_reflect, + AccountInfoFacebook::mut_access_token_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "machine_id", - AccountInfoFacebook::has_machine_id, - AccountInfoFacebook::get_machine_id, + AccountInfoFacebook::get_machine_id_for_reflect, + AccountInfoFacebook::mut_machine_id_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "AccountInfoFacebook", @@ -4742,20 +4912,18 @@ impl ::protobuf::Clear for AccountInfoFacebook { } } -impl ::std::cmp::PartialEq for AccountInfoFacebook { - fn eq(&self, other: &AccountInfoFacebook) -> bool { - self.access_token == other.access_token && - self.machine_id == other.machine_id && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for AccountInfoFacebook { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for AccountInfoFacebook { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum AuthenticationType { AUTHENTICATION_USER_PASS = 0, @@ -4808,6 +4976,12 @@ impl ::protobuf::ProtobufEnum for AuthenticationType { impl ::std::marker::Copy for AuthenticationType { } +impl ::protobuf::reflect::ProtobufValue for AuthenticationType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum AccountCreation { ACCOUNT_CREATION_ALWAYS_PROMPT = 1, @@ -4851,6 +5025,12 @@ impl ::protobuf::ProtobufEnum for AccountCreation { impl ::std::marker::Copy for AccountCreation { } +impl ::protobuf::reflect::ProtobufValue for AccountCreation { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum CpuFamily { CPU_UNKNOWN = 0, @@ -4918,6 +5098,12 @@ impl ::protobuf::ProtobufEnum for CpuFamily { impl ::std::marker::Copy for CpuFamily { } +impl ::protobuf::reflect::ProtobufValue for CpuFamily { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Brand { BRAND_UNBRANDED = 0, @@ -4967,6 +5153,12 @@ impl ::protobuf::ProtobufEnum for Brand { impl ::std::marker::Copy for Brand { } +impl ::protobuf::reflect::ProtobufValue for Brand { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Os { OS_UNKNOWN = 0, @@ -5073,6 +5265,12 @@ impl ::protobuf::ProtobufEnum for Os { impl ::std::marker::Copy for Os { } +impl ::protobuf::reflect::ProtobufValue for Os { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum AccountType { Spotify = 0, @@ -5116,6 +5314,12 @@ impl ::protobuf::ProtobufEnum for AccountType { impl ::std::marker::Copy for AccountType { } +impl ::protobuf::reflect::ProtobufValue for AccountType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + static file_descriptor_proto_data: &'static [u8] = &[ 0x0a, 0x14, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xec, 0x03, 0x0a, 0x17, 0x43, 0x6c, 0x69, 0x65, 0x6e, diff --git a/protocol/src/keyexchange.rs b/protocol/src/keyexchange.rs index c64dd326..5a87201e 100644 --- a/protocol/src/keyexchange.rs +++ b/protocol/src/keyexchange.rs @@ -20,7 +20,7 @@ use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; -#[derive(Clone,Default)] +#[derive(PartialEq,Clone,Default)] pub struct ClientHello { // message fields build_info: ::protobuf::SingularPtrField, @@ -33,7 +33,7 @@ pub struct ClientHello { feature_set: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -50,20 +50,7 @@ impl ClientHello { ptr: 0 as *const ClientHello, }; unsafe { - instance.get(|| { - ClientHello { - build_info: ::protobuf::SingularPtrField::none(), - fingerprints_supported: ::std::vec::Vec::new(), - cryptosuites_supported: ::std::vec::Vec::new(), - powschemes_supported: ::std::vec::Vec::new(), - login_crypto_hello: ::protobuf::SingularPtrField::none(), - client_nonce: ::protobuf::SingularField::none(), - padding: ::protobuf::SingularField::none(), - feature_set: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ClientHello::new) } } @@ -100,6 +87,14 @@ impl ClientHello { self.build_info.as_ref().unwrap_or_else(|| BuildInfo::default_instance()) } + fn get_build_info_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.build_info + } + + fn mut_build_info_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.build_info + } + // repeated .Fingerprint fingerprints_supported = 20; pub fn clear_fingerprints_supported(&mut self) { @@ -125,6 +120,14 @@ impl ClientHello { &self.fingerprints_supported } + fn get_fingerprints_supported_for_reflect(&self) -> &::std::vec::Vec { + &self.fingerprints_supported + } + + fn mut_fingerprints_supported_for_reflect(&mut self) -> &mut ::std::vec::Vec { + &mut self.fingerprints_supported + } + // repeated .Cryptosuite cryptosuites_supported = 30; pub fn clear_cryptosuites_supported(&mut self) { @@ -150,6 +153,14 @@ impl ClientHello { &self.cryptosuites_supported } + fn get_cryptosuites_supported_for_reflect(&self) -> &::std::vec::Vec { + &self.cryptosuites_supported + } + + fn mut_cryptosuites_supported_for_reflect(&mut self) -> &mut ::std::vec::Vec { + &mut self.cryptosuites_supported + } + // repeated .Powscheme powschemes_supported = 40; pub fn clear_powschemes_supported(&mut self) { @@ -175,6 +186,14 @@ impl ClientHello { &self.powschemes_supported } + fn get_powschemes_supported_for_reflect(&self) -> &::std::vec::Vec { + &self.powschemes_supported + } + + fn mut_powschemes_supported_for_reflect(&mut self) -> &mut ::std::vec::Vec { + &mut self.powschemes_supported + } + // required .LoginCryptoHelloUnion login_crypto_hello = 50; pub fn clear_login_crypto_hello(&mut self) { @@ -208,6 +227,14 @@ impl ClientHello { self.login_crypto_hello.as_ref().unwrap_or_else(|| LoginCryptoHelloUnion::default_instance()) } + fn get_login_crypto_hello_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.login_crypto_hello + } + + fn mut_login_crypto_hello_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.login_crypto_hello + } + // required bytes client_nonce = 60; pub fn clear_client_nonce(&mut self) { @@ -244,6 +271,14 @@ impl ClientHello { } } + fn get_client_nonce_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.client_nonce + } + + fn mut_client_nonce_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.client_nonce + } + // optional bytes padding = 70; pub fn clear_padding(&mut self) { @@ -280,6 +315,14 @@ impl ClientHello { } } + fn get_padding_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.padding + } + + fn mut_padding_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.padding + } + // optional .FeatureSet feature_set = 80; pub fn clear_feature_set(&mut self) { @@ -312,6 +355,14 @@ impl ClientHello { pub fn get_feature_set(&self) -> &FeatureSet { self.feature_set.as_ref().unwrap_or_else(|| FeatureSet::default_instance()) } + + fn get_feature_set_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.feature_set + } + + fn mut_feature_set_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.feature_set + } } impl ::protobuf::Message for ClientHello { @@ -329,35 +380,35 @@ impl ::protobuf::Message for ClientHello { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.build_info)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.build_info)?; }, 20 => { - try!(::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.fingerprints_supported)); + ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.fingerprints_supported)?; }, 30 => { - try!(::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.cryptosuites_supported)); + ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.cryptosuites_supported)?; }, 40 => { - try!(::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.powschemes_supported)); + ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.powschemes_supported)?; }, 50 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_hello)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_hello)?; }, 60 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.client_nonce)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.client_nonce)?; }, 70 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.padding)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.padding)?; }, 80 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.feature_set)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.feature_set)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -368,8 +419,8 @@ impl ::protobuf::Message for ClientHello { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.build_info { - let len = value.compute_size(); + if let Some(v) = self.build_info.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; for value in &self.fingerprints_supported { @@ -381,18 +432,18 @@ impl ::protobuf::Message for ClientHello { for value in &self.powschemes_supported { my_size += ::protobuf::rt::enum_size(40, *value); }; - for value in &self.login_crypto_hello { - let len = value.compute_size(); + if let Some(v) = self.login_crypto_hello.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.client_nonce { - my_size += ::protobuf::rt::bytes_size(60, &value); + if let Some(v) = self.client_nonce.as_ref() { + my_size += ::protobuf::rt::bytes_size(60, &v); }; - for value in &self.padding { - my_size += ::protobuf::rt::bytes_size(70, &value); + if let Some(v) = self.padding.as_ref() { + my_size += ::protobuf::rt::bytes_size(70, &v); }; - for value in &self.feature_set { - let len = value.compute_size(); + if let Some(v) = self.feature_set.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -402,36 +453,36 @@ impl ::protobuf::Message for ClientHello { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.build_info.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.fingerprints_supported { - try!(os.write_enum(20, v.value())); + os.write_enum(20, v.value())?; }; for v in &self.cryptosuites_supported { - try!(os.write_enum(30, v.value())); + os.write_enum(30, v.value())?; }; for v in &self.powschemes_supported { - try!(os.write_enum(40, v.value())); + os.write_enum(40, v.value())?; }; if let Some(v) = self.login_crypto_hello.as_ref() { - try!(os.write_tag(50, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(50, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.client_nonce.as_ref() { - try!(os.write_bytes(60, &v)); + os.write_bytes(60, &v)?; }; if let Some(v) = self.padding.as_ref() { - try!(os.write_bytes(70, &v)); + os.write_bytes(70, &v)?; }; if let Some(v) = self.feature_set.as_ref() { - try!(os.write_tag(80, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(80, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -447,10 +498,6 @@ impl ::protobuf::Message for ClientHello { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -473,42 +520,45 @@ impl ::protobuf::MessageStatic for ClientHello { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "build_info", - ClientHello::has_build_info, - ClientHello::get_build_info, + ClientHello::get_build_info_for_reflect, + ClientHello::mut_build_info_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "fingerprints_supported", - ClientHello::get_fingerprints_supported, + ClientHello::get_fingerprints_supported_for_reflect, + ClientHello::mut_fingerprints_supported_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "cryptosuites_supported", - ClientHello::get_cryptosuites_supported, + ClientHello::get_cryptosuites_supported_for_reflect, + ClientHello::mut_cryptosuites_supported_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "powschemes_supported", - ClientHello::get_powschemes_supported, + ClientHello::get_powschemes_supported_for_reflect, + ClientHello::mut_powschemes_supported_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_crypto_hello", - ClientHello::has_login_crypto_hello, - ClientHello::get_login_crypto_hello, + ClientHello::get_login_crypto_hello_for_reflect, + ClientHello::mut_login_crypto_hello_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "client_nonce", - ClientHello::has_client_nonce, - ClientHello::get_client_nonce, + ClientHello::get_client_nonce_for_reflect, + ClientHello::mut_client_nonce_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "padding", - ClientHello::has_padding, - ClientHello::get_padding, + ClientHello::get_padding_for_reflect, + ClientHello::mut_padding_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "feature_set", - ClientHello::has_feature_set, - ClientHello::get_feature_set, + ClientHello::get_feature_set_for_reflect, + ClientHello::mut_feature_set_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientHello", @@ -534,27 +584,19 @@ impl ::protobuf::Clear for ClientHello { } } -impl ::std::cmp::PartialEq for ClientHello { - fn eq(&self, other: &ClientHello) -> bool { - self.build_info == other.build_info && - self.fingerprints_supported == other.fingerprints_supported && - self.cryptosuites_supported == other.cryptosuites_supported && - self.powschemes_supported == other.powschemes_supported && - self.login_crypto_hello == other.login_crypto_hello && - self.client_nonce == other.client_nonce && - self.padding == other.padding && - self.feature_set == other.feature_set && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ClientHello { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ClientHello { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct BuildInfo { // message fields product: ::std::option::Option, @@ -563,7 +605,7 @@ pub struct BuildInfo { version: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -580,16 +622,7 @@ impl BuildInfo { ptr: 0 as *const BuildInfo, }; unsafe { - instance.get(|| { - BuildInfo { - product: ::std::option::Option::None, - product_flags: ::std::vec::Vec::new(), - platform: ::std::option::Option::None, - version: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(BuildInfo::new) } } @@ -612,6 +645,14 @@ impl BuildInfo { self.product.unwrap_or(Product::PRODUCT_CLIENT) } + fn get_product_for_reflect(&self) -> &::std::option::Option { + &self.product + } + + fn mut_product_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.product + } + // repeated .ProductFlags product_flags = 20; pub fn clear_product_flags(&mut self) { @@ -637,6 +678,14 @@ impl BuildInfo { &self.product_flags } + fn get_product_flags_for_reflect(&self) -> &::std::vec::Vec { + &self.product_flags + } + + fn mut_product_flags_for_reflect(&mut self) -> &mut ::std::vec::Vec { + &mut self.product_flags + } + // required .Platform platform = 30; pub fn clear_platform(&mut self) { @@ -656,6 +705,14 @@ impl BuildInfo { self.platform.unwrap_or(Platform::PLATFORM_WIN32_X86) } + fn get_platform_for_reflect(&self) -> &::std::option::Option { + &self.platform + } + + fn mut_platform_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.platform + } + // required uint64 version = 40; pub fn clear_version(&mut self) { @@ -674,6 +731,14 @@ impl BuildInfo { pub fn get_version(&self) -> u64 { self.version.unwrap_or(0) } + + fn get_version_for_reflect(&self) -> &::std::option::Option { + &self.version + } + + fn mut_version_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.version + } } impl ::protobuf::Message for BuildInfo { @@ -691,35 +756,35 @@ impl ::protobuf::Message for BuildInfo { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.product = ::std::option::Option::Some(tmp); }, 20 => { - try!(::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.product_flags)); + ::protobuf::rt::read_repeated_enum_into(wire_type, is, &mut self.product_flags)?; }, 30 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.platform = ::std::option::Option::Some(tmp); }, 40 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint64()); + let tmp = is.read_uint64()?; self.version = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -730,17 +795,17 @@ impl ::protobuf::Message for BuildInfo { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.product { - my_size += ::protobuf::rt::enum_size(10, *value); + if let Some(v) = self.product { + my_size += ::protobuf::rt::enum_size(10, v); }; for value in &self.product_flags { my_size += ::protobuf::rt::enum_size(20, *value); }; - for value in &self.platform { - my_size += ::protobuf::rt::enum_size(30, *value); + if let Some(v) = self.platform { + my_size += ::protobuf::rt::enum_size(30, v); }; - for value in &self.version { - my_size += ::protobuf::rt::value_size(40, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.version { + my_size += ::protobuf::rt::value_size(40, v, ::protobuf::wire_format::WireTypeVarint); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -749,18 +814,18 @@ impl ::protobuf::Message for BuildInfo { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.product { - try!(os.write_enum(10, v.value())); + os.write_enum(10, v.value())?; }; for v in &self.product_flags { - try!(os.write_enum(20, v.value())); + os.write_enum(20, v.value())?; }; if let Some(v) = self.platform { - try!(os.write_enum(30, v.value())); + os.write_enum(30, v.value())?; }; if let Some(v) = self.version { - try!(os.write_uint64(40, v)); + os.write_uint64(40, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -776,10 +841,6 @@ impl ::protobuf::Message for BuildInfo { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -802,24 +863,25 @@ impl ::protobuf::MessageStatic for BuildInfo { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "product", - BuildInfo::has_product, - BuildInfo::get_product, + BuildInfo::get_product_for_reflect, + BuildInfo::mut_product_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "product_flags", - BuildInfo::get_product_flags, + BuildInfo::get_product_flags_for_reflect, + BuildInfo::mut_product_flags_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "platform", - BuildInfo::has_platform, - BuildInfo::get_platform, + BuildInfo::get_platform_for_reflect, + BuildInfo::mut_platform_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u64_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( "version", - BuildInfo::has_version, - BuildInfo::get_version, + BuildInfo::get_version_for_reflect, + BuildInfo::mut_version_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "BuildInfo", @@ -841,29 +903,25 @@ impl ::protobuf::Clear for BuildInfo { } } -impl ::std::cmp::PartialEq for BuildInfo { - fn eq(&self, other: &BuildInfo) -> bool { - self.product == other.product && - self.product_flags == other.product_flags && - self.platform == other.platform && - self.version == other.version && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for BuildInfo { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for BuildInfo { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LoginCryptoHelloUnion { // message fields diffie_hellman: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -880,13 +938,7 @@ impl LoginCryptoHelloUnion { ptr: 0 as *const LoginCryptoHelloUnion, }; unsafe { - instance.get(|| { - LoginCryptoHelloUnion { - diffie_hellman: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LoginCryptoHelloUnion::new) } } @@ -922,6 +974,14 @@ impl LoginCryptoHelloUnion { pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanHello { self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanHello::default_instance()) } + + fn get_diffie_hellman_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.diffie_hellman + } + + fn mut_diffie_hellman_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.diffie_hellman + } } impl ::protobuf::Message for LoginCryptoHelloUnion { @@ -930,14 +990,14 @@ impl ::protobuf::Message for LoginCryptoHelloUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -948,8 +1008,8 @@ impl ::protobuf::Message for LoginCryptoHelloUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.diffie_hellman { - let len = value.compute_size(); + if let Some(v) = self.diffie_hellman.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()); @@ -959,11 +1019,11 @@ impl ::protobuf::Message for LoginCryptoHelloUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.diffie_hellman.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -979,10 +1039,6 @@ impl ::protobuf::Message for LoginCryptoHelloUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1005,10 +1061,10 @@ impl ::protobuf::MessageStatic for LoginCryptoHelloUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "diffie_hellman", - LoginCryptoHelloUnion::has_diffie_hellman, - LoginCryptoHelloUnion::get_diffie_hellman, + LoginCryptoHelloUnion::get_diffie_hellman_for_reflect, + LoginCryptoHelloUnion::mut_diffie_hellman_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoHelloUnion", @@ -1027,27 +1083,26 @@ impl ::protobuf::Clear for LoginCryptoHelloUnion { } } -impl ::std::cmp::PartialEq for LoginCryptoHelloUnion { - fn eq(&self, other: &LoginCryptoHelloUnion) -> bool { - self.diffie_hellman == other.diffie_hellman && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LoginCryptoHelloUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LoginCryptoHelloUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LoginCryptoDiffieHellmanHello { // message fields gc: ::protobuf::SingularField<::std::vec::Vec>, server_keys_known: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1064,14 +1119,7 @@ impl LoginCryptoDiffieHellmanHello { ptr: 0 as *const LoginCryptoDiffieHellmanHello, }; unsafe { - instance.get(|| { - LoginCryptoDiffieHellmanHello { - gc: ::protobuf::SingularField::none(), - server_keys_known: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LoginCryptoDiffieHellmanHello::new) } } @@ -1111,6 +1159,14 @@ impl LoginCryptoDiffieHellmanHello { } } + fn get_gc_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gc + } + + fn mut_gc_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gc + } + // required uint32 server_keys_known = 20; pub fn clear_server_keys_known(&mut self) { @@ -1129,6 +1185,14 @@ impl LoginCryptoDiffieHellmanHello { pub fn get_server_keys_known(&self) -> u32 { self.server_keys_known.unwrap_or(0) } + + fn get_server_keys_known_for_reflect(&self) -> &::std::option::Option { + &self.server_keys_known + } + + fn mut_server_keys_known_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.server_keys_known + } } impl ::protobuf::Message for LoginCryptoDiffieHellmanHello { @@ -1143,21 +1207,21 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanHello { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gc)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gc)?; }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.server_keys_known = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1168,11 +1232,11 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanHello { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.gc { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.gc.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; - for value in &self.server_keys_known { - my_size += ::protobuf::rt::value_size(20, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.server_keys_known { + my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -1181,12 +1245,12 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanHello { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.gc.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; if let Some(v) = self.server_keys_known { - try!(os.write_uint32(20, v)); + os.write_uint32(20, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1202,10 +1266,6 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanHello { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1228,15 +1288,15 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanHello { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gc", - LoginCryptoDiffieHellmanHello::has_gc, - LoginCryptoDiffieHellmanHello::get_gc, + LoginCryptoDiffieHellmanHello::get_gc_for_reflect, + LoginCryptoDiffieHellmanHello::mut_gc_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "server_keys_known", - LoginCryptoDiffieHellmanHello::has_server_keys_known, - LoginCryptoDiffieHellmanHello::get_server_keys_known, + LoginCryptoDiffieHellmanHello::get_server_keys_known_for_reflect, + LoginCryptoDiffieHellmanHello::mut_server_keys_known_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoDiffieHellmanHello", @@ -1256,28 +1316,26 @@ impl ::protobuf::Clear for LoginCryptoDiffieHellmanHello { } } -impl ::std::cmp::PartialEq for LoginCryptoDiffieHellmanHello { - fn eq(&self, other: &LoginCryptoDiffieHellmanHello) -> bool { - self.gc == other.gc && - self.server_keys_known == other.server_keys_known && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LoginCryptoDiffieHellmanHello { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LoginCryptoDiffieHellmanHello { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct FeatureSet { // message fields autoupdate2: ::std::option::Option, current_location: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1294,14 +1352,7 @@ impl FeatureSet { ptr: 0 as *const FeatureSet, }; unsafe { - instance.get(|| { - FeatureSet { - autoupdate2: ::std::option::Option::None, - current_location: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(FeatureSet::new) } } @@ -1324,6 +1375,14 @@ impl FeatureSet { self.autoupdate2.unwrap_or(false) } + fn get_autoupdate2_for_reflect(&self) -> &::std::option::Option { + &self.autoupdate2 + } + + fn mut_autoupdate2_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.autoupdate2 + } + // optional bool current_location = 2; pub fn clear_current_location(&mut self) { @@ -1342,6 +1401,14 @@ impl FeatureSet { pub fn get_current_location(&self) -> bool { self.current_location.unwrap_or(false) } + + fn get_current_location_for_reflect(&self) -> &::std::option::Option { + &self.current_location + } + + fn mut_current_location_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.current_location + } } impl ::protobuf::Message for FeatureSet { @@ -1350,25 +1417,25 @@ impl ::protobuf::Message for FeatureSet { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_bool()); + let tmp = is.read_bool()?; self.autoupdate2 = ::std::option::Option::Some(tmp); }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.current_location = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1379,10 +1446,10 @@ impl ::protobuf::Message for FeatureSet { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - if self.autoupdate2.is_some() { + if let Some(v) = self.autoupdate2 { my_size += 2; }; - if self.current_location.is_some() { + if let Some(v) = self.current_location { my_size += 2; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -1392,12 +1459,12 @@ impl ::protobuf::Message for FeatureSet { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.autoupdate2 { - try!(os.write_bool(1, v)); + os.write_bool(1, v)?; }; if let Some(v) = self.current_location { - try!(os.write_bool(2, v)); + os.write_bool(2, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1413,10 +1480,6 @@ impl ::protobuf::Message for FeatureSet { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1439,15 +1502,15 @@ impl ::protobuf::MessageStatic for FeatureSet { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "autoupdate2", - FeatureSet::has_autoupdate2, - FeatureSet::get_autoupdate2, + FeatureSet::get_autoupdate2_for_reflect, + FeatureSet::mut_autoupdate2_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "current_location", - FeatureSet::has_current_location, - FeatureSet::get_current_location, + FeatureSet::get_current_location_for_reflect, + FeatureSet::mut_current_location_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "FeatureSet", @@ -1467,21 +1530,19 @@ impl ::protobuf::Clear for FeatureSet { } } -impl ::std::cmp::PartialEq for FeatureSet { - fn eq(&self, other: &FeatureSet) -> bool { - self.autoupdate2 == other.autoupdate2 && - self.current_location == other.current_location && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for FeatureSet { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for FeatureSet { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct APResponseMessage { // message fields challenge: ::protobuf::SingularPtrField, @@ -1489,7 +1550,7 @@ pub struct APResponseMessage { login_failed: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1506,15 +1567,7 @@ impl APResponseMessage { ptr: 0 as *const APResponseMessage, }; unsafe { - instance.get(|| { - APResponseMessage { - challenge: ::protobuf::SingularPtrField::none(), - upgrade: ::protobuf::SingularPtrField::none(), - login_failed: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(APResponseMessage::new) } } @@ -1551,6 +1604,14 @@ impl APResponseMessage { self.challenge.as_ref().unwrap_or_else(|| APChallenge::default_instance()) } + fn get_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.challenge + } + + fn mut_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.challenge + } + // optional .UpgradeRequiredMessage upgrade = 20; pub fn clear_upgrade(&mut self) { @@ -1584,6 +1645,14 @@ impl APResponseMessage { self.upgrade.as_ref().unwrap_or_else(|| UpgradeRequiredMessage::default_instance()) } + fn get_upgrade_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.upgrade + } + + fn mut_upgrade_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.upgrade + } + // optional .APLoginFailed login_failed = 30; pub fn clear_login_failed(&mut self) { @@ -1616,6 +1685,14 @@ impl APResponseMessage { pub fn get_login_failed(&self) -> &APLoginFailed { self.login_failed.as_ref().unwrap_or_else(|| APLoginFailed::default_instance()) } + + fn get_login_failed_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.login_failed + } + + fn mut_login_failed_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.login_failed + } } impl ::protobuf::Message for APResponseMessage { @@ -1624,20 +1701,20 @@ impl ::protobuf::Message for APResponseMessage { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.challenge)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.challenge)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.upgrade)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.upgrade)?; }, 30 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_failed)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_failed)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1648,16 +1725,16 @@ impl ::protobuf::Message for APResponseMessage { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.challenge { - let len = value.compute_size(); + if let Some(v) = self.challenge.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.upgrade { - let len = value.compute_size(); + if let Some(v) = self.upgrade.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.login_failed { - let len = value.compute_size(); + if let Some(v) = self.login_failed.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -1667,21 +1744,21 @@ impl ::protobuf::Message for APResponseMessage { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.challenge.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.upgrade.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.login_failed.as_ref() { - try!(os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1697,10 +1774,6 @@ impl ::protobuf::Message for APResponseMessage { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1723,20 +1796,20 @@ impl ::protobuf::MessageStatic for APResponseMessage { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "challenge", - APResponseMessage::has_challenge, - APResponseMessage::get_challenge, + APResponseMessage::get_challenge_for_reflect, + APResponseMessage::mut_challenge_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "upgrade", - APResponseMessage::has_upgrade, - APResponseMessage::get_upgrade, + APResponseMessage::get_upgrade_for_reflect, + APResponseMessage::mut_upgrade_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_failed", - APResponseMessage::has_login_failed, - APResponseMessage::get_login_failed, + APResponseMessage::get_login_failed_for_reflect, + APResponseMessage::mut_login_failed_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "APResponseMessage", @@ -1757,22 +1830,19 @@ impl ::protobuf::Clear for APResponseMessage { } } -impl ::std::cmp::PartialEq for APResponseMessage { - fn eq(&self, other: &APResponseMessage) -> bool { - self.challenge == other.challenge && - self.upgrade == other.upgrade && - self.login_failed == other.login_failed && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for APResponseMessage { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for APResponseMessage { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct APChallenge { // message fields login_crypto_challenge: ::protobuf::SingularPtrField, @@ -1783,7 +1853,7 @@ pub struct APChallenge { padding: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1800,18 +1870,7 @@ impl APChallenge { ptr: 0 as *const APChallenge, }; unsafe { - instance.get(|| { - APChallenge { - login_crypto_challenge: ::protobuf::SingularPtrField::none(), - fingerprint_challenge: ::protobuf::SingularPtrField::none(), - pow_challenge: ::protobuf::SingularPtrField::none(), - crypto_challenge: ::protobuf::SingularPtrField::none(), - server_nonce: ::protobuf::SingularField::none(), - padding: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(APChallenge::new) } } @@ -1848,6 +1907,14 @@ impl APChallenge { self.login_crypto_challenge.as_ref().unwrap_or_else(|| LoginCryptoChallengeUnion::default_instance()) } + fn get_login_crypto_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.login_crypto_challenge + } + + fn mut_login_crypto_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.login_crypto_challenge + } + // required .FingerprintChallengeUnion fingerprint_challenge = 20; pub fn clear_fingerprint_challenge(&mut self) { @@ -1881,6 +1948,14 @@ impl APChallenge { self.fingerprint_challenge.as_ref().unwrap_or_else(|| FingerprintChallengeUnion::default_instance()) } + fn get_fingerprint_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.fingerprint_challenge + } + + fn mut_fingerprint_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.fingerprint_challenge + } + // required .PoWChallengeUnion pow_challenge = 30; pub fn clear_pow_challenge(&mut self) { @@ -1914,6 +1989,14 @@ impl APChallenge { self.pow_challenge.as_ref().unwrap_or_else(|| PoWChallengeUnion::default_instance()) } + fn get_pow_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.pow_challenge + } + + fn mut_pow_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.pow_challenge + } + // required .CryptoChallengeUnion crypto_challenge = 40; pub fn clear_crypto_challenge(&mut self) { @@ -1947,6 +2030,14 @@ impl APChallenge { self.crypto_challenge.as_ref().unwrap_or_else(|| CryptoChallengeUnion::default_instance()) } + fn get_crypto_challenge_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.crypto_challenge + } + + fn mut_crypto_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.crypto_challenge + } + // required bytes server_nonce = 50; pub fn clear_server_nonce(&mut self) { @@ -1983,6 +2074,14 @@ impl APChallenge { } } + fn get_server_nonce_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.server_nonce + } + + fn mut_server_nonce_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.server_nonce + } + // optional bytes padding = 60; pub fn clear_padding(&mut self) { @@ -2018,6 +2117,14 @@ impl APChallenge { None => &[], } } + + fn get_padding_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.padding + } + + fn mut_padding_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.padding + } } impl ::protobuf::Message for APChallenge { @@ -2041,29 +2148,29 @@ impl ::protobuf::Message for APChallenge { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_challenge)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_challenge)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fingerprint_challenge)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.fingerprint_challenge)?; }, 30 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pow_challenge)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pow_challenge)?; }, 40 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.crypto_challenge)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.crypto_challenge)?; }, 50 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.server_nonce)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.server_nonce)?; }, 60 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.padding)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.padding)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2074,27 +2181,27 @@ impl ::protobuf::Message for APChallenge { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.login_crypto_challenge { - let len = value.compute_size(); + if let Some(v) = self.login_crypto_challenge.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.fingerprint_challenge { - let len = value.compute_size(); + if let Some(v) = self.fingerprint_challenge.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.pow_challenge { - let len = value.compute_size(); + if let Some(v) = self.pow_challenge.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.crypto_challenge { - let len = value.compute_size(); + if let Some(v) = self.crypto_challenge.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.server_nonce { - my_size += ::protobuf::rt::bytes_size(50, &value); + if let Some(v) = self.server_nonce.as_ref() { + my_size += ::protobuf::rt::bytes_size(50, &v); }; - for value in &self.padding { - my_size += ::protobuf::rt::bytes_size(60, &value); + if let Some(v) = self.padding.as_ref() { + my_size += ::protobuf::rt::bytes_size(60, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -2103,32 +2210,32 @@ impl ::protobuf::Message for APChallenge { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.login_crypto_challenge.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.fingerprint_challenge.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.pow_challenge.as_ref() { - try!(os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.crypto_challenge.as_ref() { - try!(os.write_tag(40, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(40, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.server_nonce.as_ref() { - try!(os.write_bytes(50, &v)); + os.write_bytes(50, &v)?; }; if let Some(v) = self.padding.as_ref() { - try!(os.write_bytes(60, &v)); + os.write_bytes(60, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2144,10 +2251,6 @@ impl ::protobuf::Message for APChallenge { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2170,35 +2273,35 @@ impl ::protobuf::MessageStatic for APChallenge { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_crypto_challenge", - APChallenge::has_login_crypto_challenge, - APChallenge::get_login_crypto_challenge, + APChallenge::get_login_crypto_challenge_for_reflect, + APChallenge::mut_login_crypto_challenge_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "fingerprint_challenge", - APChallenge::has_fingerprint_challenge, - APChallenge::get_fingerprint_challenge, + APChallenge::get_fingerprint_challenge_for_reflect, + APChallenge::mut_fingerprint_challenge_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "pow_challenge", - APChallenge::has_pow_challenge, - APChallenge::get_pow_challenge, + APChallenge::get_pow_challenge_for_reflect, + APChallenge::mut_pow_challenge_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "crypto_challenge", - APChallenge::has_crypto_challenge, - APChallenge::get_crypto_challenge, + APChallenge::get_crypto_challenge_for_reflect, + APChallenge::mut_crypto_challenge_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "server_nonce", - APChallenge::has_server_nonce, - APChallenge::get_server_nonce, + APChallenge::get_server_nonce_for_reflect, + APChallenge::mut_server_nonce_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "padding", - APChallenge::has_padding, - APChallenge::get_padding, + APChallenge::get_padding_for_reflect, + APChallenge::mut_padding_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "APChallenge", @@ -2222,31 +2325,25 @@ impl ::protobuf::Clear for APChallenge { } } -impl ::std::cmp::PartialEq for APChallenge { - fn eq(&self, other: &APChallenge) -> bool { - self.login_crypto_challenge == other.login_crypto_challenge && - self.fingerprint_challenge == other.fingerprint_challenge && - self.pow_challenge == other.pow_challenge && - self.crypto_challenge == other.crypto_challenge && - self.server_nonce == other.server_nonce && - self.padding == other.padding && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for APChallenge { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for APChallenge { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LoginCryptoChallengeUnion { // message fields diffie_hellman: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2263,13 +2360,7 @@ impl LoginCryptoChallengeUnion { ptr: 0 as *const LoginCryptoChallengeUnion, }; unsafe { - instance.get(|| { - LoginCryptoChallengeUnion { - diffie_hellman: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LoginCryptoChallengeUnion::new) } } @@ -2305,6 +2396,14 @@ impl LoginCryptoChallengeUnion { pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanChallenge { self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanChallenge::default_instance()) } + + fn get_diffie_hellman_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.diffie_hellman + } + + fn mut_diffie_hellman_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.diffie_hellman + } } impl ::protobuf::Message for LoginCryptoChallengeUnion { @@ -2313,14 +2412,14 @@ impl ::protobuf::Message for LoginCryptoChallengeUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2331,8 +2430,8 @@ impl ::protobuf::Message for LoginCryptoChallengeUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.diffie_hellman { - let len = value.compute_size(); + if let Some(v) = self.diffie_hellman.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()); @@ -2342,11 +2441,11 @@ impl ::protobuf::Message for LoginCryptoChallengeUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.diffie_hellman.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2362,10 +2461,6 @@ impl ::protobuf::Message for LoginCryptoChallengeUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2388,10 +2483,10 @@ impl ::protobuf::MessageStatic for LoginCryptoChallengeUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "diffie_hellman", - LoginCryptoChallengeUnion::has_diffie_hellman, - LoginCryptoChallengeUnion::get_diffie_hellman, + LoginCryptoChallengeUnion::get_diffie_hellman_for_reflect, + LoginCryptoChallengeUnion::mut_diffie_hellman_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoChallengeUnion", @@ -2410,20 +2505,19 @@ impl ::protobuf::Clear for LoginCryptoChallengeUnion { } } -impl ::std::cmp::PartialEq for LoginCryptoChallengeUnion { - fn eq(&self, other: &LoginCryptoChallengeUnion) -> bool { - self.diffie_hellman == other.diffie_hellman && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LoginCryptoChallengeUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LoginCryptoChallengeUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LoginCryptoDiffieHellmanChallenge { // message fields gs: ::protobuf::SingularField<::std::vec::Vec>, @@ -2431,7 +2525,7 @@ pub struct LoginCryptoDiffieHellmanChallenge { gs_signature: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2448,15 +2542,7 @@ impl LoginCryptoDiffieHellmanChallenge { ptr: 0 as *const LoginCryptoDiffieHellmanChallenge, }; unsafe { - instance.get(|| { - LoginCryptoDiffieHellmanChallenge { - gs: ::protobuf::SingularField::none(), - server_signature_key: ::std::option::Option::None, - gs_signature: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LoginCryptoDiffieHellmanChallenge::new) } } @@ -2496,6 +2582,14 @@ impl LoginCryptoDiffieHellmanChallenge { } } + fn get_gs_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gs + } + + fn mut_gs_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gs + } + // required int32 server_signature_key = 20; pub fn clear_server_signature_key(&mut self) { @@ -2515,6 +2609,14 @@ impl LoginCryptoDiffieHellmanChallenge { self.server_signature_key.unwrap_or(0) } + fn get_server_signature_key_for_reflect(&self) -> &::std::option::Option { + &self.server_signature_key + } + + fn mut_server_signature_key_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.server_signature_key + } + // required bytes gs_signature = 30; pub fn clear_gs_signature(&mut self) { @@ -2550,6 +2652,14 @@ impl LoginCryptoDiffieHellmanChallenge { None => &[], } } + + fn get_gs_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gs_signature + } + + fn mut_gs_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gs_signature + } } impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge { @@ -2567,24 +2677,24 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gs)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gs)?; }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.server_signature_key = ::std::option::Option::Some(tmp); }, 30 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gs_signature)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gs_signature)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2595,14 +2705,14 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.gs { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.gs.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; - for value in &self.server_signature_key { - my_size += ::protobuf::rt::value_size(20, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.server_signature_key { + my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.gs_signature { - my_size += ::protobuf::rt::bytes_size(30, &value); + if let Some(v) = self.gs_signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(30, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -2611,15 +2721,15 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.gs.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; if let Some(v) = self.server_signature_key { - try!(os.write_int32(20, v)); + os.write_int32(20, v)?; }; if let Some(v) = self.gs_signature.as_ref() { - try!(os.write_bytes(30, &v)); + os.write_bytes(30, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2635,10 +2745,6 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanChallenge { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2661,20 +2767,20 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanChallenge { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gs", - LoginCryptoDiffieHellmanChallenge::has_gs, - LoginCryptoDiffieHellmanChallenge::get_gs, + LoginCryptoDiffieHellmanChallenge::get_gs_for_reflect, + LoginCryptoDiffieHellmanChallenge::mut_gs_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "server_signature_key", - LoginCryptoDiffieHellmanChallenge::has_server_signature_key, - LoginCryptoDiffieHellmanChallenge::get_server_signature_key, + LoginCryptoDiffieHellmanChallenge::get_server_signature_key_for_reflect, + LoginCryptoDiffieHellmanChallenge::mut_server_signature_key_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gs_signature", - LoginCryptoDiffieHellmanChallenge::has_gs_signature, - LoginCryptoDiffieHellmanChallenge::get_gs_signature, + LoginCryptoDiffieHellmanChallenge::get_gs_signature_for_reflect, + LoginCryptoDiffieHellmanChallenge::mut_gs_signature_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoDiffieHellmanChallenge", @@ -2695,29 +2801,26 @@ impl ::protobuf::Clear for LoginCryptoDiffieHellmanChallenge { } } -impl ::std::cmp::PartialEq for LoginCryptoDiffieHellmanChallenge { - fn eq(&self, other: &LoginCryptoDiffieHellmanChallenge) -> bool { - self.gs == other.gs && - self.server_signature_key == other.server_signature_key && - self.gs_signature == other.gs_signature && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LoginCryptoDiffieHellmanChallenge { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LoginCryptoDiffieHellmanChallenge { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct FingerprintChallengeUnion { // message fields grain: ::protobuf::SingularPtrField, hmac_ripemd: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2734,14 +2837,7 @@ impl FingerprintChallengeUnion { ptr: 0 as *const FingerprintChallengeUnion, }; unsafe { - instance.get(|| { - FingerprintChallengeUnion { - grain: ::protobuf::SingularPtrField::none(), - hmac_ripemd: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(FingerprintChallengeUnion::new) } } @@ -2778,6 +2874,14 @@ impl FingerprintChallengeUnion { self.grain.as_ref().unwrap_or_else(|| FingerprintGrainChallenge::default_instance()) } + fn get_grain_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.grain + } + + fn mut_grain_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.grain + } + // optional .FingerprintHmacRipemdChallenge hmac_ripemd = 20; pub fn clear_hmac_ripemd(&mut self) { @@ -2810,6 +2914,14 @@ impl FingerprintChallengeUnion { pub fn get_hmac_ripemd(&self) -> &FingerprintHmacRipemdChallenge { self.hmac_ripemd.as_ref().unwrap_or_else(|| FingerprintHmacRipemdChallenge::default_instance()) } + + fn get_hmac_ripemd_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.hmac_ripemd + } + + fn mut_hmac_ripemd_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.hmac_ripemd + } } impl ::protobuf::Message for FingerprintChallengeUnion { @@ -2818,17 +2930,17 @@ impl ::protobuf::Message for FingerprintChallengeUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.grain)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.grain)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hmac_ripemd)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hmac_ripemd)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2839,12 +2951,12 @@ impl ::protobuf::Message for FingerprintChallengeUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.grain { - let len = value.compute_size(); + if let Some(v) = self.grain.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.hmac_ripemd { - let len = value.compute_size(); + if let Some(v) = self.hmac_ripemd.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -2854,16 +2966,16 @@ impl ::protobuf::Message for FingerprintChallengeUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.grain.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.hmac_ripemd.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2879,10 +2991,6 @@ impl ::protobuf::Message for FingerprintChallengeUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2905,15 +3013,15 @@ impl ::protobuf::MessageStatic for FingerprintChallengeUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "grain", - FingerprintChallengeUnion::has_grain, - FingerprintChallengeUnion::get_grain, + FingerprintChallengeUnion::get_grain_for_reflect, + FingerprintChallengeUnion::mut_grain_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hmac_ripemd", - FingerprintChallengeUnion::has_hmac_ripemd, - FingerprintChallengeUnion::get_hmac_ripemd, + FingerprintChallengeUnion::get_hmac_ripemd_for_reflect, + FingerprintChallengeUnion::mut_hmac_ripemd_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintChallengeUnion", @@ -2933,27 +3041,25 @@ impl ::protobuf::Clear for FingerprintChallengeUnion { } } -impl ::std::cmp::PartialEq for FingerprintChallengeUnion { - fn eq(&self, other: &FingerprintChallengeUnion) -> bool { - self.grain == other.grain && - self.hmac_ripemd == other.hmac_ripemd && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for FingerprintChallengeUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for FingerprintChallengeUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct FingerprintGrainChallenge { // message fields kek: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2970,13 +3076,7 @@ impl FingerprintGrainChallenge { ptr: 0 as *const FingerprintGrainChallenge, }; unsafe { - instance.get(|| { - FingerprintGrainChallenge { - kek: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(FingerprintGrainChallenge::new) } } @@ -3015,6 +3115,14 @@ impl FingerprintGrainChallenge { None => &[], } } + + fn get_kek_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.kek + } + + fn mut_kek_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.kek + } } impl ::protobuf::Message for FingerprintGrainChallenge { @@ -3026,14 +3134,14 @@ impl ::protobuf::Message for FingerprintGrainChallenge { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.kek)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.kek)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3044,8 +3152,8 @@ impl ::protobuf::Message for FingerprintGrainChallenge { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.kek { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.kek.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3054,9 +3162,9 @@ impl ::protobuf::Message for FingerprintGrainChallenge { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.kek.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3072,10 +3180,6 @@ impl ::protobuf::Message for FingerprintGrainChallenge { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3098,10 +3202,10 @@ impl ::protobuf::MessageStatic for FingerprintGrainChallenge { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "kek", - FingerprintGrainChallenge::has_kek, - FingerprintGrainChallenge::get_kek, + FingerprintGrainChallenge::get_kek_for_reflect, + FingerprintGrainChallenge::mut_kek_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintGrainChallenge", @@ -3120,26 +3224,25 @@ impl ::protobuf::Clear for FingerprintGrainChallenge { } } -impl ::std::cmp::PartialEq for FingerprintGrainChallenge { - fn eq(&self, other: &FingerprintGrainChallenge) -> bool { - self.kek == other.kek && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for FingerprintGrainChallenge { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for FingerprintGrainChallenge { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct FingerprintHmacRipemdChallenge { // message fields challenge: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3156,13 +3259,7 @@ impl FingerprintHmacRipemdChallenge { ptr: 0 as *const FingerprintHmacRipemdChallenge, }; unsafe { - instance.get(|| { - FingerprintHmacRipemdChallenge { - challenge: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(FingerprintHmacRipemdChallenge::new) } } @@ -3201,6 +3298,14 @@ impl FingerprintHmacRipemdChallenge { None => &[], } } + + fn get_challenge_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.challenge + } + + fn mut_challenge_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.challenge + } } impl ::protobuf::Message for FingerprintHmacRipemdChallenge { @@ -3212,14 +3317,14 @@ impl ::protobuf::Message for FingerprintHmacRipemdChallenge { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.challenge)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.challenge)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3230,8 +3335,8 @@ impl ::protobuf::Message for FingerprintHmacRipemdChallenge { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.challenge { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.challenge.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3240,9 +3345,9 @@ impl ::protobuf::Message for FingerprintHmacRipemdChallenge { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.challenge.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3258,10 +3363,6 @@ impl ::protobuf::Message for FingerprintHmacRipemdChallenge { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3284,10 +3385,10 @@ impl ::protobuf::MessageStatic for FingerprintHmacRipemdChallenge { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "challenge", - FingerprintHmacRipemdChallenge::has_challenge, - FingerprintHmacRipemdChallenge::get_challenge, + FingerprintHmacRipemdChallenge::get_challenge_for_reflect, + FingerprintHmacRipemdChallenge::mut_challenge_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "FingerprintHmacRipemdChallenge", @@ -3306,26 +3407,25 @@ impl ::protobuf::Clear for FingerprintHmacRipemdChallenge { } } -impl ::std::cmp::PartialEq for FingerprintHmacRipemdChallenge { - fn eq(&self, other: &FingerprintHmacRipemdChallenge) -> bool { - self.challenge == other.challenge && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for FingerprintHmacRipemdChallenge { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for FingerprintHmacRipemdChallenge { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct PoWChallengeUnion { // message fields hash_cash: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3342,13 +3442,7 @@ impl PoWChallengeUnion { ptr: 0 as *const PoWChallengeUnion, }; unsafe { - instance.get(|| { - PoWChallengeUnion { - hash_cash: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(PoWChallengeUnion::new) } } @@ -3384,6 +3478,14 @@ impl PoWChallengeUnion { pub fn get_hash_cash(&self) -> &PoWHashCashChallenge { self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashChallenge::default_instance()) } + + fn get_hash_cash_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.hash_cash + } + + fn mut_hash_cash_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.hash_cash + } } impl ::protobuf::Message for PoWChallengeUnion { @@ -3392,14 +3494,14 @@ impl ::protobuf::Message for PoWChallengeUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hash_cash)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hash_cash)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3410,8 +3512,8 @@ impl ::protobuf::Message for PoWChallengeUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.hash_cash { - let len = value.compute_size(); + if let Some(v) = self.hash_cash.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()); @@ -3421,11 +3523,11 @@ impl ::protobuf::Message for PoWChallengeUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.hash_cash.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3441,10 +3543,6 @@ impl ::protobuf::Message for PoWChallengeUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3467,10 +3565,10 @@ impl ::protobuf::MessageStatic for PoWChallengeUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hash_cash", - PoWChallengeUnion::has_hash_cash, - PoWChallengeUnion::get_hash_cash, + PoWChallengeUnion::get_hash_cash_for_reflect, + PoWChallengeUnion::mut_hash_cash_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWChallengeUnion", @@ -3489,20 +3587,19 @@ impl ::protobuf::Clear for PoWChallengeUnion { } } -impl ::std::cmp::PartialEq for PoWChallengeUnion { - fn eq(&self, other: &PoWChallengeUnion) -> bool { - self.hash_cash == other.hash_cash && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for PoWChallengeUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for PoWChallengeUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct PoWHashCashChallenge { // message fields prefix: ::protobuf::SingularField<::std::vec::Vec>, @@ -3510,7 +3607,7 @@ pub struct PoWHashCashChallenge { target: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3527,15 +3624,7 @@ impl PoWHashCashChallenge { ptr: 0 as *const PoWHashCashChallenge, }; unsafe { - instance.get(|| { - PoWHashCashChallenge { - prefix: ::protobuf::SingularField::none(), - length: ::std::option::Option::None, - target: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(PoWHashCashChallenge::new) } } @@ -3575,6 +3664,14 @@ impl PoWHashCashChallenge { } } + fn get_prefix_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.prefix + } + + fn mut_prefix_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.prefix + } + // optional int32 length = 20; pub fn clear_length(&mut self) { @@ -3594,6 +3691,14 @@ impl PoWHashCashChallenge { self.length.unwrap_or(0) } + fn get_length_for_reflect(&self) -> &::std::option::Option { + &self.length + } + + fn mut_length_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.length + } + // optional int32 target = 30; pub fn clear_target(&mut self) { @@ -3612,6 +3717,14 @@ impl PoWHashCashChallenge { pub fn get_target(&self) -> i32 { self.target.unwrap_or(0) } + + fn get_target_for_reflect(&self) -> &::std::option::Option { + &self.target + } + + fn mut_target_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.target + } } impl ::protobuf::Message for PoWHashCashChallenge { @@ -3620,28 +3733,28 @@ impl ::protobuf::Message for PoWHashCashChallenge { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.prefix)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.prefix)?; }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.length = ::std::option::Option::Some(tmp); }, 30 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.target = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3652,14 +3765,14 @@ impl ::protobuf::Message for PoWHashCashChallenge { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.prefix { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.prefix.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; - for value in &self.length { - my_size += ::protobuf::rt::value_size(20, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.length { + my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.target { - my_size += ::protobuf::rt::value_size(30, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.target { + my_size += ::protobuf::rt::value_size(30, v, ::protobuf::wire_format::WireTypeVarint); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3668,15 +3781,15 @@ impl ::protobuf::Message for PoWHashCashChallenge { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.prefix.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; if let Some(v) = self.length { - try!(os.write_int32(20, v)); + os.write_int32(20, v)?; }; if let Some(v) = self.target { - try!(os.write_int32(30, v)); + os.write_int32(30, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3692,10 +3805,6 @@ impl ::protobuf::Message for PoWHashCashChallenge { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3718,20 +3827,20 @@ impl ::protobuf::MessageStatic for PoWHashCashChallenge { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "prefix", - PoWHashCashChallenge::has_prefix, - PoWHashCashChallenge::get_prefix, + PoWHashCashChallenge::get_prefix_for_reflect, + PoWHashCashChallenge::mut_prefix_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "length", - PoWHashCashChallenge::has_length, - PoWHashCashChallenge::get_length, + PoWHashCashChallenge::get_length_for_reflect, + PoWHashCashChallenge::mut_length_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "target", - PoWHashCashChallenge::has_target, - PoWHashCashChallenge::get_target, + PoWHashCashChallenge::get_target_for_reflect, + PoWHashCashChallenge::mut_target_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWHashCashChallenge", @@ -3752,29 +3861,26 @@ impl ::protobuf::Clear for PoWHashCashChallenge { } } -impl ::std::cmp::PartialEq for PoWHashCashChallenge { - fn eq(&self, other: &PoWHashCashChallenge) -> bool { - self.prefix == other.prefix && - self.length == other.length && - self.target == other.target && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for PoWHashCashChallenge { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for PoWHashCashChallenge { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct CryptoChallengeUnion { // message fields shannon: ::protobuf::SingularPtrField, rc4_sha1_hmac: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3791,14 +3897,7 @@ impl CryptoChallengeUnion { ptr: 0 as *const CryptoChallengeUnion, }; unsafe { - instance.get(|| { - CryptoChallengeUnion { - shannon: ::protobuf::SingularPtrField::none(), - rc4_sha1_hmac: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(CryptoChallengeUnion::new) } } @@ -3835,6 +3934,14 @@ impl CryptoChallengeUnion { self.shannon.as_ref().unwrap_or_else(|| CryptoShannonChallenge::default_instance()) } + fn get_shannon_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.shannon + } + + fn mut_shannon_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.shannon + } + // optional .CryptoRc4Sha1HmacChallenge rc4_sha1_hmac = 20; pub fn clear_rc4_sha1_hmac(&mut self) { @@ -3867,6 +3974,14 @@ impl CryptoChallengeUnion { pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacChallenge { self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacChallenge::default_instance()) } + + fn get_rc4_sha1_hmac_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.rc4_sha1_hmac + } + + fn mut_rc4_sha1_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.rc4_sha1_hmac + } } impl ::protobuf::Message for CryptoChallengeUnion { @@ -3875,17 +3990,17 @@ impl ::protobuf::Message for CryptoChallengeUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shannon)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shannon)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rc4_sha1_hmac)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rc4_sha1_hmac)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3896,12 +4011,12 @@ impl ::protobuf::Message for CryptoChallengeUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.shannon { - let len = value.compute_size(); + if let Some(v) = self.shannon.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.rc4_sha1_hmac { - let len = value.compute_size(); + if let Some(v) = self.rc4_sha1_hmac.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -3911,16 +4026,16 @@ impl ::protobuf::Message for CryptoChallengeUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.shannon.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.rc4_sha1_hmac.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3936,10 +4051,6 @@ impl ::protobuf::Message for CryptoChallengeUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3962,15 +4073,15 @@ impl ::protobuf::MessageStatic for CryptoChallengeUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "shannon", - CryptoChallengeUnion::has_shannon, - CryptoChallengeUnion::get_shannon, + CryptoChallengeUnion::get_shannon_for_reflect, + CryptoChallengeUnion::mut_shannon_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "rc4_sha1_hmac", - CryptoChallengeUnion::has_rc4_sha1_hmac, - CryptoChallengeUnion::get_rc4_sha1_hmac, + CryptoChallengeUnion::get_rc4_sha1_hmac_for_reflect, + CryptoChallengeUnion::mut_rc4_sha1_hmac_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoChallengeUnion", @@ -3990,25 +4101,23 @@ impl ::protobuf::Clear for CryptoChallengeUnion { } } -impl ::std::cmp::PartialEq for CryptoChallengeUnion { - fn eq(&self, other: &CryptoChallengeUnion) -> bool { - self.shannon == other.shannon && - self.rc4_sha1_hmac == other.rc4_sha1_hmac && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for CryptoChallengeUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for CryptoChallengeUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct CryptoShannonChallenge { // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4025,12 +4134,7 @@ impl CryptoShannonChallenge { ptr: 0 as *const CryptoShannonChallenge, }; unsafe { - instance.get(|| { - CryptoShannonChallenge { - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(CryptoShannonChallenge::new) } } } @@ -4041,11 +4145,11 @@ impl ::protobuf::Message for CryptoShannonChallenge { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4062,7 +4166,7 @@ impl ::protobuf::Message for CryptoShannonChallenge { } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4078,10 +4182,6 @@ impl ::protobuf::Message for CryptoShannonChallenge { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4120,23 +4220,23 @@ impl ::protobuf::Clear for CryptoShannonChallenge { } } -impl ::std::cmp::PartialEq for CryptoShannonChallenge { - fn eq(&self, other: &CryptoShannonChallenge) -> bool { - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for CryptoShannonChallenge { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for CryptoShannonChallenge { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct CryptoRc4Sha1HmacChallenge { // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4153,12 +4253,7 @@ impl CryptoRc4Sha1HmacChallenge { ptr: 0 as *const CryptoRc4Sha1HmacChallenge, }; unsafe { - instance.get(|| { - CryptoRc4Sha1HmacChallenge { - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(CryptoRc4Sha1HmacChallenge::new) } } } @@ -4169,11 +4264,11 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacChallenge { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4190,7 +4285,7 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacChallenge { } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4206,10 +4301,6 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacChallenge { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4248,19 +4339,19 @@ impl ::protobuf::Clear for CryptoRc4Sha1HmacChallenge { } } -impl ::std::cmp::PartialEq for CryptoRc4Sha1HmacChallenge { - fn eq(&self, other: &CryptoRc4Sha1HmacChallenge) -> bool { - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for CryptoRc4Sha1HmacChallenge { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for CryptoRc4Sha1HmacChallenge { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct UpgradeRequiredMessage { // message fields upgrade_signed_part: ::protobuf::SingularField<::std::vec::Vec>, @@ -4268,7 +4359,7 @@ pub struct UpgradeRequiredMessage { http_suffix: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4285,15 +4376,7 @@ impl UpgradeRequiredMessage { ptr: 0 as *const UpgradeRequiredMessage, }; unsafe { - instance.get(|| { - UpgradeRequiredMessage { - upgrade_signed_part: ::protobuf::SingularField::none(), - signature: ::protobuf::SingularField::none(), - http_suffix: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(UpgradeRequiredMessage::new) } } @@ -4333,6 +4416,14 @@ impl UpgradeRequiredMessage { } } + fn get_upgrade_signed_part_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.upgrade_signed_part + } + + fn mut_upgrade_signed_part_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.upgrade_signed_part + } + // required bytes signature = 20; pub fn clear_signature(&mut self) { @@ -4369,6 +4460,14 @@ impl UpgradeRequiredMessage { } } + fn get_signature_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.signature + } + + fn mut_signature_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.signature + } + // optional string http_suffix = 30; pub fn clear_http_suffix(&mut self) { @@ -4404,6 +4503,14 @@ impl UpgradeRequiredMessage { None => "", } } + + fn get_http_suffix_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.http_suffix + } + + fn mut_http_suffix_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.http_suffix + } } impl ::protobuf::Message for UpgradeRequiredMessage { @@ -4418,20 +4525,20 @@ impl ::protobuf::Message for UpgradeRequiredMessage { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.upgrade_signed_part)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.upgrade_signed_part)?; }, 20 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?; }, 30 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.http_suffix)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.http_suffix)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4442,14 +4549,14 @@ impl ::protobuf::Message for UpgradeRequiredMessage { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.upgrade_signed_part { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.upgrade_signed_part.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; - for value in &self.signature { - my_size += ::protobuf::rt::bytes_size(20, &value); + if let Some(v) = self.signature.as_ref() { + my_size += ::protobuf::rt::bytes_size(20, &v); }; - for value in &self.http_suffix { - my_size += ::protobuf::rt::string_size(30, &value); + if let Some(v) = self.http_suffix.as_ref() { + my_size += ::protobuf::rt::string_size(30, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -4458,15 +4565,15 @@ impl ::protobuf::Message for UpgradeRequiredMessage { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.upgrade_signed_part.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; if let Some(v) = self.signature.as_ref() { - try!(os.write_bytes(20, &v)); + os.write_bytes(20, &v)?; }; if let Some(v) = self.http_suffix.as_ref() { - try!(os.write_string(30, &v)); + os.write_string(30, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4482,10 +4589,6 @@ impl ::protobuf::Message for UpgradeRequiredMessage { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4508,20 +4611,20 @@ impl ::protobuf::MessageStatic for UpgradeRequiredMessage { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "upgrade_signed_part", - UpgradeRequiredMessage::has_upgrade_signed_part, - UpgradeRequiredMessage::get_upgrade_signed_part, + UpgradeRequiredMessage::get_upgrade_signed_part_for_reflect, + UpgradeRequiredMessage::mut_upgrade_signed_part_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "signature", - UpgradeRequiredMessage::has_signature, - UpgradeRequiredMessage::get_signature, + UpgradeRequiredMessage::get_signature_for_reflect, + UpgradeRequiredMessage::mut_signature_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "http_suffix", - UpgradeRequiredMessage::has_http_suffix, - UpgradeRequiredMessage::get_http_suffix, + UpgradeRequiredMessage::get_http_suffix_for_reflect, + UpgradeRequiredMessage::mut_http_suffix_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "UpgradeRequiredMessage", @@ -4542,22 +4645,19 @@ impl ::protobuf::Clear for UpgradeRequiredMessage { } } -impl ::std::cmp::PartialEq for UpgradeRequiredMessage { - fn eq(&self, other: &UpgradeRequiredMessage) -> bool { - self.upgrade_signed_part == other.upgrade_signed_part && - self.signature == other.signature && - self.http_suffix == other.http_suffix && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for UpgradeRequiredMessage { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for UpgradeRequiredMessage { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct APLoginFailed { // message fields error_code: ::std::option::Option, @@ -4566,7 +4666,7 @@ pub struct APLoginFailed { error_description: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4583,16 +4683,7 @@ impl APLoginFailed { ptr: 0 as *const APLoginFailed, }; unsafe { - instance.get(|| { - APLoginFailed { - error_code: ::std::option::Option::None, - retry_delay: ::std::option::Option::None, - expiry: ::std::option::Option::None, - error_description: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(APLoginFailed::new) } } @@ -4615,6 +4706,14 @@ impl APLoginFailed { self.error_code.unwrap_or(ErrorCode::ProtocolError) } + fn get_error_code_for_reflect(&self) -> &::std::option::Option { + &self.error_code + } + + fn mut_error_code_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.error_code + } + // optional int32 retry_delay = 20; pub fn clear_retry_delay(&mut self) { @@ -4634,6 +4733,14 @@ impl APLoginFailed { self.retry_delay.unwrap_or(0) } + fn get_retry_delay_for_reflect(&self) -> &::std::option::Option { + &self.retry_delay + } + + fn mut_retry_delay_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.retry_delay + } + // optional int32 expiry = 30; pub fn clear_expiry(&mut self) { @@ -4653,6 +4760,14 @@ impl APLoginFailed { self.expiry.unwrap_or(0) } + fn get_expiry_for_reflect(&self) -> &::std::option::Option { + &self.expiry + } + + fn mut_expiry_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.expiry + } + // optional string error_description = 40; pub fn clear_error_description(&mut self) { @@ -4688,6 +4803,14 @@ impl APLoginFailed { None => "", } } + + fn get_error_description_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.error_description + } + + fn mut_error_description_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.error_description + } } impl ::protobuf::Message for APLoginFailed { @@ -4699,35 +4822,35 @@ impl ::protobuf::Message for APLoginFailed { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.error_code = ::std::option::Option::Some(tmp); }, 20 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.retry_delay = ::std::option::Option::Some(tmp); }, 30 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.expiry = ::std::option::Option::Some(tmp); }, 40 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.error_description)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.error_description)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4738,17 +4861,17 @@ impl ::protobuf::Message for APLoginFailed { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.error_code { - my_size += ::protobuf::rt::enum_size(10, *value); + if let Some(v) = self.error_code { + my_size += ::protobuf::rt::enum_size(10, v); }; - for value in &self.retry_delay { - my_size += ::protobuf::rt::value_size(20, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.retry_delay { + my_size += ::protobuf::rt::value_size(20, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.expiry { - my_size += ::protobuf::rt::value_size(30, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.expiry { + my_size += ::protobuf::rt::value_size(30, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.error_description { - my_size += ::protobuf::rt::string_size(40, &value); + if let Some(v) = self.error_description.as_ref() { + my_size += ::protobuf::rt::string_size(40, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -4757,18 +4880,18 @@ impl ::protobuf::Message for APLoginFailed { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.error_code { - try!(os.write_enum(10, v.value())); + os.write_enum(10, v.value())?; }; if let Some(v) = self.retry_delay { - try!(os.write_int32(20, v)); + os.write_int32(20, v)?; }; if let Some(v) = self.expiry { - try!(os.write_int32(30, v)); + os.write_int32(30, v)?; }; if let Some(v) = self.error_description.as_ref() { - try!(os.write_string(40, &v)); + os.write_string(40, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4784,10 +4907,6 @@ impl ::protobuf::Message for APLoginFailed { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4810,25 +4929,25 @@ impl ::protobuf::MessageStatic for APLoginFailed { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "error_code", - APLoginFailed::has_error_code, - APLoginFailed::get_error_code, + APLoginFailed::get_error_code_for_reflect, + APLoginFailed::mut_error_code_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "retry_delay", - APLoginFailed::has_retry_delay, - APLoginFailed::get_retry_delay, + APLoginFailed::get_retry_delay_for_reflect, + APLoginFailed::mut_retry_delay_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "expiry", - APLoginFailed::has_expiry, - APLoginFailed::get_expiry, + APLoginFailed::get_expiry_for_reflect, + APLoginFailed::mut_expiry_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "error_description", - APLoginFailed::has_error_description, - APLoginFailed::get_error_description, + APLoginFailed::get_error_description_for_reflect, + APLoginFailed::mut_error_description_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "APLoginFailed", @@ -4850,23 +4969,19 @@ impl ::protobuf::Clear for APLoginFailed { } } -impl ::std::cmp::PartialEq for APLoginFailed { - fn eq(&self, other: &APLoginFailed) -> bool { - self.error_code == other.error_code && - self.retry_delay == other.retry_delay && - self.expiry == other.expiry && - self.error_description == other.error_description && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for APLoginFailed { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for APLoginFailed { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct ClientResponsePlaintext { // message fields login_crypto_response: ::protobuf::SingularPtrField, @@ -4874,7 +4989,7 @@ pub struct ClientResponsePlaintext { crypto_response: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4891,15 +5006,7 @@ impl ClientResponsePlaintext { ptr: 0 as *const ClientResponsePlaintext, }; unsafe { - instance.get(|| { - ClientResponsePlaintext { - login_crypto_response: ::protobuf::SingularPtrField::none(), - pow_response: ::protobuf::SingularPtrField::none(), - crypto_response: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ClientResponsePlaintext::new) } } @@ -4936,6 +5043,14 @@ impl ClientResponsePlaintext { self.login_crypto_response.as_ref().unwrap_or_else(|| LoginCryptoResponseUnion::default_instance()) } + fn get_login_crypto_response_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.login_crypto_response + } + + fn mut_login_crypto_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.login_crypto_response + } + // required .PoWResponseUnion pow_response = 20; pub fn clear_pow_response(&mut self) { @@ -4969,6 +5084,14 @@ impl ClientResponsePlaintext { self.pow_response.as_ref().unwrap_or_else(|| PoWResponseUnion::default_instance()) } + fn get_pow_response_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.pow_response + } + + fn mut_pow_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.pow_response + } + // required .CryptoResponseUnion crypto_response = 30; pub fn clear_crypto_response(&mut self) { @@ -5001,6 +5124,14 @@ impl ClientResponsePlaintext { pub fn get_crypto_response(&self) -> &CryptoResponseUnion { self.crypto_response.as_ref().unwrap_or_else(|| CryptoResponseUnion::default_instance()) } + + fn get_crypto_response_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.crypto_response + } + + fn mut_crypto_response_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.crypto_response + } } impl ::protobuf::Message for ClientResponsePlaintext { @@ -5018,20 +5149,20 @@ impl ::protobuf::Message for ClientResponsePlaintext { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_response)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.login_crypto_response)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pow_response)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.pow_response)?; }, 30 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.crypto_response)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.crypto_response)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5042,16 +5173,16 @@ impl ::protobuf::Message for ClientResponsePlaintext { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.login_crypto_response { - let len = value.compute_size(); + if let Some(v) = self.login_crypto_response.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.pow_response { - let len = value.compute_size(); + if let Some(v) = self.pow_response.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.crypto_response { - let len = value.compute_size(); + if let Some(v) = self.crypto_response.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -5061,21 +5192,21 @@ impl ::protobuf::Message for ClientResponsePlaintext { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.login_crypto_response.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.pow_response.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.crypto_response.as_ref() { - try!(os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(30, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5091,10 +5222,6 @@ impl ::protobuf::Message for ClientResponsePlaintext { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5117,20 +5244,20 @@ impl ::protobuf::MessageStatic for ClientResponsePlaintext { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "login_crypto_response", - ClientResponsePlaintext::has_login_crypto_response, - ClientResponsePlaintext::get_login_crypto_response, + ClientResponsePlaintext::get_login_crypto_response_for_reflect, + ClientResponsePlaintext::mut_login_crypto_response_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "pow_response", - ClientResponsePlaintext::has_pow_response, - ClientResponsePlaintext::get_pow_response, + ClientResponsePlaintext::get_pow_response_for_reflect, + ClientResponsePlaintext::mut_pow_response_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "crypto_response", - ClientResponsePlaintext::has_crypto_response, - ClientResponsePlaintext::get_crypto_response, + ClientResponsePlaintext::get_crypto_response_for_reflect, + ClientResponsePlaintext::mut_crypto_response_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ClientResponsePlaintext", @@ -5151,28 +5278,25 @@ impl ::protobuf::Clear for ClientResponsePlaintext { } } -impl ::std::cmp::PartialEq for ClientResponsePlaintext { - fn eq(&self, other: &ClientResponsePlaintext) -> bool { - self.login_crypto_response == other.login_crypto_response && - self.pow_response == other.pow_response && - self.crypto_response == other.crypto_response && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ClientResponsePlaintext { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ClientResponsePlaintext { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LoginCryptoResponseUnion { // message fields diffie_hellman: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5189,13 +5313,7 @@ impl LoginCryptoResponseUnion { ptr: 0 as *const LoginCryptoResponseUnion, }; unsafe { - instance.get(|| { - LoginCryptoResponseUnion { - diffie_hellman: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LoginCryptoResponseUnion::new) } } @@ -5231,6 +5349,14 @@ impl LoginCryptoResponseUnion { pub fn get_diffie_hellman(&self) -> &LoginCryptoDiffieHellmanResponse { self.diffie_hellman.as_ref().unwrap_or_else(|| LoginCryptoDiffieHellmanResponse::default_instance()) } + + fn get_diffie_hellman_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.diffie_hellman + } + + fn mut_diffie_hellman_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.diffie_hellman + } } impl ::protobuf::Message for LoginCryptoResponseUnion { @@ -5239,14 +5365,14 @@ impl ::protobuf::Message for LoginCryptoResponseUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.diffie_hellman)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5257,8 +5383,8 @@ impl ::protobuf::Message for LoginCryptoResponseUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.diffie_hellman { - let len = value.compute_size(); + if let Some(v) = self.diffie_hellman.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()); @@ -5268,11 +5394,11 @@ impl ::protobuf::Message for LoginCryptoResponseUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.diffie_hellman.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5288,10 +5414,6 @@ impl ::protobuf::Message for LoginCryptoResponseUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5314,10 +5436,10 @@ impl ::protobuf::MessageStatic for LoginCryptoResponseUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "diffie_hellman", - LoginCryptoResponseUnion::has_diffie_hellman, - LoginCryptoResponseUnion::get_diffie_hellman, + LoginCryptoResponseUnion::get_diffie_hellman_for_reflect, + LoginCryptoResponseUnion::mut_diffie_hellman_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoResponseUnion", @@ -5336,26 +5458,25 @@ impl ::protobuf::Clear for LoginCryptoResponseUnion { } } -impl ::std::cmp::PartialEq for LoginCryptoResponseUnion { - fn eq(&self, other: &LoginCryptoResponseUnion) -> bool { - self.diffie_hellman == other.diffie_hellman && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LoginCryptoResponseUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LoginCryptoResponseUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct LoginCryptoDiffieHellmanResponse { // message fields hmac: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5372,13 +5493,7 @@ impl LoginCryptoDiffieHellmanResponse { ptr: 0 as *const LoginCryptoDiffieHellmanResponse, }; unsafe { - instance.get(|| { - LoginCryptoDiffieHellmanResponse { - hmac: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(LoginCryptoDiffieHellmanResponse::new) } } @@ -5417,6 +5532,14 @@ impl LoginCryptoDiffieHellmanResponse { None => &[], } } + + fn get_hmac_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.hmac + } + + fn mut_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.hmac + } } impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse { @@ -5428,14 +5551,14 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hmac)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hmac)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5446,8 +5569,8 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.hmac { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.hmac.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -5456,9 +5579,9 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.hmac.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5474,10 +5597,6 @@ impl ::protobuf::Message for LoginCryptoDiffieHellmanResponse { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5500,10 +5619,10 @@ impl ::protobuf::MessageStatic for LoginCryptoDiffieHellmanResponse { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "hmac", - LoginCryptoDiffieHellmanResponse::has_hmac, - LoginCryptoDiffieHellmanResponse::get_hmac, + LoginCryptoDiffieHellmanResponse::get_hmac_for_reflect, + LoginCryptoDiffieHellmanResponse::mut_hmac_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "LoginCryptoDiffieHellmanResponse", @@ -5522,26 +5641,25 @@ impl ::protobuf::Clear for LoginCryptoDiffieHellmanResponse { } } -impl ::std::cmp::PartialEq for LoginCryptoDiffieHellmanResponse { - fn eq(&self, other: &LoginCryptoDiffieHellmanResponse) -> bool { - self.hmac == other.hmac && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for LoginCryptoDiffieHellmanResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for LoginCryptoDiffieHellmanResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct PoWResponseUnion { // message fields hash_cash: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5558,13 +5676,7 @@ impl PoWResponseUnion { ptr: 0 as *const PoWResponseUnion, }; unsafe { - instance.get(|| { - PoWResponseUnion { - hash_cash: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(PoWResponseUnion::new) } } @@ -5600,6 +5712,14 @@ impl PoWResponseUnion { pub fn get_hash_cash(&self) -> &PoWHashCashResponse { self.hash_cash.as_ref().unwrap_or_else(|| PoWHashCashResponse::default_instance()) } + + fn get_hash_cash_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.hash_cash + } + + fn mut_hash_cash_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.hash_cash + } } impl ::protobuf::Message for PoWResponseUnion { @@ -5608,14 +5728,14 @@ impl ::protobuf::Message for PoWResponseUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hash_cash)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.hash_cash)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5626,8 +5746,8 @@ impl ::protobuf::Message for PoWResponseUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.hash_cash { - let len = value.compute_size(); + if let Some(v) = self.hash_cash.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()); @@ -5637,11 +5757,11 @@ impl ::protobuf::Message for PoWResponseUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.hash_cash.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5657,10 +5777,6 @@ impl ::protobuf::Message for PoWResponseUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5683,10 +5799,10 @@ impl ::protobuf::MessageStatic for PoWResponseUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "hash_cash", - PoWResponseUnion::has_hash_cash, - PoWResponseUnion::get_hash_cash, + PoWResponseUnion::get_hash_cash_for_reflect, + PoWResponseUnion::mut_hash_cash_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWResponseUnion", @@ -5705,26 +5821,25 @@ impl ::protobuf::Clear for PoWResponseUnion { } } -impl ::std::cmp::PartialEq for PoWResponseUnion { - fn eq(&self, other: &PoWResponseUnion) -> bool { - self.hash_cash == other.hash_cash && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for PoWResponseUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for PoWResponseUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct PoWHashCashResponse { // message fields hash_suffix: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5741,13 +5856,7 @@ impl PoWHashCashResponse { ptr: 0 as *const PoWHashCashResponse, }; unsafe { - instance.get(|| { - PoWHashCashResponse { - hash_suffix: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(PoWHashCashResponse::new) } } @@ -5786,6 +5895,14 @@ impl PoWHashCashResponse { None => &[], } } + + fn get_hash_suffix_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.hash_suffix + } + + fn mut_hash_suffix_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.hash_suffix + } } impl ::protobuf::Message for PoWHashCashResponse { @@ -5797,14 +5914,14 @@ impl ::protobuf::Message for PoWHashCashResponse { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hash_suffix)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hash_suffix)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5815,8 +5932,8 @@ impl ::protobuf::Message for PoWHashCashResponse { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.hash_suffix { - my_size += ::protobuf::rt::bytes_size(10, &value); + if let Some(v) = self.hash_suffix.as_ref() { + my_size += ::protobuf::rt::bytes_size(10, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -5825,9 +5942,9 @@ impl ::protobuf::Message for PoWHashCashResponse { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.hash_suffix.as_ref() { - try!(os.write_bytes(10, &v)); + os.write_bytes(10, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5843,10 +5960,6 @@ impl ::protobuf::Message for PoWHashCashResponse { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5869,10 +5982,10 @@ impl ::protobuf::MessageStatic for PoWHashCashResponse { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "hash_suffix", - PoWHashCashResponse::has_hash_suffix, - PoWHashCashResponse::get_hash_suffix, + PoWHashCashResponse::get_hash_suffix_for_reflect, + PoWHashCashResponse::mut_hash_suffix_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "PoWHashCashResponse", @@ -5891,27 +6004,26 @@ impl ::protobuf::Clear for PoWHashCashResponse { } } -impl ::std::cmp::PartialEq for PoWHashCashResponse { - fn eq(&self, other: &PoWHashCashResponse) -> bool { - self.hash_suffix == other.hash_suffix && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for PoWHashCashResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for PoWHashCashResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct CryptoResponseUnion { // message fields shannon: ::protobuf::SingularPtrField, rc4_sha1_hmac: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5928,14 +6040,7 @@ impl CryptoResponseUnion { ptr: 0 as *const CryptoResponseUnion, }; unsafe { - instance.get(|| { - CryptoResponseUnion { - shannon: ::protobuf::SingularPtrField::none(), - rc4_sha1_hmac: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(CryptoResponseUnion::new) } } @@ -5972,6 +6077,14 @@ impl CryptoResponseUnion { self.shannon.as_ref().unwrap_or_else(|| CryptoShannonResponse::default_instance()) } + fn get_shannon_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.shannon + } + + fn mut_shannon_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.shannon + } + // optional .CryptoRc4Sha1HmacResponse rc4_sha1_hmac = 20; pub fn clear_rc4_sha1_hmac(&mut self) { @@ -6004,6 +6117,14 @@ impl CryptoResponseUnion { pub fn get_rc4_sha1_hmac(&self) -> &CryptoRc4Sha1HmacResponse { self.rc4_sha1_hmac.as_ref().unwrap_or_else(|| CryptoRc4Sha1HmacResponse::default_instance()) } + + fn get_rc4_sha1_hmac_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.rc4_sha1_hmac + } + + fn mut_rc4_sha1_hmac_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.rc4_sha1_hmac + } } impl ::protobuf::Message for CryptoResponseUnion { @@ -6012,17 +6133,17 @@ impl ::protobuf::Message for CryptoResponseUnion { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 10 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shannon)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.shannon)?; }, 20 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rc4_sha1_hmac)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.rc4_sha1_hmac)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -6033,12 +6154,12 @@ impl ::protobuf::Message for CryptoResponseUnion { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.shannon { - let len = value.compute_size(); + if let Some(v) = self.shannon.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.rc4_sha1_hmac { - let len = value.compute_size(); + if let Some(v) = self.rc4_sha1_hmac.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -6048,16 +6169,16 @@ impl ::protobuf::Message for CryptoResponseUnion { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.shannon.as_ref() { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.rc4_sha1_hmac.as_ref() { - try!(os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(20, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -6073,10 +6194,6 @@ impl ::protobuf::Message for CryptoResponseUnion { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -6099,15 +6216,15 @@ impl ::protobuf::MessageStatic for CryptoResponseUnion { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "shannon", - CryptoResponseUnion::has_shannon, - CryptoResponseUnion::get_shannon, + CryptoResponseUnion::get_shannon_for_reflect, + CryptoResponseUnion::mut_shannon_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "rc4_sha1_hmac", - CryptoResponseUnion::has_rc4_sha1_hmac, - CryptoResponseUnion::get_rc4_sha1_hmac, + CryptoResponseUnion::get_rc4_sha1_hmac_for_reflect, + CryptoResponseUnion::mut_rc4_sha1_hmac_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoResponseUnion", @@ -6127,27 +6244,25 @@ impl ::protobuf::Clear for CryptoResponseUnion { } } -impl ::std::cmp::PartialEq for CryptoResponseUnion { - fn eq(&self, other: &CryptoResponseUnion) -> bool { - self.shannon == other.shannon && - self.rc4_sha1_hmac == other.rc4_sha1_hmac && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for CryptoResponseUnion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for CryptoResponseUnion { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct CryptoShannonResponse { // message fields dummy: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -6164,13 +6279,7 @@ impl CryptoShannonResponse { ptr: 0 as *const CryptoShannonResponse, }; unsafe { - instance.get(|| { - CryptoShannonResponse { - dummy: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(CryptoShannonResponse::new) } } @@ -6192,6 +6301,14 @@ impl CryptoShannonResponse { pub fn get_dummy(&self) -> i32 { self.dummy.unwrap_or(0) } + + fn get_dummy_for_reflect(&self) -> &::std::option::Option { + &self.dummy + } + + fn mut_dummy_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.dummy + } } impl ::protobuf::Message for CryptoShannonResponse { @@ -6200,18 +6317,18 @@ impl ::protobuf::Message for CryptoShannonResponse { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_int32()); + let tmp = is.read_int32()?; self.dummy = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -6222,8 +6339,8 @@ impl ::protobuf::Message for CryptoShannonResponse { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.dummy { - my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.dummy { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -6232,9 +6349,9 @@ impl ::protobuf::Message for CryptoShannonResponse { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.dummy { - try!(os.write_int32(1, v)); + os.write_int32(1, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -6250,10 +6367,6 @@ impl ::protobuf::Message for CryptoShannonResponse { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -6276,10 +6389,10 @@ impl ::protobuf::MessageStatic for CryptoShannonResponse { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "dummy", - CryptoShannonResponse::has_dummy, - CryptoShannonResponse::get_dummy, + CryptoShannonResponse::get_dummy_for_reflect, + CryptoShannonResponse::mut_dummy_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoShannonResponse", @@ -6298,26 +6411,25 @@ impl ::protobuf::Clear for CryptoShannonResponse { } } -impl ::std::cmp::PartialEq for CryptoShannonResponse { - fn eq(&self, other: &CryptoShannonResponse) -> bool { - self.dummy == other.dummy && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for CryptoShannonResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for CryptoShannonResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct CryptoRc4Sha1HmacResponse { // message fields dummy: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -6334,13 +6446,7 @@ impl CryptoRc4Sha1HmacResponse { ptr: 0 as *const CryptoRc4Sha1HmacResponse, }; unsafe { - instance.get(|| { - CryptoRc4Sha1HmacResponse { - dummy: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(CryptoRc4Sha1HmacResponse::new) } } @@ -6362,6 +6468,14 @@ impl CryptoRc4Sha1HmacResponse { pub fn get_dummy(&self) -> i32 { self.dummy.unwrap_or(0) } + + fn get_dummy_for_reflect(&self) -> &::std::option::Option { + &self.dummy + } + + fn mut_dummy_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.dummy + } } impl ::protobuf::Message for CryptoRc4Sha1HmacResponse { @@ -6370,18 +6484,18 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacResponse { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_int32()); + let tmp = is.read_int32()?; self.dummy = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -6392,8 +6506,8 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacResponse { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.dummy { - my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.dummy { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -6402,9 +6516,9 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacResponse { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.dummy { - try!(os.write_int32(1, v)); + os.write_int32(1, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -6420,10 +6534,6 @@ impl ::protobuf::Message for CryptoRc4Sha1HmacResponse { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -6446,10 +6556,10 @@ impl ::protobuf::MessageStatic for CryptoRc4Sha1HmacResponse { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "dummy", - CryptoRc4Sha1HmacResponse::has_dummy, - CryptoRc4Sha1HmacResponse::get_dummy, + CryptoRc4Sha1HmacResponse::get_dummy_for_reflect, + CryptoRc4Sha1HmacResponse::mut_dummy_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "CryptoRc4Sha1HmacResponse", @@ -6468,19 +6578,18 @@ impl ::protobuf::Clear for CryptoRc4Sha1HmacResponse { } } -impl ::std::cmp::PartialEq for CryptoRc4Sha1HmacResponse { - fn eq(&self, other: &CryptoRc4Sha1HmacResponse) -> bool { - self.dummy == other.dummy && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for CryptoRc4Sha1HmacResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for CryptoRc4Sha1HmacResponse { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Product { PRODUCT_CLIENT = 0, @@ -6533,6 +6642,12 @@ impl ::protobuf::ProtobufEnum for Product { impl ::std::marker::Copy for Product { } +impl ::protobuf::reflect::ProtobufValue for Product { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum ProductFlags { PRODUCT_FLAG_NONE = 0, @@ -6576,6 +6691,12 @@ impl ::protobuf::ProtobufEnum for ProductFlags { impl ::std::marker::Copy for ProductFlags { } +impl ::protobuf::reflect::ProtobufValue for ProductFlags { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Platform { PLATFORM_WIN32_X86 = 0, @@ -6685,6 +6806,12 @@ impl ::protobuf::ProtobufEnum for Platform { impl ::std::marker::Copy for Platform { } +impl ::protobuf::reflect::ProtobufValue for Platform { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Fingerprint { FINGERPRINT_GRAIN = 0, @@ -6728,6 +6855,12 @@ impl ::protobuf::ProtobufEnum for Fingerprint { impl ::std::marker::Copy for Fingerprint { } +impl ::protobuf::reflect::ProtobufValue for Fingerprint { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Cryptosuite { CRYPTO_SUITE_SHANNON = 0, @@ -6771,6 +6904,12 @@ impl ::protobuf::ProtobufEnum for Cryptosuite { impl ::std::marker::Copy for Cryptosuite { } +impl ::protobuf::reflect::ProtobufValue for Cryptosuite { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Powscheme { POW_HASH_CASH = 0, @@ -6811,6 +6950,12 @@ impl ::protobuf::ProtobufEnum for Powscheme { impl ::std::marker::Copy for Powscheme { } +impl ::protobuf::reflect::ProtobufValue for Powscheme { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum ErrorCode { ProtocolError = 0, @@ -6881,6 +7026,12 @@ impl ::protobuf::ProtobufEnum for ErrorCode { impl ::std::marker::Copy for ErrorCode { } +impl ::protobuf::reflect::ProtobufValue for ErrorCode { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + static file_descriptor_proto_data: &'static [u8] = &[ 0x0a, 0x11, 0x6b, 0x65, 0x79, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x03, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x65, diff --git a/protocol/src/mercury.rs b/protocol/src/mercury.rs index 3e31fdce..61cad42a 100644 --- a/protocol/src/mercury.rs +++ b/protocol/src/mercury.rs @@ -20,13 +20,13 @@ use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; -#[derive(Clone,Default)] +#[derive(PartialEq,Clone,Default)] pub struct MercuryMultiGetRequest { // message fields request: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -43,13 +43,7 @@ impl MercuryMultiGetRequest { ptr: 0 as *const MercuryMultiGetRequest, }; unsafe { - instance.get(|| { - MercuryMultiGetRequest { - request: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(MercuryMultiGetRequest::new) } } @@ -77,6 +71,14 @@ impl MercuryMultiGetRequest { pub fn get_request(&self) -> &[MercuryRequest] { &self.request } + + fn get_request_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.request + } + + fn mut_request_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.request + } } impl ::protobuf::Message for MercuryMultiGetRequest { @@ -85,14 +87,14 @@ impl ::protobuf::Message for MercuryMultiGetRequest { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.request)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.request)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -114,11 +116,11 @@ impl ::protobuf::Message for MercuryMultiGetRequest { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { for v in &self.request { - try!(os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -134,10 +136,6 @@ impl ::protobuf::Message for MercuryMultiGetRequest { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -160,9 +158,10 @@ impl ::protobuf::MessageStatic for MercuryMultiGetRequest { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "request", - MercuryMultiGetRequest::get_request, + MercuryMultiGetRequest::get_request_for_reflect, + MercuryMultiGetRequest::mut_request_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryMultiGetRequest", @@ -181,26 +180,25 @@ impl ::protobuf::Clear for MercuryMultiGetRequest { } } -impl ::std::cmp::PartialEq for MercuryMultiGetRequest { - fn eq(&self, other: &MercuryMultiGetRequest) -> bool { - self.request == other.request && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for MercuryMultiGetRequest { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for MercuryMultiGetRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct MercuryMultiGetReply { // message fields reply: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -217,13 +215,7 @@ impl MercuryMultiGetReply { ptr: 0 as *const MercuryMultiGetReply, }; unsafe { - instance.get(|| { - MercuryMultiGetReply { - reply: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(MercuryMultiGetReply::new) } } @@ -251,6 +243,14 @@ impl MercuryMultiGetReply { pub fn get_reply(&self) -> &[MercuryReply] { &self.reply } + + fn get_reply_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.reply + } + + fn mut_reply_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.reply + } } impl ::protobuf::Message for MercuryMultiGetReply { @@ -259,14 +259,14 @@ impl ::protobuf::Message for MercuryMultiGetReply { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.reply)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.reply)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -288,11 +288,11 @@ impl ::protobuf::Message for MercuryMultiGetReply { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { for v in &self.reply { - try!(os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -308,10 +308,6 @@ impl ::protobuf::Message for MercuryMultiGetReply { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -334,9 +330,10 @@ impl ::protobuf::MessageStatic for MercuryMultiGetReply { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "reply", - MercuryMultiGetReply::get_reply, + MercuryMultiGetReply::get_reply_for_reflect, + MercuryMultiGetReply::mut_reply_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryMultiGetReply", @@ -355,20 +352,19 @@ impl ::protobuf::Clear for MercuryMultiGetReply { } } -impl ::std::cmp::PartialEq for MercuryMultiGetReply { - fn eq(&self, other: &MercuryMultiGetReply) -> bool { - self.reply == other.reply && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for MercuryMultiGetReply { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for MercuryMultiGetReply { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct MercuryRequest { // message fields uri: ::protobuf::SingularField<::std::string::String>, @@ -377,7 +373,7 @@ pub struct MercuryRequest { etag: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -394,16 +390,7 @@ impl MercuryRequest { ptr: 0 as *const MercuryRequest, }; unsafe { - instance.get(|| { - MercuryRequest { - uri: ::protobuf::SingularField::none(), - content_type: ::protobuf::SingularField::none(), - body: ::protobuf::SingularField::none(), - etag: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(MercuryRequest::new) } } @@ -443,6 +430,14 @@ impl MercuryRequest { } } + fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.uri + } + + fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.uri + } + // optional string content_type = 2; pub fn clear_content_type(&mut self) { @@ -479,6 +474,14 @@ impl MercuryRequest { } } + fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.content_type + } + + fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.content_type + } + // optional bytes body = 3; pub fn clear_body(&mut self) { @@ -515,6 +518,14 @@ impl MercuryRequest { } } + fn get_body_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.body + } + + fn mut_body_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.body + } + // optional bytes etag = 4; pub fn clear_etag(&mut self) { @@ -550,6 +561,14 @@ impl MercuryRequest { None => &[], } } + + fn get_etag_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.etag + } + + fn mut_etag_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.etag + } } impl ::protobuf::Message for MercuryRequest { @@ -558,23 +577,23 @@ impl ::protobuf::Message for MercuryRequest { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?; }, 3 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)?; }, 4 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -585,17 +604,17 @@ impl ::protobuf::Message for MercuryRequest { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.uri { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.uri.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; - for value in &self.content_type { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.content_type.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.body { - my_size += ::protobuf::rt::bytes_size(3, &value); + if let Some(v) = self.body.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); }; - for value in &self.etag { - my_size += ::protobuf::rt::bytes_size(4, &value); + if let Some(v) = self.etag.as_ref() { + my_size += ::protobuf::rt::bytes_size(4, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -604,18 +623,18 @@ impl ::protobuf::Message for MercuryRequest { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.uri.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; if let Some(v) = self.content_type.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.body.as_ref() { - try!(os.write_bytes(3, &v)); + os.write_bytes(3, &v)?; }; if let Some(v) = self.etag.as_ref() { - try!(os.write_bytes(4, &v)); + os.write_bytes(4, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -631,10 +650,6 @@ impl ::protobuf::Message for MercuryRequest { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -657,25 +672,25 @@ impl ::protobuf::MessageStatic for MercuryRequest { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - MercuryRequest::has_uri, - MercuryRequest::get_uri, + MercuryRequest::get_uri_for_reflect, + MercuryRequest::mut_uri_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "content_type", - MercuryRequest::has_content_type, - MercuryRequest::get_content_type, + MercuryRequest::get_content_type_for_reflect, + MercuryRequest::mut_content_type_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "body", - MercuryRequest::has_body, - MercuryRequest::get_body, + MercuryRequest::get_body_for_reflect, + MercuryRequest::mut_body_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "etag", - MercuryRequest::has_etag, - MercuryRequest::get_etag, + MercuryRequest::get_etag_for_reflect, + MercuryRequest::mut_etag_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryRequest", @@ -697,23 +712,19 @@ impl ::protobuf::Clear for MercuryRequest { } } -impl ::std::cmp::PartialEq for MercuryRequest { - fn eq(&self, other: &MercuryRequest) -> bool { - self.uri == other.uri && - self.content_type == other.content_type && - self.body == other.body && - self.etag == other.etag && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for MercuryRequest { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for MercuryRequest { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct MercuryReply { // message fields status_code: ::std::option::Option, @@ -725,7 +736,7 @@ pub struct MercuryReply { body: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -742,19 +753,7 @@ impl MercuryReply { ptr: 0 as *const MercuryReply, }; unsafe { - instance.get(|| { - MercuryReply { - status_code: ::std::option::Option::None, - status_message: ::protobuf::SingularField::none(), - cache_policy: ::std::option::Option::None, - ttl: ::std::option::Option::None, - etag: ::protobuf::SingularField::none(), - content_type: ::protobuf::SingularField::none(), - body: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(MercuryReply::new) } } @@ -777,6 +776,14 @@ impl MercuryReply { self.status_code.unwrap_or(0) } + fn get_status_code_for_reflect(&self) -> &::std::option::Option { + &self.status_code + } + + fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.status_code + } + // optional string status_message = 2; pub fn clear_status_message(&mut self) { @@ -813,6 +820,14 @@ impl MercuryReply { } } + fn get_status_message_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.status_message + } + + fn mut_status_message_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.status_message + } + // optional .MercuryReply.CachePolicy cache_policy = 3; pub fn clear_cache_policy(&mut self) { @@ -832,6 +847,14 @@ impl MercuryReply { self.cache_policy.unwrap_or(MercuryReply_CachePolicy::CACHE_NO) } + fn get_cache_policy_for_reflect(&self) -> &::std::option::Option { + &self.cache_policy + } + + fn mut_cache_policy_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.cache_policy + } + // optional sint32 ttl = 4; pub fn clear_ttl(&mut self) { @@ -851,6 +874,14 @@ impl MercuryReply { self.ttl.unwrap_or(0) } + fn get_ttl_for_reflect(&self) -> &::std::option::Option { + &self.ttl + } + + fn mut_ttl_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.ttl + } + // optional bytes etag = 5; pub fn clear_etag(&mut self) { @@ -887,6 +918,14 @@ impl MercuryReply { } } + fn get_etag_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.etag + } + + fn mut_etag_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.etag + } + // optional string content_type = 6; pub fn clear_content_type(&mut self) { @@ -923,6 +962,14 @@ impl MercuryReply { } } + fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.content_type + } + + fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.content_type + } + // optional bytes body = 7; pub fn clear_body(&mut self) { @@ -958,6 +1005,14 @@ impl MercuryReply { None => &[], } } + + fn get_body_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.body + } + + fn mut_body_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.body + } } impl ::protobuf::Message for MercuryReply { @@ -966,44 +1021,44 @@ impl ::protobuf::Message for MercuryReply { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.status_code = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.status_message)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.status_message)?; }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.cache_policy = ::std::option::Option::Some(tmp); }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.ttl = ::std::option::Option::Some(tmp); }, 5 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.etag)?; }, 6 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?; }, 7 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.body)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1014,26 +1069,26 @@ impl ::protobuf::Message for MercuryReply { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.status_code { - my_size += ::protobuf::rt::value_varint_zigzag_size(1, *value); + if let Some(v) = self.status_code { + my_size += ::protobuf::rt::value_varint_zigzag_size(1, v); }; - for value in &self.status_message { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.status_message.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.cache_policy { - my_size += ::protobuf::rt::enum_size(3, *value); + if let Some(v) = self.cache_policy { + my_size += ::protobuf::rt::enum_size(3, v); }; - for value in &self.ttl { - my_size += ::protobuf::rt::value_varint_zigzag_size(4, *value); + if let Some(v) = self.ttl { + my_size += ::protobuf::rt::value_varint_zigzag_size(4, v); }; - for value in &self.etag { - my_size += ::protobuf::rt::bytes_size(5, &value); + if let Some(v) = self.etag.as_ref() { + my_size += ::protobuf::rt::bytes_size(5, &v); }; - for value in &self.content_type { - my_size += ::protobuf::rt::string_size(6, &value); + if let Some(v) = self.content_type.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); }; - for value in &self.body { - my_size += ::protobuf::rt::bytes_size(7, &value); + if let Some(v) = self.body.as_ref() { + my_size += ::protobuf::rt::bytes_size(7, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -1042,27 +1097,27 @@ impl ::protobuf::Message for MercuryReply { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.status_code { - try!(os.write_sint32(1, v)); + os.write_sint32(1, v)?; }; if let Some(v) = self.status_message.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.cache_policy { - try!(os.write_enum(3, v.value())); + os.write_enum(3, v.value())?; }; if let Some(v) = self.ttl { - try!(os.write_sint32(4, v)); + os.write_sint32(4, v)?; }; if let Some(v) = self.etag.as_ref() { - try!(os.write_bytes(5, &v)); + os.write_bytes(5, &v)?; }; if let Some(v) = self.content_type.as_ref() { - try!(os.write_string(6, &v)); + os.write_string(6, &v)?; }; if let Some(v) = self.body.as_ref() { - try!(os.write_bytes(7, &v)); + os.write_bytes(7, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1078,10 +1133,6 @@ impl ::protobuf::Message for MercuryReply { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1104,40 +1155,40 @@ impl ::protobuf::MessageStatic for MercuryReply { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "status_code", - MercuryReply::has_status_code, - MercuryReply::get_status_code, + MercuryReply::get_status_code_for_reflect, + MercuryReply::mut_status_code_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "status_message", - MercuryReply::has_status_message, - MercuryReply::get_status_message, + MercuryReply::get_status_message_for_reflect, + MercuryReply::mut_status_message_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "cache_policy", - MercuryReply::has_cache_policy, - MercuryReply::get_cache_policy, + MercuryReply::get_cache_policy_for_reflect, + MercuryReply::mut_cache_policy_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "ttl", - MercuryReply::has_ttl, - MercuryReply::get_ttl, + MercuryReply::get_ttl_for_reflect, + MercuryReply::mut_ttl_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "etag", - MercuryReply::has_etag, - MercuryReply::get_etag, + MercuryReply::get_etag_for_reflect, + MercuryReply::mut_etag_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "content_type", - MercuryReply::has_content_type, - MercuryReply::get_content_type, + MercuryReply::get_content_type_for_reflect, + MercuryReply::mut_content_type_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "body", - MercuryReply::has_body, - MercuryReply::get_body, + MercuryReply::get_body_for_reflect, + MercuryReply::mut_body_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "MercuryReply", @@ -1162,25 +1213,18 @@ impl ::protobuf::Clear for MercuryReply { } } -impl ::std::cmp::PartialEq for MercuryReply { - fn eq(&self, other: &MercuryReply) -> bool { - self.status_code == other.status_code && - self.status_message == other.status_message && - self.cache_policy == other.cache_policy && - self.ttl == other.ttl && - self.etag == other.etag && - self.content_type == other.content_type && - self.body == other.body && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for MercuryReply { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for MercuryReply { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum MercuryReply_CachePolicy { CACHE_NO = 1, @@ -1227,7 +1271,13 @@ impl ::protobuf::ProtobufEnum for MercuryReply_CachePolicy { impl ::std::marker::Copy for MercuryReply_CachePolicy { } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for MercuryReply_CachePolicy { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Header { // message fields uri: ::protobuf::SingularField<::std::string::String>, @@ -1237,7 +1287,7 @@ pub struct Header { user_fields: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1254,17 +1304,7 @@ impl Header { ptr: 0 as *const Header, }; unsafe { - instance.get(|| { - Header { - uri: ::protobuf::SingularField::none(), - content_type: ::protobuf::SingularField::none(), - method: ::protobuf::SingularField::none(), - status_code: ::std::option::Option::None, - user_fields: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Header::new) } } @@ -1304,6 +1344,14 @@ impl Header { } } + fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.uri + } + + fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.uri + } + // optional string content_type = 2; pub fn clear_content_type(&mut self) { @@ -1340,6 +1388,14 @@ impl Header { } } + fn get_content_type_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.content_type + } + + fn mut_content_type_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.content_type + } + // optional string method = 3; pub fn clear_method(&mut self) { @@ -1376,6 +1432,14 @@ impl Header { } } + fn get_method_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.method + } + + fn mut_method_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.method + } + // optional sint32 status_code = 4; pub fn clear_status_code(&mut self) { @@ -1395,6 +1459,14 @@ impl Header { self.status_code.unwrap_or(0) } + fn get_status_code_for_reflect(&self) -> &::std::option::Option { + &self.status_code + } + + fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.status_code + } + // repeated .UserField user_fields = 6; pub fn clear_user_fields(&mut self) { @@ -1419,6 +1491,14 @@ impl Header { pub fn get_user_fields(&self) -> &[UserField] { &self.user_fields } + + fn get_user_fields_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.user_fields + } + + fn mut_user_fields_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.user_fields + } } impl ::protobuf::Message for Header { @@ -1427,30 +1507,30 @@ impl ::protobuf::Message for Header { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.content_type)?; }, 3 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.method)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.method)?; }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.status_code = ::std::option::Option::Some(tmp); }, 6 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.user_fields)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.user_fields)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1461,17 +1541,17 @@ impl ::protobuf::Message for Header { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.uri { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.uri.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; - for value in &self.content_type { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.content_type.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.method { - my_size += ::protobuf::rt::string_size(3, &value); + if let Some(v) = self.method.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); }; - for value in &self.status_code { - my_size += ::protobuf::rt::value_varint_zigzag_size(4, *value); + if let Some(v) = self.status_code { + my_size += ::protobuf::rt::value_varint_zigzag_size(4, v); }; for value in &self.user_fields { let len = value.compute_size(); @@ -1484,23 +1564,23 @@ impl ::protobuf::Message for Header { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.uri.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; if let Some(v) = self.content_type.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.method.as_ref() { - try!(os.write_string(3, &v)); + os.write_string(3, &v)?; }; if let Some(v) = self.status_code { - try!(os.write_sint32(4, v)); + os.write_sint32(4, v)?; }; for v in &self.user_fields { - try!(os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1516,10 +1596,6 @@ impl ::protobuf::Message for Header { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::
() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1542,29 +1618,30 @@ impl ::protobuf::MessageStatic for Header { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - Header::has_uri, - Header::get_uri, + Header::get_uri_for_reflect, + Header::mut_uri_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "content_type", - Header::has_content_type, - Header::get_content_type, + Header::get_content_type_for_reflect, + Header::mut_content_type_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "method", - Header::has_method, - Header::get_method, + Header::get_method_for_reflect, + Header::mut_method_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "status_code", - Header::has_status_code, - Header::get_status_code, + Header::get_status_code_for_reflect, + Header::mut_status_code_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "user_fields", - Header::get_user_fields, + Header::get_user_fields_for_reflect, + Header::mut_user_fields_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::
( "Header", @@ -1587,31 +1664,26 @@ impl ::protobuf::Clear for Header { } } -impl ::std::cmp::PartialEq for Header { - fn eq(&self, other: &Header) -> bool { - self.uri == other.uri && - self.content_type == other.content_type && - self.method == other.method && - self.status_code == other.status_code && - self.user_fields == other.user_fields && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Header { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Header { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct UserField { // message fields key: ::protobuf::SingularField<::std::string::String>, value: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1628,14 +1700,7 @@ impl UserField { ptr: 0 as *const UserField, }; unsafe { - instance.get(|| { - UserField { - key: ::protobuf::SingularField::none(), - value: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(UserField::new) } } @@ -1675,6 +1740,14 @@ impl UserField { } } + fn get_key_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.key + } + + fn mut_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.key + } + // optional bytes value = 2; pub fn clear_value(&mut self) { @@ -1710,6 +1783,14 @@ impl UserField { None => &[], } } + + fn get_value_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.value + } + + fn mut_value_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.value + } } impl ::protobuf::Message for UserField { @@ -1718,17 +1799,17 @@ impl ::protobuf::Message for UserField { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.key)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.key)?; }, 2 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1739,11 +1820,11 @@ impl ::protobuf::Message for UserField { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.key { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.key.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; - for value in &self.value { - my_size += ::protobuf::rt::bytes_size(2, &value); + if let Some(v) = self.value.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); @@ -1752,12 +1833,12 @@ impl ::protobuf::Message for UserField { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.key.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; if let Some(v) = self.value.as_ref() { - try!(os.write_bytes(2, &v)); + os.write_bytes(2, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1773,10 +1854,6 @@ impl ::protobuf::Message for UserField { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1799,15 +1876,15 @@ impl ::protobuf::MessageStatic for UserField { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "key", - UserField::has_key, - UserField::get_key, + UserField::get_key_for_reflect, + UserField::mut_key_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "value", - UserField::has_value, - UserField::get_value, + UserField::get_value_for_reflect, + UserField::mut_value_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "UserField", @@ -1827,20 +1904,18 @@ impl ::protobuf::Clear for UserField { } } -impl ::std::cmp::PartialEq for UserField { - fn eq(&self, other: &UserField) -> bool { - self.key == other.key && - self.value == other.value && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for UserField { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for UserField { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + static file_descriptor_proto_data: &'static [u8] = &[ 0x0a, 0x0d, 0x6d, 0x65, 0x72, 0x63, 0x75, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x16, 0x4d, 0x65, 0x72, 0x63, 0x75, 0x72, 0x79, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x47, diff --git a/protocol/src/metadata.rs b/protocol/src/metadata.rs index 6d1faa2a..8f2f832e 100644 --- a/protocol/src/metadata.rs +++ b/protocol/src/metadata.rs @@ -20,14 +20,14 @@ use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; -#[derive(Clone,Default)] +#[derive(PartialEq,Clone,Default)] pub struct TopTracks { // message fields country: ::protobuf::SingularField<::std::string::String>, track: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -44,14 +44,7 @@ impl TopTracks { ptr: 0 as *const TopTracks, }; unsafe { - instance.get(|| { - TopTracks { - country: ::protobuf::SingularField::none(), - track: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(TopTracks::new) } } @@ -91,6 +84,14 @@ impl TopTracks { } } + fn get_country_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.country + } + + fn mut_country_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.country + } + // repeated .Track track = 2; pub fn clear_track(&mut self) { @@ -115,6 +116,14 @@ impl TopTracks { pub fn get_track(&self) -> &[Track] { &self.track } + + fn get_track_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.track + } + + fn mut_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.track + } } impl ::protobuf::Message for TopTracks { @@ -123,17 +132,17 @@ impl ::protobuf::Message for TopTracks { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.country)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.country)?; }, 2 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -144,8 +153,8 @@ impl ::protobuf::Message for TopTracks { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.country { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.country.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; for value in &self.track { let len = value.compute_size(); @@ -158,14 +167,14 @@ impl ::protobuf::Message for TopTracks { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.country.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; for v in &self.track { - try!(os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -181,10 +190,6 @@ impl ::protobuf::Message for TopTracks { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -207,14 +212,15 @@ impl ::protobuf::MessageStatic for TopTracks { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "country", - TopTracks::has_country, - TopTracks::get_country, + TopTracks::get_country_for_reflect, + TopTracks::mut_country_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "track", - TopTracks::get_track, + TopTracks::get_track_for_reflect, + TopTracks::mut_track_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "TopTracks", @@ -234,21 +240,19 @@ impl ::protobuf::Clear for TopTracks { } } -impl ::std::cmp::PartialEq for TopTracks { - fn eq(&self, other: &TopTracks) -> bool { - self.country == other.country && - self.track == other.track && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for TopTracks { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for TopTracks { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct ActivityPeriod { // message fields start_year: ::std::option::Option, @@ -256,7 +260,7 @@ pub struct ActivityPeriod { decade: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -273,15 +277,7 @@ impl ActivityPeriod { ptr: 0 as *const ActivityPeriod, }; unsafe { - instance.get(|| { - ActivityPeriod { - start_year: ::std::option::Option::None, - end_year: ::std::option::Option::None, - decade: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ActivityPeriod::new) } } @@ -304,6 +300,14 @@ impl ActivityPeriod { self.start_year.unwrap_or(0) } + fn get_start_year_for_reflect(&self) -> &::std::option::Option { + &self.start_year + } + + fn mut_start_year_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.start_year + } + // optional sint32 end_year = 2; pub fn clear_end_year(&mut self) { @@ -323,6 +327,14 @@ impl ActivityPeriod { self.end_year.unwrap_or(0) } + fn get_end_year_for_reflect(&self) -> &::std::option::Option { + &self.end_year + } + + fn mut_end_year_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.end_year + } + // optional sint32 decade = 3; pub fn clear_decade(&mut self) { @@ -341,6 +353,14 @@ impl ActivityPeriod { pub fn get_decade(&self) -> i32 { self.decade.unwrap_or(0) } + + fn get_decade_for_reflect(&self) -> &::std::option::Option { + &self.decade + } + + fn mut_decade_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.decade + } } impl ::protobuf::Message for ActivityPeriod { @@ -349,32 +369,32 @@ impl ::protobuf::Message for ActivityPeriod { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.start_year = ::std::option::Option::Some(tmp); }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.end_year = ::std::option::Option::Some(tmp); }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.decade = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -385,14 +405,14 @@ impl ::protobuf::Message for ActivityPeriod { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.start_year { - my_size += ::protobuf::rt::value_varint_zigzag_size(1, *value); + if let Some(v) = self.start_year { + my_size += ::protobuf::rt::value_varint_zigzag_size(1, v); }; - for value in &self.end_year { - my_size += ::protobuf::rt::value_varint_zigzag_size(2, *value); + if let Some(v) = self.end_year { + my_size += ::protobuf::rt::value_varint_zigzag_size(2, v); }; - for value in &self.decade { - my_size += ::protobuf::rt::value_varint_zigzag_size(3, *value); + if let Some(v) = self.decade { + my_size += ::protobuf::rt::value_varint_zigzag_size(3, v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -401,15 +421,15 @@ impl ::protobuf::Message for ActivityPeriod { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.start_year { - try!(os.write_sint32(1, v)); + os.write_sint32(1, v)?; }; if let Some(v) = self.end_year { - try!(os.write_sint32(2, v)); + os.write_sint32(2, v)?; }; if let Some(v) = self.decade { - try!(os.write_sint32(3, v)); + os.write_sint32(3, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -425,10 +445,6 @@ impl ::protobuf::Message for ActivityPeriod { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -451,20 +467,20 @@ impl ::protobuf::MessageStatic for ActivityPeriod { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "start_year", - ActivityPeriod::has_start_year, - ActivityPeriod::get_start_year, + ActivityPeriod::get_start_year_for_reflect, + ActivityPeriod::mut_start_year_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "end_year", - ActivityPeriod::has_end_year, - ActivityPeriod::get_end_year, + ActivityPeriod::get_end_year_for_reflect, + ActivityPeriod::mut_end_year_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "decade", - ActivityPeriod::has_decade, - ActivityPeriod::get_decade, + ActivityPeriod::get_decade_for_reflect, + ActivityPeriod::mut_decade_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ActivityPeriod", @@ -485,22 +501,19 @@ impl ::protobuf::Clear for ActivityPeriod { } } -impl ::std::cmp::PartialEq for ActivityPeriod { - fn eq(&self, other: &ActivityPeriod) -> bool { - self.start_year == other.start_year && - self.end_year == other.end_year && - self.decade == other.decade && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ActivityPeriod { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ActivityPeriod { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Artist { // message fields gid: ::protobuf::SingularField<::std::vec::Vec>, @@ -522,7 +535,7 @@ pub struct Artist { portrait_group: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -539,29 +552,7 @@ impl Artist { ptr: 0 as *const Artist, }; unsafe { - instance.get(|| { - Artist { - gid: ::protobuf::SingularField::none(), - name: ::protobuf::SingularField::none(), - popularity: ::std::option::Option::None, - top_track: ::protobuf::RepeatedField::new(), - album_group: ::protobuf::RepeatedField::new(), - single_group: ::protobuf::RepeatedField::new(), - compilation_group: ::protobuf::RepeatedField::new(), - appears_on_group: ::protobuf::RepeatedField::new(), - genre: ::protobuf::RepeatedField::new(), - external_id: ::protobuf::RepeatedField::new(), - portrait: ::protobuf::RepeatedField::new(), - biography: ::protobuf::RepeatedField::new(), - activity_period: ::protobuf::RepeatedField::new(), - restriction: ::protobuf::RepeatedField::new(), - related: ::protobuf::RepeatedField::new(), - is_portrait_album_cover: ::std::option::Option::None, - portrait_group: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Artist::new) } } @@ -601,6 +592,14 @@ impl Artist { } } + fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gid + } + + fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gid + } + // optional string name = 2; pub fn clear_name(&mut self) { @@ -637,6 +636,14 @@ impl Artist { } } + fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.name + } + + fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.name + } + // optional sint32 popularity = 3; pub fn clear_popularity(&mut self) { @@ -656,6 +663,14 @@ impl Artist { self.popularity.unwrap_or(0) } + fn get_popularity_for_reflect(&self) -> &::std::option::Option { + &self.popularity + } + + fn mut_popularity_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.popularity + } + // repeated .TopTracks top_track = 4; pub fn clear_top_track(&mut self) { @@ -681,6 +696,14 @@ impl Artist { &self.top_track } + fn get_top_track_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.top_track + } + + fn mut_top_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.top_track + } + // repeated .AlbumGroup album_group = 5; pub fn clear_album_group(&mut self) { @@ -706,6 +729,14 @@ impl Artist { &self.album_group } + fn get_album_group_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.album_group + } + + fn mut_album_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.album_group + } + // repeated .AlbumGroup single_group = 6; pub fn clear_single_group(&mut self) { @@ -731,6 +762,14 @@ impl Artist { &self.single_group } + fn get_single_group_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.single_group + } + + fn mut_single_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.single_group + } + // repeated .AlbumGroup compilation_group = 7; pub fn clear_compilation_group(&mut self) { @@ -756,6 +795,14 @@ impl Artist { &self.compilation_group } + fn get_compilation_group_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.compilation_group + } + + fn mut_compilation_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.compilation_group + } + // repeated .AlbumGroup appears_on_group = 8; pub fn clear_appears_on_group(&mut self) { @@ -781,6 +828,14 @@ impl Artist { &self.appears_on_group } + fn get_appears_on_group_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.appears_on_group + } + + fn mut_appears_on_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.appears_on_group + } + // repeated string genre = 9; pub fn clear_genre(&mut self) { @@ -806,6 +861,14 @@ impl Artist { &self.genre } + fn get_genre_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { + &self.genre + } + + fn mut_genre_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.genre + } + // repeated .ExternalId external_id = 10; pub fn clear_external_id(&mut self) { @@ -831,6 +894,14 @@ impl Artist { &self.external_id } + fn get_external_id_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.external_id + } + + fn mut_external_id_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.external_id + } + // repeated .Image portrait = 11; pub fn clear_portrait(&mut self) { @@ -856,6 +927,14 @@ impl Artist { &self.portrait } + fn get_portrait_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.portrait + } + + fn mut_portrait_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.portrait + } + // repeated .Biography biography = 12; pub fn clear_biography(&mut self) { @@ -881,6 +960,14 @@ impl Artist { &self.biography } + fn get_biography_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.biography + } + + fn mut_biography_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.biography + } + // repeated .ActivityPeriod activity_period = 13; pub fn clear_activity_period(&mut self) { @@ -906,6 +993,14 @@ impl Artist { &self.activity_period } + fn get_activity_period_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.activity_period + } + + fn mut_activity_period_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.activity_period + } + // repeated .Restriction restriction = 14; pub fn clear_restriction(&mut self) { @@ -931,6 +1026,14 @@ impl Artist { &self.restriction } + fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.restriction + } + + fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.restriction + } + // repeated .Artist related = 15; pub fn clear_related(&mut self) { @@ -956,6 +1059,14 @@ impl Artist { &self.related } + fn get_related_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.related + } + + fn mut_related_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.related + } + // optional bool is_portrait_album_cover = 16; pub fn clear_is_portrait_album_cover(&mut self) { @@ -975,6 +1086,14 @@ impl Artist { self.is_portrait_album_cover.unwrap_or(false) } + fn get_is_portrait_album_cover_for_reflect(&self) -> &::std::option::Option { + &self.is_portrait_album_cover + } + + fn mut_is_portrait_album_cover_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.is_portrait_album_cover + } + // optional .ImageGroup portrait_group = 17; pub fn clear_portrait_group(&mut self) { @@ -1007,6 +1126,14 @@ impl Artist { pub fn get_portrait_group(&self) -> &ImageGroup { self.portrait_group.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) } + + fn get_portrait_group_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.portrait_group + } + + fn mut_portrait_group_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.portrait_group + } } impl ::protobuf::Message for Artist { @@ -1015,70 +1142,70 @@ impl ::protobuf::Message for Artist { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)); + ::protobuf::rt::read_singular_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 = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.popularity = ::std::option::Option::Some(tmp); }, 4 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.top_track)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.top_track)?; }, 5 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.album_group)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.album_group)?; }, 6 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.single_group)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.single_group)?; }, 7 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.compilation_group)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.compilation_group)?; }, 8 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.appears_on_group)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.appears_on_group)?; }, 9 => { - try!(::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.genre)); + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.genre)?; }, 10 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.external_id)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.external_id)?; }, 11 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.portrait)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.portrait)?; }, 12 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.biography)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.biography)?; }, 13 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.activity_period)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.activity_period)?; }, 14 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)?; }, 15 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.related)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.related)?; }, 16 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.is_portrait_album_cover = ::std::option::Option::Some(tmp); }, 17 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.portrait_group)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.portrait_group)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1089,14 +1216,14 @@ impl ::protobuf::Message for Artist { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.gid { - my_size += ::protobuf::rt::bytes_size(1, &value); + if let Some(v) = self.gid.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); }; - for value in &self.name { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.popularity { - my_size += ::protobuf::rt::value_varint_zigzag_size(3, *value); + if let Some(v) = self.popularity { + my_size += ::protobuf::rt::value_varint_zigzag_size(3, v); }; for value in &self.top_track { let len = value.compute_size(); @@ -1145,11 +1272,11 @@ impl ::protobuf::Message for Artist { let len = value.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - if self.is_portrait_album_cover.is_some() { + if let Some(v) = self.is_portrait_album_cover { my_size += 3; }; - for value in &self.portrait_group { - let len = value.compute_size(); + if let Some(v) = self.portrait_group.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -1159,81 +1286,81 @@ impl ::protobuf::Message for Artist { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.gid.as_ref() { - try!(os.write_bytes(1, &v)); + os.write_bytes(1, &v)?; }; if let Some(v) = self.name.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.popularity { - try!(os.write_sint32(3, v)); + os.write_sint32(3, v)?; }; for v in &self.top_track { - try!(os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.album_group { - try!(os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.single_group { - try!(os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.compilation_group { - try!(os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.appears_on_group { - try!(os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(8, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.genre { - try!(os.write_string(9, &v)); + os.write_string(9, &v)?; }; for v in &self.external_id { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.portrait { - try!(os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.biography { - try!(os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.activity_period { - try!(os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.restriction { - try!(os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.related { - try!(os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.is_portrait_album_cover { - try!(os.write_bool(16, v)); + os.write_bool(16, v)?; }; if let Some(v) = self.portrait_group.as_ref() { - try!(os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1249,10 +1376,6 @@ impl ::protobuf::Message for Artist { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1275,78 +1398,90 @@ impl ::protobuf::MessageStatic for Artist { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Artist::has_gid, - Artist::get_gid, + Artist::get_gid_for_reflect, + Artist::mut_gid_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Artist::has_name, - Artist::get_name, + Artist::get_name_for_reflect, + Artist::mut_name_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "popularity", - Artist::has_popularity, - Artist::get_popularity, + Artist::get_popularity_for_reflect, + Artist::mut_popularity_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "top_track", - Artist::get_top_track, + Artist::get_top_track_for_reflect, + Artist::mut_top_track_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "album_group", - Artist::get_album_group, + Artist::get_album_group_for_reflect, + Artist::mut_album_group_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "single_group", - Artist::get_single_group, + Artist::get_single_group_for_reflect, + Artist::mut_single_group_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "compilation_group", - Artist::get_compilation_group, + Artist::get_compilation_group_for_reflect, + Artist::mut_compilation_group_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "appears_on_group", - Artist::get_appears_on_group, + Artist::get_appears_on_group_for_reflect, + Artist::mut_appears_on_group_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_string_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "genre", - Artist::get_genre, + Artist::get_genre_for_reflect, + Artist::mut_genre_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "external_id", - Artist::get_external_id, + Artist::get_external_id_for_reflect, + Artist::mut_external_id_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait", - Artist::get_portrait, + Artist::get_portrait_for_reflect, + Artist::mut_portrait_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "biography", - Artist::get_biography, + Artist::get_biography_for_reflect, + Artist::mut_biography_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "activity_period", - Artist::get_activity_period, + Artist::get_activity_period_for_reflect, + Artist::mut_activity_period_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - Artist::get_restriction, + Artist::get_restriction_for_reflect, + Artist::mut_restriction_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "related", - Artist::get_related, + Artist::get_related_for_reflect, + Artist::mut_related_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "is_portrait_album_cover", - Artist::has_is_portrait_album_cover, - Artist::get_is_portrait_album_cover, + Artist::get_is_portrait_album_cover_for_reflect, + Artist::mut_is_portrait_album_cover_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait_group", - Artist::has_portrait_group, - Artist::get_portrait_group, + Artist::get_portrait_group_for_reflect, + Artist::mut_portrait_group_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Artist", @@ -1381,42 +1516,25 @@ impl ::protobuf::Clear for Artist { } } -impl ::std::cmp::PartialEq for Artist { - fn eq(&self, other: &Artist) -> bool { - self.gid == other.gid && - self.name == other.name && - self.popularity == other.popularity && - self.top_track == other.top_track && - self.album_group == other.album_group && - self.single_group == other.single_group && - self.compilation_group == other.compilation_group && - self.appears_on_group == other.appears_on_group && - self.genre == other.genre && - self.external_id == other.external_id && - self.portrait == other.portrait && - self.biography == other.biography && - self.activity_period == other.activity_period && - self.restriction == other.restriction && - self.related == other.related && - self.is_portrait_album_cover == other.is_portrait_album_cover && - self.portrait_group == other.portrait_group && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Artist { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Artist { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct AlbumGroup { // message fields album: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1433,13 +1551,7 @@ impl AlbumGroup { ptr: 0 as *const AlbumGroup, }; unsafe { - instance.get(|| { - AlbumGroup { - album: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(AlbumGroup::new) } } @@ -1467,6 +1579,14 @@ impl AlbumGroup { pub fn get_album(&self) -> &[Album] { &self.album } + + fn get_album_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.album + } + + fn mut_album_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.album + } } impl ::protobuf::Message for AlbumGroup { @@ -1475,14 +1595,14 @@ impl ::protobuf::Message for AlbumGroup { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.album)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.album)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1504,11 +1624,11 @@ impl ::protobuf::Message for AlbumGroup { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { for v in &self.album { - try!(os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1524,10 +1644,6 @@ impl ::protobuf::Message for AlbumGroup { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1550,9 +1666,10 @@ impl ::protobuf::MessageStatic for AlbumGroup { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "album", - AlbumGroup::get_album, + AlbumGroup::get_album_for_reflect, + AlbumGroup::mut_album_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "AlbumGroup", @@ -1571,20 +1688,19 @@ impl ::protobuf::Clear for AlbumGroup { } } -impl ::std::cmp::PartialEq for AlbumGroup { - fn eq(&self, other: &AlbumGroup) -> bool { - self.album == other.album && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for AlbumGroup { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for AlbumGroup { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Date { // message fields year: ::std::option::Option, @@ -1592,7 +1708,7 @@ pub struct Date { day: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1609,15 +1725,7 @@ impl Date { ptr: 0 as *const Date, }; unsafe { - instance.get(|| { - Date { - year: ::std::option::Option::None, - month: ::std::option::Option::None, - day: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Date::new) } } @@ -1640,6 +1748,14 @@ impl Date { self.year.unwrap_or(0) } + fn get_year_for_reflect(&self) -> &::std::option::Option { + &self.year + } + + fn mut_year_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.year + } + // optional sint32 month = 2; pub fn clear_month(&mut self) { @@ -1659,6 +1775,14 @@ impl Date { self.month.unwrap_or(0) } + fn get_month_for_reflect(&self) -> &::std::option::Option { + &self.month + } + + fn mut_month_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.month + } + // optional sint32 day = 3; pub fn clear_day(&mut self) { @@ -1677,6 +1801,14 @@ impl Date { pub fn get_day(&self) -> i32 { self.day.unwrap_or(0) } + + fn get_day_for_reflect(&self) -> &::std::option::Option { + &self.day + } + + fn mut_day_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.day + } } impl ::protobuf::Message for Date { @@ -1685,32 +1817,32 @@ impl ::protobuf::Message for Date { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.year = ::std::option::Option::Some(tmp); }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.month = ::std::option::Option::Some(tmp); }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.day = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1721,14 +1853,14 @@ impl ::protobuf::Message for Date { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.year { - my_size += ::protobuf::rt::value_varint_zigzag_size(1, *value); + if let Some(v) = self.year { + my_size += ::protobuf::rt::value_varint_zigzag_size(1, v); }; - for value in &self.month { - my_size += ::protobuf::rt::value_varint_zigzag_size(2, *value); + if let Some(v) = self.month { + my_size += ::protobuf::rt::value_varint_zigzag_size(2, v); }; - for value in &self.day { - my_size += ::protobuf::rt::value_varint_zigzag_size(3, *value); + if let Some(v) = self.day { + my_size += ::protobuf::rt::value_varint_zigzag_size(3, v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -1737,15 +1869,15 @@ impl ::protobuf::Message for Date { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.year { - try!(os.write_sint32(1, v)); + os.write_sint32(1, v)?; }; if let Some(v) = self.month { - try!(os.write_sint32(2, v)); + os.write_sint32(2, v)?; }; if let Some(v) = self.day { - try!(os.write_sint32(3, v)); + os.write_sint32(3, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1761,10 +1893,6 @@ impl ::protobuf::Message for Date { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1787,20 +1915,20 @@ impl ::protobuf::MessageStatic for Date { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "year", - Date::has_year, - Date::get_year, + Date::get_year_for_reflect, + Date::mut_year_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "month", - Date::has_month, - Date::get_month, + Date::get_month_for_reflect, + Date::mut_month_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "day", - Date::has_day, - Date::get_day, + Date::get_day_for_reflect, + Date::mut_day_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Date", @@ -1821,22 +1949,19 @@ impl ::protobuf::Clear for Date { } } -impl ::std::cmp::PartialEq for Date { - fn eq(&self, other: &Date) -> bool { - self.year == other.year && - self.month == other.month && - self.day == other.day && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Date { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Date { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Album { // message fields gid: ::protobuf::SingularField<::std::vec::Vec>, @@ -1858,7 +1983,7 @@ pub struct Album { cover_group: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1875,29 +2000,7 @@ impl Album { ptr: 0 as *const Album, }; unsafe { - instance.get(|| { - Album { - gid: ::protobuf::SingularField::none(), - name: ::protobuf::SingularField::none(), - artist: ::protobuf::RepeatedField::new(), - typ: ::std::option::Option::None, - label: ::protobuf::SingularField::none(), - date: ::protobuf::SingularPtrField::none(), - popularity: ::std::option::Option::None, - genre: ::protobuf::RepeatedField::new(), - cover: ::protobuf::RepeatedField::new(), - external_id: ::protobuf::RepeatedField::new(), - disc: ::protobuf::RepeatedField::new(), - review: ::protobuf::RepeatedField::new(), - copyright: ::protobuf::RepeatedField::new(), - restriction: ::protobuf::RepeatedField::new(), - related: ::protobuf::RepeatedField::new(), - sale_period: ::protobuf::RepeatedField::new(), - cover_group: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Album::new) } } @@ -1937,6 +2040,14 @@ impl Album { } } + fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gid + } + + fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gid + } + // optional string name = 2; pub fn clear_name(&mut self) { @@ -1973,6 +2084,14 @@ impl Album { } } + fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.name + } + + fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.name + } + // repeated .Artist artist = 3; pub fn clear_artist(&mut self) { @@ -1998,6 +2117,14 @@ impl Album { &self.artist } + fn get_artist_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.artist + } + + fn mut_artist_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.artist + } + // optional .Album.Type typ = 4; pub fn clear_typ(&mut self) { @@ -2017,6 +2144,14 @@ impl Album { self.typ.unwrap_or(Album_Type::ALBUM) } + fn get_typ_for_reflect(&self) -> &::std::option::Option { + &self.typ + } + + fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.typ + } + // optional string label = 5; pub fn clear_label(&mut self) { @@ -2053,6 +2188,14 @@ impl Album { } } + fn get_label_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.label + } + + fn mut_label_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.label + } + // optional .Date date = 6; pub fn clear_date(&mut self) { @@ -2086,6 +2229,14 @@ impl Album { self.date.as_ref().unwrap_or_else(|| Date::default_instance()) } + fn get_date_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.date + } + + fn mut_date_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.date + } + // optional sint32 popularity = 7; pub fn clear_popularity(&mut self) { @@ -2105,6 +2256,14 @@ impl Album { self.popularity.unwrap_or(0) } + fn get_popularity_for_reflect(&self) -> &::std::option::Option { + &self.popularity + } + + fn mut_popularity_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.popularity + } + // repeated string genre = 8; pub fn clear_genre(&mut self) { @@ -2130,6 +2289,14 @@ impl Album { &self.genre } + fn get_genre_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { + &self.genre + } + + fn mut_genre_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.genre + } + // repeated .Image cover = 9; pub fn clear_cover(&mut self) { @@ -2155,6 +2322,14 @@ impl Album { &self.cover } + fn get_cover_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.cover + } + + fn mut_cover_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.cover + } + // repeated .ExternalId external_id = 10; pub fn clear_external_id(&mut self) { @@ -2180,6 +2355,14 @@ impl Album { &self.external_id } + fn get_external_id_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.external_id + } + + fn mut_external_id_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.external_id + } + // repeated .Disc disc = 11; pub fn clear_disc(&mut self) { @@ -2205,6 +2388,14 @@ impl Album { &self.disc } + fn get_disc_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.disc + } + + fn mut_disc_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.disc + } + // repeated string review = 12; pub fn clear_review(&mut self) { @@ -2230,6 +2421,14 @@ impl Album { &self.review } + fn get_review_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { + &self.review + } + + fn mut_review_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.review + } + // repeated .Copyright copyright = 13; pub fn clear_copyright(&mut self) { @@ -2255,6 +2454,14 @@ impl Album { &self.copyright } + fn get_copyright_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.copyright + } + + fn mut_copyright_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.copyright + } + // repeated .Restriction restriction = 14; pub fn clear_restriction(&mut self) { @@ -2280,6 +2487,14 @@ impl Album { &self.restriction } + fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.restriction + } + + fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.restriction + } + // repeated .Album related = 15; pub fn clear_related(&mut self) { @@ -2305,6 +2520,14 @@ impl Album { &self.related } + fn get_related_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.related + } + + fn mut_related_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.related + } + // repeated .SalePeriod sale_period = 16; pub fn clear_sale_period(&mut self) { @@ -2330,6 +2553,14 @@ impl Album { &self.sale_period } + fn get_sale_period_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.sale_period + } + + fn mut_sale_period_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.sale_period + } + // optional .ImageGroup cover_group = 17; pub fn clear_cover_group(&mut self) { @@ -2362,6 +2593,14 @@ impl Album { pub fn get_cover_group(&self) -> &ImageGroup { self.cover_group.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) } + + fn get_cover_group_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.cover_group + } + + fn mut_cover_group_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.cover_group + } } impl ::protobuf::Message for Album { @@ -2370,70 +2609,70 @@ impl ::protobuf::Message for Album { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; }, 3 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.artist)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.artist)?; }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.typ = ::std::option::Option::Some(tmp); }, 5 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.label)?; }, 6 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.date)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.date)?; }, 7 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.popularity = ::std::option::Option::Some(tmp); }, 8 => { - try!(::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.genre)); + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.genre)?; }, 9 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.cover)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.cover)?; }, 10 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.external_id)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.external_id)?; }, 11 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.disc)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.disc)?; }, 12 => { - try!(::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.review)); + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.review)?; }, 13 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.copyright)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.copyright)?; }, 14 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)?; }, 15 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.related)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.related)?; }, 16 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.sale_period)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.sale_period)?; }, 17 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.cover_group)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.cover_group)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2444,28 +2683,28 @@ impl ::protobuf::Message for Album { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.gid { - my_size += ::protobuf::rt::bytes_size(1, &value); + if let Some(v) = self.gid.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); }; - for value in &self.name { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; for value in &self.artist { let len = value.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.typ { - my_size += ::protobuf::rt::enum_size(4, *value); + if let Some(v) = self.typ { + my_size += ::protobuf::rt::enum_size(4, v); }; - for value in &self.label { - my_size += ::protobuf::rt::string_size(5, &value); + if let Some(v) = self.label.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); }; - for value in &self.date { - let len = value.compute_size(); + if let Some(v) = self.date.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.popularity { - my_size += ::protobuf::rt::value_varint_zigzag_size(7, *value); + if let Some(v) = self.popularity { + my_size += ::protobuf::rt::value_varint_zigzag_size(7, v); }; for value in &self.genre { my_size += ::protobuf::rt::string_size(8, &value); @@ -2501,8 +2740,8 @@ impl ::protobuf::Message for Album { let len = value.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.cover_group { - let len = value.compute_size(); + if let Some(v) = self.cover_group.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -2512,77 +2751,77 @@ impl ::protobuf::Message for Album { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.gid.as_ref() { - try!(os.write_bytes(1, &v)); + os.write_bytes(1, &v)?; }; if let Some(v) = self.name.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; for v in &self.artist { - try!(os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.typ { - try!(os.write_enum(4, v.value())); + os.write_enum(4, v.value())?; }; if let Some(v) = self.label.as_ref() { - try!(os.write_string(5, &v)); + os.write_string(5, &v)?; }; if let Some(v) = self.date.as_ref() { - try!(os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.popularity { - try!(os.write_sint32(7, v)); + os.write_sint32(7, v)?; }; for v in &self.genre { - try!(os.write_string(8, &v)); + os.write_string(8, &v)?; }; for v in &self.cover { - try!(os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(9, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.external_id { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.disc { - try!(os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.review { - try!(os.write_string(12, &v)); + os.write_string(12, &v)?; }; for v in &self.copyright { - try!(os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.restriction { - try!(os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.related { - try!(os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.sale_period { - try!(os.write_tag(16, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(16, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.cover_group.as_ref() { - try!(os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2598,10 +2837,6 @@ impl ::protobuf::Message for Album { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2624,80 +2859,90 @@ impl ::protobuf::MessageStatic for Album { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Album::has_gid, - Album::get_gid, + Album::get_gid_for_reflect, + Album::mut_gid_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Album::has_name, - Album::get_name, + Album::get_name_for_reflect, + Album::mut_name_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "artist", - Album::get_artist, + Album::get_artist_for_reflect, + Album::mut_artist_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Album::has_typ, - Album::get_typ, + Album::get_typ_for_reflect, + Album::mut_typ_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "label", - Album::has_label, - Album::get_label, + Album::get_label_for_reflect, + Album::mut_label_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "date", - Album::has_date, - Album::get_date, + Album::get_date_for_reflect, + Album::mut_date_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "popularity", - Album::has_popularity, - Album::get_popularity, + Album::get_popularity_for_reflect, + Album::mut_popularity_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_string_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "genre", - Album::get_genre, + Album::get_genre_for_reflect, + Album::mut_genre_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "cover", - Album::get_cover, + Album::get_cover_for_reflect, + Album::mut_cover_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "external_id", - Album::get_external_id, + Album::get_external_id_for_reflect, + Album::mut_external_id_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "disc", - Album::get_disc, + Album::get_disc_for_reflect, + Album::mut_disc_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_string_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "review", - Album::get_review, + Album::get_review_for_reflect, + Album::mut_review_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "copyright", - Album::get_copyright, + Album::get_copyright_for_reflect, + Album::mut_copyright_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - Album::get_restriction, + Album::get_restriction_for_reflect, + Album::mut_restriction_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "related", - Album::get_related, + Album::get_related_for_reflect, + Album::mut_related_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "sale_period", - Album::get_sale_period, + Album::get_sale_period_for_reflect, + Album::mut_sale_period_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "cover_group", - Album::has_cover_group, - Album::get_cover_group, + Album::get_cover_group_for_reflect, + Album::mut_cover_group_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Album", @@ -2732,35 +2977,18 @@ impl ::protobuf::Clear for Album { } } -impl ::std::cmp::PartialEq for Album { - fn eq(&self, other: &Album) -> bool { - self.gid == other.gid && - self.name == other.name && - self.artist == other.artist && - self.typ == other.typ && - self.label == other.label && - self.date == other.date && - self.popularity == other.popularity && - self.genre == other.genre && - self.cover == other.cover && - self.external_id == other.external_id && - self.disc == other.disc && - self.review == other.review && - self.copyright == other.copyright && - self.restriction == other.restriction && - self.related == other.related && - self.sale_period == other.sale_period && - self.cover_group == other.cover_group && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Album { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for Album { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Album_Type { ALBUM = 1, @@ -2807,7 +3035,13 @@ impl ::protobuf::ProtobufEnum for Album_Type { impl ::std::marker::Copy for Album_Type { } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Album_Type { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Track { // message fields gid: ::protobuf::SingularField<::std::vec::Vec>, @@ -2827,7 +3061,7 @@ pub struct Track { preview: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2844,27 +3078,7 @@ impl Track { ptr: 0 as *const Track, }; unsafe { - instance.get(|| { - Track { - gid: ::protobuf::SingularField::none(), - name: ::protobuf::SingularField::none(), - album: ::protobuf::SingularPtrField::none(), - artist: ::protobuf::RepeatedField::new(), - number: ::std::option::Option::None, - disc_number: ::std::option::Option::None, - duration: ::std::option::Option::None, - popularity: ::std::option::Option::None, - explicit: ::std::option::Option::None, - external_id: ::protobuf::RepeatedField::new(), - restriction: ::protobuf::RepeatedField::new(), - file: ::protobuf::RepeatedField::new(), - alternative: ::protobuf::RepeatedField::new(), - sale_period: ::protobuf::RepeatedField::new(), - preview: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Track::new) } } @@ -2904,6 +3118,14 @@ impl Track { } } + fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gid + } + + fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gid + } + // optional string name = 2; pub fn clear_name(&mut self) { @@ -2940,6 +3162,14 @@ impl Track { } } + fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.name + } + + fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.name + } + // optional .Album album = 3; pub fn clear_album(&mut self) { @@ -2973,6 +3203,14 @@ impl Track { self.album.as_ref().unwrap_or_else(|| Album::default_instance()) } + fn get_album_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.album + } + + fn mut_album_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.album + } + // repeated .Artist artist = 4; pub fn clear_artist(&mut self) { @@ -2998,6 +3236,14 @@ impl Track { &self.artist } + fn get_artist_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.artist + } + + fn mut_artist_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.artist + } + // optional sint32 number = 5; pub fn clear_number(&mut self) { @@ -3017,6 +3263,14 @@ impl Track { self.number.unwrap_or(0) } + fn get_number_for_reflect(&self) -> &::std::option::Option { + &self.number + } + + fn mut_number_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.number + } + // optional sint32 disc_number = 6; pub fn clear_disc_number(&mut self) { @@ -3036,6 +3290,14 @@ impl Track { self.disc_number.unwrap_or(0) } + fn get_disc_number_for_reflect(&self) -> &::std::option::Option { + &self.disc_number + } + + fn mut_disc_number_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.disc_number + } + // optional sint32 duration = 7; pub fn clear_duration(&mut self) { @@ -3055,6 +3317,14 @@ impl Track { self.duration.unwrap_or(0) } + fn get_duration_for_reflect(&self) -> &::std::option::Option { + &self.duration + } + + fn mut_duration_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.duration + } + // optional sint32 popularity = 8; pub fn clear_popularity(&mut self) { @@ -3074,6 +3344,14 @@ impl Track { self.popularity.unwrap_or(0) } + fn get_popularity_for_reflect(&self) -> &::std::option::Option { + &self.popularity + } + + fn mut_popularity_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.popularity + } + // optional bool explicit = 9; pub fn clear_explicit(&mut self) { @@ -3093,6 +3371,14 @@ impl Track { self.explicit.unwrap_or(false) } + fn get_explicit_for_reflect(&self) -> &::std::option::Option { + &self.explicit + } + + fn mut_explicit_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.explicit + } + // repeated .ExternalId external_id = 10; pub fn clear_external_id(&mut self) { @@ -3118,6 +3404,14 @@ impl Track { &self.external_id } + fn get_external_id_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.external_id + } + + fn mut_external_id_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.external_id + } + // repeated .Restriction restriction = 11; pub fn clear_restriction(&mut self) { @@ -3143,6 +3437,14 @@ impl Track { &self.restriction } + fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.restriction + } + + fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.restriction + } + // repeated .AudioFile file = 12; pub fn clear_file(&mut self) { @@ -3168,6 +3470,14 @@ impl Track { &self.file } + fn get_file_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.file + } + + fn mut_file_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.file + } + // repeated .Track alternative = 13; pub fn clear_alternative(&mut self) { @@ -3193,6 +3503,14 @@ impl Track { &self.alternative } + fn get_alternative_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.alternative + } + + fn mut_alternative_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.alternative + } + // repeated .SalePeriod sale_period = 14; pub fn clear_sale_period(&mut self) { @@ -3218,6 +3536,14 @@ impl Track { &self.sale_period } + fn get_sale_period_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.sale_period + } + + fn mut_sale_period_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.sale_period + } + // repeated .AudioFile preview = 15; pub fn clear_preview(&mut self) { @@ -3242,6 +3568,14 @@ impl Track { pub fn get_preview(&self) -> &[AudioFile] { &self.preview } + + fn get_preview_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.preview + } + + fn mut_preview_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.preview + } } impl ::protobuf::Message for Track { @@ -3250,76 +3584,76 @@ impl ::protobuf::Message for Track { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; }, 3 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.album)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.album)?; }, 4 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.artist)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.artist)?; }, 5 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.number = ::std::option::Option::Some(tmp); }, 6 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.disc_number = ::std::option::Option::Some(tmp); }, 7 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.duration = ::std::option::Option::Some(tmp); }, 8 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.popularity = ::std::option::Option::Some(tmp); }, 9 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.explicit = ::std::option::Option::Some(tmp); }, 10 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.external_id)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.external_id)?; }, 11 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)?; }, 12 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.file)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.file)?; }, 13 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.alternative)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.alternative)?; }, 14 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.sale_period)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.sale_period)?; }, 15 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.preview)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.preview)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3330,33 +3664,33 @@ impl ::protobuf::Message for Track { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.gid { - my_size += ::protobuf::rt::bytes_size(1, &value); + if let Some(v) = self.gid.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); }; - for value in &self.name { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.album { - let len = value.compute_size(); + if let Some(v) = self.album.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; for value in &self.artist { let len = value.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.number { - my_size += ::protobuf::rt::value_varint_zigzag_size(5, *value); + if let Some(v) = self.number { + my_size += ::protobuf::rt::value_varint_zigzag_size(5, v); }; - for value in &self.disc_number { - my_size += ::protobuf::rt::value_varint_zigzag_size(6, *value); + if let Some(v) = self.disc_number { + my_size += ::protobuf::rt::value_varint_zigzag_size(6, v); }; - for value in &self.duration { - my_size += ::protobuf::rt::value_varint_zigzag_size(7, *value); + if let Some(v) = self.duration { + my_size += ::protobuf::rt::value_varint_zigzag_size(7, v); }; - for value in &self.popularity { - my_size += ::protobuf::rt::value_varint_zigzag_size(8, *value); + if let Some(v) = self.popularity { + my_size += ::protobuf::rt::value_varint_zigzag_size(8, v); }; - if self.explicit.is_some() { + if let Some(v) = self.explicit { my_size += 2; }; for value in &self.external_id { @@ -3390,67 +3724,67 @@ impl ::protobuf::Message for Track { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.gid.as_ref() { - try!(os.write_bytes(1, &v)); + os.write_bytes(1, &v)?; }; if let Some(v) = self.name.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.album.as_ref() { - try!(os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.artist { - try!(os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.number { - try!(os.write_sint32(5, v)); + os.write_sint32(5, v)?; }; if let Some(v) = self.disc_number { - try!(os.write_sint32(6, v)); + os.write_sint32(6, v)?; }; if let Some(v) = self.duration { - try!(os.write_sint32(7, v)); + os.write_sint32(7, v)?; }; if let Some(v) = self.popularity { - try!(os.write_sint32(8, v)); + os.write_sint32(8, v)?; }; if let Some(v) = self.explicit { - try!(os.write_bool(9, v)); + os.write_bool(9, v)?; }; for v in &self.external_id { - try!(os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(10, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.restriction { - try!(os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.file { - try!(os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.alternative { - try!(os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(13, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.sale_period { - try!(os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(14, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; for v in &self.preview { - try!(os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3466,10 +3800,6 @@ impl ::protobuf::Message for Track { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3492,73 +3822,80 @@ impl ::protobuf::MessageStatic for Track { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Track::has_gid, - Track::get_gid, + Track::get_gid_for_reflect, + Track::mut_gid_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Track::has_name, - Track::get_name, + Track::get_name_for_reflect, + Track::mut_name_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "album", - Track::has_album, - Track::get_album, + Track::get_album_for_reflect, + Track::mut_album_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "artist", - Track::get_artist, + Track::get_artist_for_reflect, + Track::mut_artist_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "number", - Track::has_number, - Track::get_number, + Track::get_number_for_reflect, + Track::mut_number_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "disc_number", - Track::has_disc_number, - Track::get_disc_number, + Track::get_disc_number_for_reflect, + Track::mut_disc_number_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "duration", - Track::has_duration, - Track::get_duration, + Track::get_duration_for_reflect, + Track::mut_duration_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "popularity", - Track::has_popularity, - Track::get_popularity, + Track::get_popularity_for_reflect, + Track::mut_popularity_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "explicit", - Track::has_explicit, - Track::get_explicit, + Track::get_explicit_for_reflect, + Track::mut_explicit_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "external_id", - Track::get_external_id, + Track::get_external_id_for_reflect, + Track::mut_external_id_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - Track::get_restriction, + Track::get_restriction_for_reflect, + Track::mut_restriction_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "file", - Track::get_file, + Track::get_file_for_reflect, + Track::mut_file_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "alternative", - Track::get_alternative, + Track::get_alternative_for_reflect, + Track::mut_alternative_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "sale_period", - Track::get_sale_period, + Track::get_sale_period_for_reflect, + Track::mut_sale_period_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "preview", - Track::get_preview, + Track::get_preview_for_reflect, + Track::mut_preview_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Track", @@ -3591,34 +3928,19 @@ impl ::protobuf::Clear for Track { } } -impl ::std::cmp::PartialEq for Track { - fn eq(&self, other: &Track) -> bool { - self.gid == other.gid && - self.name == other.name && - self.album == other.album && - self.artist == other.artist && - self.number == other.number && - self.disc_number == other.disc_number && - self.duration == other.duration && - self.popularity == other.popularity && - self.explicit == other.explicit && - self.external_id == other.external_id && - self.restriction == other.restriction && - self.file == other.file && - self.alternative == other.alternative && - self.sale_period == other.sale_period && - self.preview == other.preview && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Track { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Track { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Image { // message fields file_id: ::protobuf::SingularField<::std::vec::Vec>, @@ -3627,7 +3949,7 @@ pub struct Image { height: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3644,16 +3966,7 @@ impl Image { ptr: 0 as *const Image, }; unsafe { - instance.get(|| { - Image { - file_id: ::protobuf::SingularField::none(), - size: ::std::option::Option::None, - width: ::std::option::Option::None, - height: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Image::new) } } @@ -3693,6 +4006,14 @@ impl Image { } } + fn get_file_id_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.file_id + } + + fn mut_file_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.file_id + } + // optional .Image.Size size = 2; pub fn clear_size(&mut self) { @@ -3712,6 +4033,14 @@ impl Image { self.size.unwrap_or(Image_Size::DEFAULT) } + fn get_size_for_reflect(&self) -> &::std::option::Option { + &self.size + } + + fn mut_size_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.size + } + // optional sint32 width = 3; pub fn clear_width(&mut self) { @@ -3731,6 +4060,14 @@ impl Image { self.width.unwrap_or(0) } + fn get_width_for_reflect(&self) -> &::std::option::Option { + &self.width + } + + fn mut_width_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.width + } + // optional sint32 height = 4; pub fn clear_height(&mut self) { @@ -3749,6 +4086,14 @@ impl Image { pub fn get_height(&self) -> i32 { self.height.unwrap_or(0) } + + fn get_height_for_reflect(&self) -> &::std::option::Option { + &self.height + } + + fn mut_height_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.height + } } impl ::protobuf::Message for Image { @@ -3757,35 +4102,35 @@ impl ::protobuf::Message for Image { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.file_id)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.file_id)?; }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.size = ::std::option::Option::Some(tmp); }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.width = ::std::option::Option::Some(tmp); }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.height = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3796,17 +4141,17 @@ impl ::protobuf::Message for Image { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.file_id { - my_size += ::protobuf::rt::bytes_size(1, &value); + if let Some(v) = self.file_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); }; - for value in &self.size { - my_size += ::protobuf::rt::enum_size(2, *value); + if let Some(v) = self.size { + my_size += ::protobuf::rt::enum_size(2, v); }; - for value in &self.width { - my_size += ::protobuf::rt::value_varint_zigzag_size(3, *value); + if let Some(v) = self.width { + my_size += ::protobuf::rt::value_varint_zigzag_size(3, v); }; - for value in &self.height { - my_size += ::protobuf::rt::value_varint_zigzag_size(4, *value); + if let Some(v) = self.height { + my_size += ::protobuf::rt::value_varint_zigzag_size(4, v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3815,18 +4160,18 @@ impl ::protobuf::Message for Image { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.file_id.as_ref() { - try!(os.write_bytes(1, &v)); + os.write_bytes(1, &v)?; }; if let Some(v) = self.size { - try!(os.write_enum(2, v.value())); + os.write_enum(2, v.value())?; }; if let Some(v) = self.width { - try!(os.write_sint32(3, v)); + os.write_sint32(3, v)?; }; if let Some(v) = self.height { - try!(os.write_sint32(4, v)); + os.write_sint32(4, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3842,10 +4187,6 @@ impl ::protobuf::Message for Image { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3868,25 +4209,25 @@ impl ::protobuf::MessageStatic for Image { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "file_id", - Image::has_file_id, - Image::get_file_id, + Image::get_file_id_for_reflect, + Image::mut_file_id_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "size", - Image::has_size, - Image::get_size, + Image::get_size_for_reflect, + Image::mut_size_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "width", - Image::has_width, - Image::get_width, + Image::get_width_for_reflect, + Image::mut_width_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "height", - Image::has_height, - Image::get_height, + Image::get_height_for_reflect, + Image::mut_height_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Image", @@ -3908,22 +4249,18 @@ impl ::protobuf::Clear for Image { } } -impl ::std::cmp::PartialEq for Image { - fn eq(&self, other: &Image) -> bool { - self.file_id == other.file_id && - self.size == other.size && - self.width == other.width && - self.height == other.height && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Image { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for Image { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Image_Size { DEFAULT = 0, @@ -3973,13 +4310,19 @@ impl ::protobuf::ProtobufEnum for Image_Size { impl ::std::marker::Copy for Image_Size { } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Image_Size { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct ImageGroup { // message fields image: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -3996,13 +4339,7 @@ impl ImageGroup { ptr: 0 as *const ImageGroup, }; unsafe { - instance.get(|| { - ImageGroup { - image: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ImageGroup::new) } } @@ -4030,6 +4367,14 @@ impl ImageGroup { pub fn get_image(&self) -> &[Image] { &self.image } + + fn get_image_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.image + } + + fn mut_image_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.image + } } impl ::protobuf::Message for ImageGroup { @@ -4038,14 +4383,14 @@ impl ::protobuf::Message for ImageGroup { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.image)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.image)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4067,11 +4412,11 @@ impl ::protobuf::Message for ImageGroup { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { for v in &self.image { - try!(os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4087,10 +4432,6 @@ impl ::protobuf::Message for ImageGroup { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4113,9 +4454,10 @@ impl ::protobuf::MessageStatic for ImageGroup { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "image", - ImageGroup::get_image, + ImageGroup::get_image_for_reflect, + ImageGroup::mut_image_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ImageGroup", @@ -4134,20 +4476,19 @@ impl ::protobuf::Clear for ImageGroup { } } -impl ::std::cmp::PartialEq for ImageGroup { - fn eq(&self, other: &ImageGroup) -> bool { - self.image == other.image && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ImageGroup { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ImageGroup { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Biography { // message fields text: ::protobuf::SingularField<::std::string::String>, @@ -4155,7 +4496,7 @@ pub struct Biography { portrait_group: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4172,15 +4513,7 @@ impl Biography { ptr: 0 as *const Biography, }; unsafe { - instance.get(|| { - Biography { - text: ::protobuf::SingularField::none(), - portrait: ::protobuf::RepeatedField::new(), - portrait_group: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Biography::new) } } @@ -4220,6 +4553,14 @@ impl Biography { } } + fn get_text_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.text + } + + fn mut_text_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.text + } + // repeated .Image portrait = 2; pub fn clear_portrait(&mut self) { @@ -4245,6 +4586,14 @@ impl Biography { &self.portrait } + fn get_portrait_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.portrait + } + + fn mut_portrait_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.portrait + } + // repeated .ImageGroup portrait_group = 3; pub fn clear_portrait_group(&mut self) { @@ -4269,6 +4618,14 @@ impl Biography { pub fn get_portrait_group(&self) -> &[ImageGroup] { &self.portrait_group } + + fn get_portrait_group_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.portrait_group + } + + fn mut_portrait_group_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.portrait_group + } } impl ::protobuf::Message for Biography { @@ -4277,20 +4634,20 @@ impl ::protobuf::Message for Biography { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.text)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.text)?; }, 2 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.portrait)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.portrait)?; }, 3 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.portrait_group)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.portrait_group)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4301,8 +4658,8 @@ impl ::protobuf::Message for Biography { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.text { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.text.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; for value in &self.portrait { let len = value.compute_size(); @@ -4319,19 +4676,19 @@ impl ::protobuf::Message for Biography { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.text.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; for v in &self.portrait { - try!(os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + 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.portrait_group { - try!(os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4347,10 +4704,6 @@ impl ::protobuf::Message for Biography { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4373,18 +4726,20 @@ impl ::protobuf::MessageStatic for Biography { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "text", - Biography::has_text, - Biography::get_text, + Biography::get_text_for_reflect, + Biography::mut_text_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait", - Biography::get_portrait, + Biography::get_portrait_for_reflect, + Biography::mut_portrait_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "portrait_group", - Biography::get_portrait_group, + Biography::get_portrait_group_for_reflect, + Biography::mut_portrait_group_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Biography", @@ -4405,22 +4760,19 @@ impl ::protobuf::Clear for Biography { } } -impl ::std::cmp::PartialEq for Biography { - fn eq(&self, other: &Biography) -> bool { - self.text == other.text && - self.portrait == other.portrait && - self.portrait_group == other.portrait_group && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Biography { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Biography { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Disc { // message fields number: ::std::option::Option, @@ -4428,7 +4780,7 @@ pub struct Disc { track: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4445,15 +4797,7 @@ impl Disc { ptr: 0 as *const Disc, }; unsafe { - instance.get(|| { - Disc { - number: ::std::option::Option::None, - name: ::protobuf::SingularField::none(), - track: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Disc::new) } } @@ -4476,6 +4820,14 @@ impl Disc { self.number.unwrap_or(0) } + fn get_number_for_reflect(&self) -> &::std::option::Option { + &self.number + } + + fn mut_number_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.number + } + // optional string name = 2; pub fn clear_name(&mut self) { @@ -4512,6 +4864,14 @@ impl Disc { } } + fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.name + } + + fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.name + } + // repeated .Track track = 3; pub fn clear_track(&mut self) { @@ -4536,6 +4896,14 @@ impl Disc { pub fn get_track(&self) -> &[Track] { &self.track } + + fn get_track_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.track + } + + fn mut_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.track + } } impl ::protobuf::Message for Disc { @@ -4544,24 +4912,24 @@ impl ::protobuf::Message for Disc { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_sint32()); + let tmp = is.read_sint32()?; self.number = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; }, 3 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4572,11 +4940,11 @@ impl ::protobuf::Message for Disc { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.number { - my_size += ::protobuf::rt::value_varint_zigzag_size(1, *value); + if let Some(v) = self.number { + my_size += ::protobuf::rt::value_varint_zigzag_size(1, v); }; - for value in &self.name { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; for value in &self.track { let len = value.compute_size(); @@ -4589,17 +4957,17 @@ impl ::protobuf::Message for Disc { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.number { - try!(os.write_sint32(1, v)); + os.write_sint32(1, v)?; }; if let Some(v) = self.name.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; for v in &self.track { - try!(os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4615,10 +4983,6 @@ impl ::protobuf::Message for Disc { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4641,19 +5005,20 @@ impl ::protobuf::MessageStatic for Disc { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( "number", - Disc::has_number, - Disc::get_number, + Disc::get_number_for_reflect, + Disc::mut_number_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - Disc::has_name, - Disc::get_name, + Disc::get_name_for_reflect, + Disc::mut_name_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "track", - Disc::get_track, + Disc::get_track_for_reflect, + Disc::mut_track_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Disc", @@ -4674,29 +5039,26 @@ impl ::protobuf::Clear for Disc { } } -impl ::std::cmp::PartialEq for Disc { - fn eq(&self, other: &Disc) -> bool { - self.number == other.number && - self.name == other.name && - self.track == other.track && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Disc { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Disc { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Copyright { // message fields typ: ::std::option::Option, text: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4713,14 +5075,7 @@ impl Copyright { ptr: 0 as *const Copyright, }; unsafe { - instance.get(|| { - Copyright { - typ: ::std::option::Option::None, - text: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Copyright::new) } } @@ -4743,6 +5098,14 @@ impl Copyright { self.typ.unwrap_or(Copyright_Type::P) } + fn get_typ_for_reflect(&self) -> &::std::option::Option { + &self.typ + } + + fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.typ + } + // optional string text = 2; pub fn clear_text(&mut self) { @@ -4778,6 +5141,14 @@ impl Copyright { None => "", } } + + fn get_text_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.text + } + + fn mut_text_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.text + } } impl ::protobuf::Message for Copyright { @@ -4786,21 +5157,21 @@ impl ::protobuf::Message for Copyright { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_enum()); + let tmp = is.read_enum()?; self.typ = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.text)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.text)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -4811,11 +5182,11 @@ impl ::protobuf::Message for Copyright { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.typ { - my_size += ::protobuf::rt::enum_size(1, *value); + if let Some(v) = self.typ { + my_size += ::protobuf::rt::enum_size(1, v); }; - for value in &self.text { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.text.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -4824,12 +5195,12 @@ impl ::protobuf::Message for Copyright { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.typ { - try!(os.write_enum(1, v.value())); + os.write_enum(1, v.value())?; }; if let Some(v) = self.text.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -4845,10 +5216,6 @@ impl ::protobuf::Message for Copyright { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -4871,15 +5238,15 @@ impl ::protobuf::MessageStatic for Copyright { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Copyright::has_typ, - Copyright::get_typ, + Copyright::get_typ_for_reflect, + Copyright::mut_typ_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "text", - Copyright::has_text, - Copyright::get_text, + Copyright::get_text_for_reflect, + Copyright::mut_text_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Copyright", @@ -4899,20 +5266,18 @@ impl ::protobuf::Clear for Copyright { } } -impl ::std::cmp::PartialEq for Copyright { - fn eq(&self, other: &Copyright) -> bool { - self.typ == other.typ && - self.text == other.text && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Copyright { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for Copyright { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Copyright_Type { P = 0, @@ -4956,7 +5321,13 @@ impl ::protobuf::ProtobufEnum for Copyright_Type { impl ::std::marker::Copy for Copyright_Type { } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Copyright_Type { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Restriction { // message fields countries_allowed: ::protobuf::SingularField<::std::string::String>, @@ -4965,7 +5336,7 @@ pub struct Restriction { catalogue_str: ::protobuf::RepeatedField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -4982,16 +5353,7 @@ impl Restriction { ptr: 0 as *const Restriction, }; unsafe { - instance.get(|| { - Restriction { - countries_allowed: ::protobuf::SingularField::none(), - countries_forbidden: ::protobuf::SingularField::none(), - typ: ::std::option::Option::None, - catalogue_str: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Restriction::new) } } @@ -5031,6 +5393,14 @@ impl Restriction { } } + fn get_countries_allowed_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.countries_allowed + } + + fn mut_countries_allowed_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.countries_allowed + } + // optional string countries_forbidden = 3; pub fn clear_countries_forbidden(&mut self) { @@ -5067,6 +5437,14 @@ impl Restriction { } } + fn get_countries_forbidden_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.countries_forbidden + } + + fn mut_countries_forbidden_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.countries_forbidden + } + // optional .Restriction.Type typ = 4; pub fn clear_typ(&mut self) { @@ -5086,6 +5464,14 @@ impl Restriction { self.typ.unwrap_or(Restriction_Type::STREAMING) } + fn get_typ_for_reflect(&self) -> &::std::option::Option { + &self.typ + } + + fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.typ + } + // repeated string catalogue_str = 5; pub fn clear_catalogue_str(&mut self) { @@ -5110,6 +5496,14 @@ impl Restriction { pub fn get_catalogue_str(&self) -> &[::std::string::String] { &self.catalogue_str } + + fn get_catalogue_str_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { + &self.catalogue_str + } + + fn mut_catalogue_str_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.catalogue_str + } } impl ::protobuf::Message for Restriction { @@ -5118,27 +5512,27 @@ impl ::protobuf::Message for Restriction { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.countries_allowed)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.countries_allowed)?; }, 3 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.countries_forbidden)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.countries_forbidden)?; }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.typ = ::std::option::Option::Some(tmp); }, 5 => { - try!(::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.catalogue_str)); + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.catalogue_str)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5149,14 +5543,14 @@ impl ::protobuf::Message for Restriction { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.countries_allowed { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.countries_allowed.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.countries_forbidden { - my_size += ::protobuf::rt::string_size(3, &value); + if let Some(v) = self.countries_forbidden.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); }; - for value in &self.typ { - my_size += ::protobuf::rt::enum_size(4, *value); + if let Some(v) = self.typ { + my_size += ::protobuf::rt::enum_size(4, v); }; for value in &self.catalogue_str { my_size += ::protobuf::rt::string_size(5, &value); @@ -5168,18 +5562,18 @@ impl ::protobuf::Message for Restriction { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.countries_allowed.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.countries_forbidden.as_ref() { - try!(os.write_string(3, &v)); + os.write_string(3, &v)?; }; if let Some(v) = self.typ { - try!(os.write_enum(4, v.value())); + os.write_enum(4, v.value())?; }; for v in &self.catalogue_str { - try!(os.write_string(5, &v)); + os.write_string(5, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5195,10 +5589,6 @@ impl ::protobuf::Message for Restriction { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5221,24 +5611,25 @@ impl ::protobuf::MessageStatic for Restriction { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "countries_allowed", - Restriction::has_countries_allowed, - Restriction::get_countries_allowed, + Restriction::get_countries_allowed_for_reflect, + Restriction::mut_countries_allowed_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "countries_forbidden", - Restriction::has_countries_forbidden, - Restriction::get_countries_forbidden, + Restriction::get_countries_forbidden_for_reflect, + Restriction::mut_countries_forbidden_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Restriction::has_typ, - Restriction::get_typ, + Restriction::get_typ_for_reflect, + Restriction::mut_typ_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_string_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "catalogue_str", - Restriction::get_catalogue_str, + Restriction::get_catalogue_str_for_reflect, + Restriction::mut_catalogue_str_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Restriction", @@ -5260,22 +5651,18 @@ impl ::protobuf::Clear for Restriction { } } -impl ::std::cmp::PartialEq for Restriction { - fn eq(&self, other: &Restriction) -> bool { - self.countries_allowed == other.countries_allowed && - self.countries_forbidden == other.countries_forbidden && - self.typ == other.typ && - self.catalogue_str == other.catalogue_str && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Restriction { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for Restriction { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum Restriction_Type { STREAMING = 0, @@ -5316,7 +5703,13 @@ impl ::protobuf::ProtobufEnum for Restriction_Type { impl ::std::marker::Copy for Restriction_Type { } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Restriction_Type { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct SalePeriod { // message fields restriction: ::protobuf::RepeatedField, @@ -5324,7 +5717,7 @@ pub struct SalePeriod { end: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5341,15 +5734,7 @@ impl SalePeriod { ptr: 0 as *const SalePeriod, }; unsafe { - instance.get(|| { - SalePeriod { - restriction: ::protobuf::RepeatedField::new(), - start: ::protobuf::SingularPtrField::none(), - end: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(SalePeriod::new) } } @@ -5378,6 +5763,14 @@ impl SalePeriod { &self.restriction } + fn get_restriction_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.restriction + } + + fn mut_restriction_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.restriction + } + // optional .Date start = 2; pub fn clear_start(&mut self) { @@ -5411,6 +5804,14 @@ impl SalePeriod { self.start.as_ref().unwrap_or_else(|| Date::default_instance()) } + fn get_start_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.start + } + + fn mut_start_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.start + } + // optional .Date end = 3; pub fn clear_end(&mut self) { @@ -5443,6 +5844,14 @@ impl SalePeriod { pub fn get_end(&self) -> &Date { self.end.as_ref().unwrap_or_else(|| Date::default_instance()) } + + fn get_end_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.end + } + + fn mut_end_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.end + } } impl ::protobuf::Message for SalePeriod { @@ -5451,20 +5860,20 @@ impl ::protobuf::Message for SalePeriod { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)?; }, 2 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.start)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.start)?; }, 3 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.end)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.end)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5479,12 +5888,12 @@ impl ::protobuf::Message for SalePeriod { let len = value.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.start { - let len = value.compute_size(); + if let Some(v) = self.start.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.end { - let len = value.compute_size(); + if let Some(v) = self.end.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()); @@ -5494,21 +5903,21 @@ impl ::protobuf::Message for SalePeriod { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { for v in &self.restriction { - try!(os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + 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(v) = self.start.as_ref() { - try!(os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.end.as_ref() { - try!(os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5524,10 +5933,6 @@ impl ::protobuf::Message for SalePeriod { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5550,19 +5955,20 @@ impl ::protobuf::MessageStatic for SalePeriod { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "restriction", - SalePeriod::get_restriction, + SalePeriod::get_restriction_for_reflect, + SalePeriod::mut_restriction_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "start", - SalePeriod::has_start, - SalePeriod::get_start, + SalePeriod::get_start_for_reflect, + SalePeriod::mut_start_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "end", - SalePeriod::has_end, - SalePeriod::get_end, + SalePeriod::get_end_for_reflect, + SalePeriod::mut_end_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "SalePeriod", @@ -5583,29 +5989,26 @@ impl ::protobuf::Clear for SalePeriod { } } -impl ::std::cmp::PartialEq for SalePeriod { - fn eq(&self, other: &SalePeriod) -> bool { - self.restriction == other.restriction && - self.start == other.start && - self.end == other.end && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for SalePeriod { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for SalePeriod { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct ExternalId { // message fields typ: ::protobuf::SingularField<::std::string::String>, id: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5622,14 +6025,7 @@ impl ExternalId { ptr: 0 as *const ExternalId, }; unsafe { - instance.get(|| { - ExternalId { - typ: ::protobuf::SingularField::none(), - id: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(ExternalId::new) } } @@ -5669,6 +6065,14 @@ impl ExternalId { } } + fn get_typ_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.typ + } + + fn mut_typ_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.typ + } + // optional string id = 2; pub fn clear_id(&mut self) { @@ -5704,6 +6108,14 @@ impl ExternalId { None => "", } } + + fn get_id_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.id + } + + fn mut_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.id + } } impl ::protobuf::Message for ExternalId { @@ -5712,17 +6124,17 @@ impl ::protobuf::Message for ExternalId { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.typ)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.typ)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.id)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.id)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5733,11 +6145,11 @@ impl ::protobuf::Message for ExternalId { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.typ { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.typ.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; - for value in &self.id { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.id.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -5746,12 +6158,12 @@ impl ::protobuf::Message for ExternalId { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.typ.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; if let Some(v) = self.id.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5767,10 +6179,6 @@ impl ::protobuf::Message for ExternalId { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -5793,15 +6201,15 @@ impl ::protobuf::MessageStatic for ExternalId { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "typ", - ExternalId::has_typ, - ExternalId::get_typ, + ExternalId::get_typ_for_reflect, + ExternalId::mut_typ_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "id", - ExternalId::has_id, - ExternalId::get_id, + ExternalId::get_id_for_reflect, + ExternalId::mut_id_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "ExternalId", @@ -5821,28 +6229,26 @@ impl ::protobuf::Clear for ExternalId { } } -impl ::std::cmp::PartialEq for ExternalId { - fn eq(&self, other: &ExternalId) -> bool { - self.typ == other.typ && - self.id == other.id && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for ExternalId { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for ExternalId { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct AudioFile { // message fields file_id: ::protobuf::SingularField<::std::vec::Vec>, format: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -5859,14 +6265,7 @@ impl AudioFile { ptr: 0 as *const AudioFile, }; unsafe { - instance.get(|| { - AudioFile { - file_id: ::protobuf::SingularField::none(), - format: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(AudioFile::new) } } @@ -5906,6 +6305,14 @@ impl AudioFile { } } + fn get_file_id_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.file_id + } + + fn mut_file_id_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.file_id + } + // optional .AudioFile.Format format = 2; pub fn clear_format(&mut self) { @@ -5924,6 +6331,14 @@ impl AudioFile { pub fn get_format(&self) -> AudioFile_Format { self.format.unwrap_or(AudioFile_Format::OGG_VORBIS_96) } + + fn get_format_for_reflect(&self) -> &::std::option::Option { + &self.format + } + + fn mut_format_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.format + } } impl ::protobuf::Message for AudioFile { @@ -5932,21 +6347,21 @@ impl ::protobuf::Message for AudioFile { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.file_id)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.file_id)?; }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.format = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -5957,11 +6372,11 @@ impl ::protobuf::Message for AudioFile { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.file_id { - my_size += ::protobuf::rt::bytes_size(1, &value); + if let Some(v) = self.file_id.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); }; - for value in &self.format { - my_size += ::protobuf::rt::enum_size(2, *value); + if let Some(v) = self.format { + my_size += ::protobuf::rt::enum_size(2, v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -5970,12 +6385,12 @@ impl ::protobuf::Message for AudioFile { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.file_id.as_ref() { - try!(os.write_bytes(1, &v)); + os.write_bytes(1, &v)?; }; if let Some(v) = self.format { - try!(os.write_enum(2, v.value())); + os.write_enum(2, v.value())?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -5991,10 +6406,6 @@ impl ::protobuf::Message for AudioFile { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -6017,15 +6428,15 @@ impl ::protobuf::MessageStatic for AudioFile { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "file_id", - AudioFile::has_file_id, - AudioFile::get_file_id, + AudioFile::get_file_id_for_reflect, + AudioFile::mut_file_id_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "format", - AudioFile::has_format, - AudioFile::get_format, + AudioFile::get_format_for_reflect, + AudioFile::mut_format_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "AudioFile", @@ -6045,20 +6456,18 @@ impl ::protobuf::Clear for AudioFile { } } -impl ::std::cmp::PartialEq for AudioFile { - fn eq(&self, other: &AudioFile) -> bool { - self.file_id == other.file_id && - self.format == other.format && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for AudioFile { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for AudioFile { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum AudioFile_Format { OGG_VORBIS_96 = 0, @@ -6132,6 +6541,12 @@ impl ::protobuf::ProtobufEnum for AudioFile_Format { impl ::std::marker::Copy for AudioFile_Format { } +impl ::protobuf::reflect::ProtobufValue for AudioFile_Format { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + static file_descriptor_proto_data: &'static [u8] = &[ 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x09, 0x54, 0x6f, 0x70, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x12, 0x18, 0x0a, diff --git a/protocol/src/pubsub.rs b/protocol/src/pubsub.rs index 8227f892..76d78b0f 100644 --- a/protocol/src/pubsub.rs +++ b/protocol/src/pubsub.rs @@ -20,7 +20,7 @@ use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; -#[derive(Clone,Default)] +#[derive(PartialEq,Clone,Default)] pub struct Subscription { // message fields uri: ::protobuf::SingularField<::std::string::String>, @@ -28,7 +28,7 @@ pub struct Subscription { status_code: ::std::option::Option, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -45,15 +45,7 @@ impl Subscription { ptr: 0 as *const Subscription, }; unsafe { - instance.get(|| { - Subscription { - uri: ::protobuf::SingularField::none(), - expiry: ::std::option::Option::None, - status_code: ::std::option::Option::None, - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Subscription::new) } } @@ -93,6 +85,14 @@ impl Subscription { } } + fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.uri + } + + fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.uri + } + // optional int32 expiry = 2; pub fn clear_expiry(&mut self) { @@ -112,6 +112,14 @@ impl Subscription { self.expiry.unwrap_or(0) } + fn get_expiry_for_reflect(&self) -> &::std::option::Option { + &self.expiry + } + + fn mut_expiry_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.expiry + } + // optional int32 status_code = 3; pub fn clear_status_code(&mut self) { @@ -130,6 +138,14 @@ impl Subscription { pub fn get_status_code(&self) -> i32 { self.status_code.unwrap_or(0) } + + fn get_status_code_for_reflect(&self) -> &::std::option::Option { + &self.status_code + } + + fn mut_status_code_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.status_code + } } impl ::protobuf::Message for Subscription { @@ -138,28 +154,28 @@ impl ::protobuf::Message for Subscription { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?; }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.expiry = ::std::option::Option::Some(tmp); }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.status_code = ::std::option::Option::Some(tmp); }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -170,14 +186,14 @@ impl ::protobuf::Message for Subscription { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.uri { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.uri.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; - for value in &self.expiry { - my_size += ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.expiry { + my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.status_code { - my_size += ::protobuf::rt::value_size(3, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.status_code { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -186,15 +202,15 @@ impl ::protobuf::Message for Subscription { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.uri.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; if let Some(v) = self.expiry { - try!(os.write_int32(2, v)); + os.write_int32(2, v)?; }; if let Some(v) = self.status_code { - try!(os.write_int32(3, v)); + os.write_int32(3, v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -210,10 +226,6 @@ impl ::protobuf::Message for Subscription { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -236,20 +248,20 @@ impl ::protobuf::MessageStatic for Subscription { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - Subscription::has_uri, - Subscription::get_uri, + Subscription::get_uri_for_reflect, + Subscription::mut_uri_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "expiry", - Subscription::has_expiry, - Subscription::get_expiry, + Subscription::get_expiry_for_reflect, + Subscription::mut_expiry_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "status_code", - Subscription::has_status_code, - Subscription::get_status_code, + Subscription::get_status_code_for_reflect, + Subscription::mut_status_code_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Subscription", @@ -270,21 +282,18 @@ impl ::protobuf::Clear for Subscription { } } -impl ::std::cmp::PartialEq for Subscription { - fn eq(&self, other: &Subscription) -> bool { - self.uri == other.uri && - self.expiry == other.expiry && - self.status_code == other.status_code && - self.unknown_fields == other.unknown_fields - } -} - 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) + } +} + static file_descriptor_proto_data: &'static [u8] = &[ 0x0a, 0x0c, 0x70, 0x75, 0x62, 0x73, 0x75, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x0c, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, diff --git a/protocol/src/spirc.rs b/protocol/src/spirc.rs index ebd20b1c..a92cb011 100644 --- a/protocol/src/spirc.rs +++ b/protocol/src/spirc.rs @@ -20,7 +20,7 @@ use protobuf::Message as Message_imported_for_functions; use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; -#[derive(Clone,Default)] +#[derive(PartialEq,Clone,Default)] pub struct Frame { // message fields version: ::std::option::Option, @@ -39,7 +39,7 @@ pub struct Frame { new_name: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -56,26 +56,7 @@ impl Frame { ptr: 0 as *const Frame, }; unsafe { - instance.get(|| { - Frame { - version: ::std::option::Option::None, - ident: ::protobuf::SingularField::none(), - protocol_version: ::protobuf::SingularField::none(), - seq_nr: ::std::option::Option::None, - typ: ::std::option::Option::None, - device_state: ::protobuf::SingularPtrField::none(), - goodbye: ::protobuf::SingularPtrField::none(), - state: ::protobuf::SingularPtrField::none(), - position: ::std::option::Option::None, - volume: ::std::option::Option::None, - state_update_id: ::std::option::Option::None, - recipient: ::protobuf::RepeatedField::new(), - context_player_state: ::protobuf::SingularField::none(), - new_name: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Frame::new) } } @@ -98,6 +79,14 @@ impl Frame { self.version.unwrap_or(0) } + fn get_version_for_reflect(&self) -> &::std::option::Option { + &self.version + } + + fn mut_version_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.version + } + // optional string ident = 2; pub fn clear_ident(&mut self) { @@ -134,6 +123,14 @@ impl Frame { } } + fn get_ident_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.ident + } + + fn mut_ident_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.ident + } + // optional string protocol_version = 3; pub fn clear_protocol_version(&mut self) { @@ -170,6 +167,14 @@ impl Frame { } } + fn get_protocol_version_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.protocol_version + } + + fn mut_protocol_version_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.protocol_version + } + // optional uint32 seq_nr = 4; pub fn clear_seq_nr(&mut self) { @@ -189,6 +194,14 @@ impl Frame { self.seq_nr.unwrap_or(0) } + fn get_seq_nr_for_reflect(&self) -> &::std::option::Option { + &self.seq_nr + } + + fn mut_seq_nr_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.seq_nr + } + // optional .MessageType typ = 5; pub fn clear_typ(&mut self) { @@ -208,6 +221,14 @@ impl Frame { self.typ.unwrap_or(MessageType::kMessageTypeHello) } + fn get_typ_for_reflect(&self) -> &::std::option::Option { + &self.typ + } + + fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.typ + } + // optional .DeviceState device_state = 7; pub fn clear_device_state(&mut self) { @@ -241,6 +262,14 @@ impl Frame { self.device_state.as_ref().unwrap_or_else(|| DeviceState::default_instance()) } + fn get_device_state_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.device_state + } + + fn mut_device_state_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.device_state + } + // optional .Goodbye goodbye = 11; pub fn clear_goodbye(&mut self) { @@ -274,6 +303,14 @@ impl Frame { self.goodbye.as_ref().unwrap_or_else(|| Goodbye::default_instance()) } + fn get_goodbye_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.goodbye + } + + fn mut_goodbye_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.goodbye + } + // optional .State state = 12; pub fn clear_state(&mut self) { @@ -307,6 +344,14 @@ impl Frame { self.state.as_ref().unwrap_or_else(|| State::default_instance()) } + fn get_state_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.state + } + + fn mut_state_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.state + } + // optional uint32 position = 13; pub fn clear_position(&mut self) { @@ -326,6 +371,14 @@ impl Frame { self.position.unwrap_or(0) } + fn get_position_for_reflect(&self) -> &::std::option::Option { + &self.position + } + + fn mut_position_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.position + } + // optional uint32 volume = 14; pub fn clear_volume(&mut self) { @@ -345,6 +398,14 @@ impl Frame { self.volume.unwrap_or(0) } + fn get_volume_for_reflect(&self) -> &::std::option::Option { + &self.volume + } + + fn mut_volume_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.volume + } + // optional int64 state_update_id = 17; pub fn clear_state_update_id(&mut self) { @@ -364,6 +425,14 @@ impl Frame { self.state_update_id.unwrap_or(0) } + fn get_state_update_id_for_reflect(&self) -> &::std::option::Option { + &self.state_update_id + } + + fn mut_state_update_id_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.state_update_id + } + // repeated string recipient = 18; pub fn clear_recipient(&mut self) { @@ -389,6 +458,14 @@ impl Frame { &self.recipient } + fn get_recipient_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { + &self.recipient + } + + fn mut_recipient_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.recipient + } + // optional bytes context_player_state = 19; pub fn clear_context_player_state(&mut self) { @@ -425,6 +502,14 @@ impl Frame { } } + fn get_context_player_state_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.context_player_state + } + + fn mut_context_player_state_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.context_player_state + } + // optional string new_name = 20; pub fn clear_new_name(&mut self) { @@ -460,6 +545,14 @@ impl Frame { None => "", } } + + fn get_new_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.new_name + } + + fn mut_new_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.new_name + } } impl ::protobuf::Message for Frame { @@ -468,77 +561,77 @@ impl ::protobuf::Message for Frame { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.version = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ident)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.ident)?; }, 3 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.protocol_version)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.protocol_version)?; }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.seq_nr = ::std::option::Option::Some(tmp); }, 5 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.typ = ::std::option::Option::Some(tmp); }, 7 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.device_state)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.device_state)?; }, 11 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.goodbye)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.goodbye)?; }, 12 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.state)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.state)?; }, 13 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.position = ::std::option::Option::Some(tmp); }, 14 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.volume = ::std::option::Option::Some(tmp); }, 17 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int64()); + let tmp = is.read_int64()?; self.state_update_id = ::std::option::Option::Some(tmp); }, 18 => { - try!(::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.recipient)); + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.recipient)?; }, 19 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.context_player_state)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.context_player_state)?; }, 20 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.new_name)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.new_name)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -549,50 +642,50 @@ impl ::protobuf::Message for Frame { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.version { - my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.version { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.ident { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.ident.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.protocol_version { - my_size += ::protobuf::rt::string_size(3, &value); + if let Some(v) = self.protocol_version.as_ref() { + my_size += ::protobuf::rt::string_size(3, &v); }; - for value in &self.seq_nr { - my_size += ::protobuf::rt::value_size(4, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.seq_nr { + my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.typ { - my_size += ::protobuf::rt::enum_size(5, *value); + if let Some(v) = self.typ { + my_size += ::protobuf::rt::enum_size(5, v); }; - for value in &self.device_state { - let len = value.compute_size(); + if let Some(v) = self.device_state.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.goodbye { - let len = value.compute_size(); + if let Some(v) = self.goodbye.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.state { - let len = value.compute_size(); + if let Some(v) = self.state.as_ref() { + let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.position { - my_size += ::protobuf::rt::value_size(13, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.position { + my_size += ::protobuf::rt::value_size(13, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.volume { - my_size += ::protobuf::rt::value_size(14, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.volume { + my_size += ::protobuf::rt::value_size(14, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.state_update_id { - my_size += ::protobuf::rt::value_size(17, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.state_update_id { + my_size += ::protobuf::rt::value_size(17, v, ::protobuf::wire_format::WireTypeVarint); }; for value in &self.recipient { my_size += ::protobuf::rt::string_size(18, &value); }; - for value in &self.context_player_state { - my_size += ::protobuf::rt::bytes_size(19, &value); + if let Some(v) = self.context_player_state.as_ref() { + my_size += ::protobuf::rt::bytes_size(19, &v); }; - for value in &self.new_name { - my_size += ::protobuf::rt::string_size(20, &value); + if let Some(v) = self.new_name.as_ref() { + my_size += ::protobuf::rt::string_size(20, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -601,54 +694,54 @@ impl ::protobuf::Message for Frame { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.version { - try!(os.write_uint32(1, v)); + os.write_uint32(1, v)?; }; if let Some(v) = self.ident.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.protocol_version.as_ref() { - try!(os.write_string(3, &v)); + os.write_string(3, &v)?; }; if let Some(v) = self.seq_nr { - try!(os.write_uint32(4, v)); + os.write_uint32(4, v)?; }; if let Some(v) = self.typ { - try!(os.write_enum(5, v.value())); + os.write_enum(5, v.value())?; }; if let Some(v) = self.device_state.as_ref() { - try!(os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(7, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.goodbye.as_ref() { - try!(os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(11, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.state.as_ref() { - try!(os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.position { - try!(os.write_uint32(13, v)); + os.write_uint32(13, v)?; }; if let Some(v) = self.volume { - try!(os.write_uint32(14, v)); + os.write_uint32(14, v)?; }; if let Some(v) = self.state_update_id { - try!(os.write_int64(17, v)); + os.write_int64(17, v)?; }; for v in &self.recipient { - try!(os.write_string(18, &v)); + os.write_string(18, &v)?; }; if let Some(v) = self.context_player_state.as_ref() { - try!(os.write_bytes(19, &v)); + os.write_bytes(19, &v)?; }; if let Some(v) = self.new_name.as_ref() { - try!(os.write_string(20, &v)); + os.write_string(20, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -664,10 +757,6 @@ impl ::protobuf::Message for Frame { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -690,74 +779,75 @@ impl ::protobuf::MessageStatic for Frame { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "version", - Frame::has_version, - Frame::get_version, + Frame::get_version_for_reflect, + Frame::mut_version_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "ident", - Frame::has_ident, - Frame::get_ident, + Frame::get_ident_for_reflect, + Frame::mut_ident_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "protocol_version", - Frame::has_protocol_version, - Frame::get_protocol_version, + Frame::get_protocol_version_for_reflect, + Frame::mut_protocol_version_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "seq_nr", - Frame::has_seq_nr, - Frame::get_seq_nr, + Frame::get_seq_nr_for_reflect, + Frame::mut_seq_nr_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Frame::has_typ, - Frame::get_typ, + Frame::get_typ_for_reflect, + Frame::mut_typ_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "device_state", - Frame::has_device_state, - Frame::get_device_state, + Frame::get_device_state_for_reflect, + Frame::mut_device_state_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "goodbye", - Frame::has_goodbye, - Frame::get_goodbye, + Frame::get_goodbye_for_reflect, + Frame::mut_goodbye_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "state", - Frame::has_state, - Frame::get_state, + Frame::get_state_for_reflect, + Frame::mut_state_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "position", - Frame::has_position, - Frame::get_position, + Frame::get_position_for_reflect, + Frame::mut_position_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "volume", - Frame::has_volume, - Frame::get_volume, + Frame::get_volume_for_reflect, + Frame::mut_volume_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i64_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( "state_update_id", - Frame::has_state_update_id, - Frame::get_state_update_id, + Frame::get_state_update_id_for_reflect, + Frame::mut_state_update_id_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_string_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "recipient", - Frame::get_recipient, + Frame::get_recipient_for_reflect, + Frame::mut_recipient_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "context_player_state", - Frame::has_context_player_state, - Frame::get_context_player_state, + Frame::get_context_player_state_for_reflect, + Frame::mut_context_player_state_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "new_name", - Frame::has_new_name, - Frame::get_new_name, + Frame::get_new_name_for_reflect, + Frame::mut_new_name_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Frame", @@ -789,33 +879,19 @@ impl ::protobuf::Clear for Frame { } } -impl ::std::cmp::PartialEq for Frame { - fn eq(&self, other: &Frame) -> bool { - self.version == other.version && - self.ident == other.ident && - self.protocol_version == other.protocol_version && - self.seq_nr == other.seq_nr && - self.typ == other.typ && - self.device_state == other.device_state && - self.goodbye == other.goodbye && - self.state == other.state && - self.position == other.position && - self.volume == other.volume && - self.state_update_id == other.state_update_id && - self.recipient == other.recipient && - self.context_player_state == other.context_player_state && - self.new_name == other.new_name && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Frame { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Frame { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct DeviceState { // message fields sw_version: ::protobuf::SingularField<::std::string::String>, @@ -829,7 +905,7 @@ pub struct DeviceState { capabilities: ::protobuf::RepeatedField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -846,21 +922,7 @@ impl DeviceState { ptr: 0 as *const DeviceState, }; unsafe { - instance.get(|| { - DeviceState { - sw_version: ::protobuf::SingularField::none(), - is_active: ::std::option::Option::None, - can_play: ::std::option::Option::None, - volume: ::std::option::Option::None, - name: ::protobuf::SingularField::none(), - error_code: ::std::option::Option::None, - became_active_at: ::std::option::Option::None, - error_message: ::protobuf::SingularField::none(), - capabilities: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(DeviceState::new) } } @@ -900,6 +962,14 @@ impl DeviceState { } } + fn get_sw_version_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.sw_version + } + + fn mut_sw_version_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.sw_version + } + // optional bool is_active = 10; pub fn clear_is_active(&mut self) { @@ -919,6 +989,14 @@ impl DeviceState { self.is_active.unwrap_or(false) } + fn get_is_active_for_reflect(&self) -> &::std::option::Option { + &self.is_active + } + + fn mut_is_active_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.is_active + } + // optional bool can_play = 11; pub fn clear_can_play(&mut self) { @@ -938,6 +1016,14 @@ impl DeviceState { self.can_play.unwrap_or(false) } + fn get_can_play_for_reflect(&self) -> &::std::option::Option { + &self.can_play + } + + fn mut_can_play_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.can_play + } + // optional uint32 volume = 12; pub fn clear_volume(&mut self) { @@ -957,6 +1043,14 @@ impl DeviceState { self.volume.unwrap_or(0) } + fn get_volume_for_reflect(&self) -> &::std::option::Option { + &self.volume + } + + fn mut_volume_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.volume + } + // optional string name = 13; pub fn clear_name(&mut self) { @@ -993,6 +1087,14 @@ impl DeviceState { } } + fn get_name_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.name + } + + fn mut_name_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.name + } + // optional uint32 error_code = 14; pub fn clear_error_code(&mut self) { @@ -1012,6 +1114,14 @@ impl DeviceState { self.error_code.unwrap_or(0) } + fn get_error_code_for_reflect(&self) -> &::std::option::Option { + &self.error_code + } + + fn mut_error_code_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.error_code + } + // optional int64 became_active_at = 15; pub fn clear_became_active_at(&mut self) { @@ -1031,6 +1141,14 @@ impl DeviceState { self.became_active_at.unwrap_or(0) } + fn get_became_active_at_for_reflect(&self) -> &::std::option::Option { + &self.became_active_at + } + + fn mut_became_active_at_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.became_active_at + } + // optional string error_message = 16; pub fn clear_error_message(&mut self) { @@ -1067,6 +1185,14 @@ impl DeviceState { } } + fn get_error_message_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.error_message + } + + fn mut_error_message_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.error_message + } + // repeated .Capability capabilities = 17; pub fn clear_capabilities(&mut self) { @@ -1091,6 +1217,14 @@ impl DeviceState { pub fn get_capabilities(&self) -> &[Capability] { &self.capabilities } + + fn get_capabilities_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.capabilities + } + + fn mut_capabilities_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.capabilities + } } impl ::protobuf::Message for DeviceState { @@ -1099,58 +1233,58 @@ impl ::protobuf::Message for DeviceState { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.sw_version)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.sw_version)?; }, 10 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.is_active = ::std::option::Option::Some(tmp); }, 11 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.can_play = ::std::option::Option::Some(tmp); }, 12 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.volume = ::std::option::Option::Some(tmp); }, 13 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; }, 14 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.error_code = ::std::option::Option::Some(tmp); }, 15 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int64()); + let tmp = is.read_int64()?; self.became_active_at = ::std::option::Option::Some(tmp); }, 16 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.error_message)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.error_message)?; }, 17 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.capabilities)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.capabilities)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1161,29 +1295,29 @@ impl ::protobuf::Message for DeviceState { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.sw_version { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.sw_version.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; - if self.is_active.is_some() { + if let Some(v) = self.is_active { my_size += 2; }; - if self.can_play.is_some() { + if let Some(v) = self.can_play { my_size += 2; }; - for value in &self.volume { - my_size += ::protobuf::rt::value_size(12, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.volume { + my_size += ::protobuf::rt::value_size(12, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.name { - my_size += ::protobuf::rt::string_size(13, &value); + if let Some(v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(13, &v); }; - for value in &self.error_code { - my_size += ::protobuf::rt::value_size(14, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.error_code { + my_size += ::protobuf::rt::value_size(14, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.became_active_at { - my_size += ::protobuf::rt::value_size(15, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.became_active_at { + my_size += ::protobuf::rt::value_size(15, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.error_message { - my_size += ::protobuf::rt::string_size(16, &value); + if let Some(v) = self.error_message.as_ref() { + my_size += ::protobuf::rt::string_size(16, &v); }; for value in &self.capabilities { let len = value.compute_size(); @@ -1196,35 +1330,35 @@ impl ::protobuf::Message for DeviceState { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.sw_version.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; if let Some(v) = self.is_active { - try!(os.write_bool(10, v)); + os.write_bool(10, v)?; }; if let Some(v) = self.can_play { - try!(os.write_bool(11, v)); + os.write_bool(11, v)?; }; if let Some(v) = self.volume { - try!(os.write_uint32(12, v)); + os.write_uint32(12, v)?; }; if let Some(v) = self.name.as_ref() { - try!(os.write_string(13, &v)); + os.write_string(13, &v)?; }; if let Some(v) = self.error_code { - try!(os.write_uint32(14, v)); + os.write_uint32(14, v)?; }; if let Some(v) = self.became_active_at { - try!(os.write_int64(15, v)); + os.write_int64(15, v)?; }; if let Some(v) = self.error_message.as_ref() { - try!(os.write_string(16, &v)); + os.write_string(16, &v)?; }; for v in &self.capabilities { - try!(os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(17, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1240,10 +1374,6 @@ impl ::protobuf::Message for DeviceState { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1266,49 +1396,50 @@ impl ::protobuf::MessageStatic for DeviceState { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "sw_version", - DeviceState::has_sw_version, - DeviceState::get_sw_version, + DeviceState::get_sw_version_for_reflect, + DeviceState::mut_sw_version_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "is_active", - DeviceState::has_is_active, - DeviceState::get_is_active, + DeviceState::get_is_active_for_reflect, + DeviceState::mut_is_active_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "can_play", - DeviceState::has_can_play, - DeviceState::get_can_play, + DeviceState::get_can_play_for_reflect, + DeviceState::mut_can_play_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "volume", - DeviceState::has_volume, - DeviceState::get_volume, + DeviceState::get_volume_for_reflect, + DeviceState::mut_volume_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "name", - DeviceState::has_name, - DeviceState::get_name, + DeviceState::get_name_for_reflect, + DeviceState::mut_name_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "error_code", - DeviceState::has_error_code, - DeviceState::get_error_code, + DeviceState::get_error_code_for_reflect, + DeviceState::mut_error_code_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i64_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( "became_active_at", - DeviceState::has_became_active_at, - DeviceState::get_became_active_at, + DeviceState::get_became_active_at_for_reflect, + DeviceState::mut_became_active_at_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "error_message", - DeviceState::has_error_message, - DeviceState::get_error_message, + DeviceState::get_error_message_for_reflect, + DeviceState::mut_error_message_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "capabilities", - DeviceState::get_capabilities, + DeviceState::get_capabilities_for_reflect, + DeviceState::mut_capabilities_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "DeviceState", @@ -1335,28 +1466,19 @@ impl ::protobuf::Clear for DeviceState { } } -impl ::std::cmp::PartialEq for DeviceState { - fn eq(&self, other: &DeviceState) -> bool { - self.sw_version == other.sw_version && - self.is_active == other.is_active && - self.can_play == other.can_play && - self.volume == other.volume && - self.name == other.name && - self.error_code == other.error_code && - self.became_active_at == other.became_active_at && - self.error_message == other.error_message && - self.capabilities == other.capabilities && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for DeviceState { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for DeviceState { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Capability { // message fields typ: ::std::option::Option, @@ -1364,7 +1486,7 @@ pub struct Capability { stringValue: ::protobuf::RepeatedField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1381,15 +1503,7 @@ impl Capability { ptr: 0 as *const Capability, }; unsafe { - instance.get(|| { - Capability { - typ: ::std::option::Option::None, - intValue: ::std::vec::Vec::new(), - stringValue: ::protobuf::RepeatedField::new(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Capability::new) } } @@ -1412,6 +1526,14 @@ impl Capability { self.typ.unwrap_or(CapabilityType::kSupportedContexts) } + fn get_typ_for_reflect(&self) -> &::std::option::Option { + &self.typ + } + + fn mut_typ_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.typ + } + // repeated int64 intValue = 2; pub fn clear_intValue(&mut self) { @@ -1437,6 +1559,14 @@ impl Capability { &self.intValue } + fn get_intValue_for_reflect(&self) -> &::std::vec::Vec { + &self.intValue + } + + fn mut_intValue_for_reflect(&mut self) -> &mut ::std::vec::Vec { + &mut self.intValue + } + // repeated string stringValue = 3; pub fn clear_stringValue(&mut self) { @@ -1461,6 +1591,14 @@ impl Capability { pub fn get_stringValue(&self) -> &[::std::string::String] { &self.stringValue } + + fn get_stringValue_for_reflect(&self) -> &::protobuf::RepeatedField<::std::string::String> { + &self.stringValue + } + + fn mut_stringValue_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> { + &mut self.stringValue + } } impl ::protobuf::Message for Capability { @@ -1469,24 +1607,24 @@ impl ::protobuf::Message for Capability { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_enum()); + let tmp = is.read_enum()?; self.typ = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.intValue)); + ::protobuf::rt::read_repeated_int64_into(wire_type, is, &mut self.intValue)?; }, 3 => { - try!(::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.stringValue)); + ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.stringValue)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1497,8 +1635,8 @@ impl ::protobuf::Message for Capability { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.typ { - my_size += ::protobuf::rt::enum_size(1, *value); + if let Some(v) = self.typ { + my_size += ::protobuf::rt::enum_size(1, v); }; for value in &self.intValue { my_size += ::protobuf::rt::value_size(2, *value, ::protobuf::wire_format::WireTypeVarint); @@ -1513,15 +1651,15 @@ impl ::protobuf::Message for Capability { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.typ { - try!(os.write_enum(1, v.value())); + os.write_enum(1, v.value())?; }; for v in &self.intValue { - try!(os.write_int64(2, *v)); + os.write_int64(2, *v)?; }; for v in &self.stringValue { - try!(os.write_string(3, &v)); + os.write_string(3, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1537,10 +1675,6 @@ impl ::protobuf::Message for Capability { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1563,18 +1697,20 @@ impl ::protobuf::MessageStatic for Capability { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "typ", - Capability::has_typ, - Capability::get_typ, + Capability::get_typ_for_reflect, + Capability::mut_typ_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_i64_accessor( + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( "intValue", - Capability::get_intValue, + Capability::get_intValue_for_reflect, + Capability::mut_intValue_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_string_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "stringValue", - Capability::get_stringValue, + Capability::get_stringValue_for_reflect, + Capability::mut_stringValue_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Capability", @@ -1595,28 +1731,25 @@ impl ::protobuf::Clear for Capability { } } -impl ::std::cmp::PartialEq for Capability { - fn eq(&self, other: &Capability) -> bool { - self.typ == other.typ && - self.intValue == other.intValue && - self.stringValue == other.stringValue && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Capability { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Capability { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Goodbye { // message fields reason: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1633,13 +1766,7 @@ impl Goodbye { ptr: 0 as *const Goodbye, }; unsafe { - instance.get(|| { - Goodbye { - reason: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Goodbye::new) } } @@ -1678,6 +1805,14 @@ impl Goodbye { None => "", } } + + fn get_reason_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.reason + } + + fn mut_reason_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.reason + } } impl ::protobuf::Message for Goodbye { @@ -1686,14 +1821,14 @@ impl ::protobuf::Message for Goodbye { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.reason)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.reason)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -1704,8 +1839,8 @@ impl ::protobuf::Message for Goodbye { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.reason { - my_size += ::protobuf::rt::string_size(1, &value); + if let Some(v) = self.reason.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -1714,9 +1849,9 @@ impl ::protobuf::Message for Goodbye { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.reason.as_ref() { - try!(os.write_string(1, &v)); + os.write_string(1, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -1732,10 +1867,6 @@ impl ::protobuf::Message for Goodbye { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -1758,10 +1889,10 @@ impl ::protobuf::MessageStatic for Goodbye { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "reason", - Goodbye::has_reason, - Goodbye::get_reason, + Goodbye::get_reason_for_reflect, + Goodbye::mut_reason_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Goodbye", @@ -1780,20 +1911,19 @@ impl ::protobuf::Clear for Goodbye { } } -impl ::std::cmp::PartialEq for Goodbye { - fn eq(&self, other: &Goodbye) -> bool { - self.reason == other.reason && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Goodbye { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for Goodbye { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct State { // message fields context_uri: ::protobuf::SingularField<::std::string::String>, @@ -1813,7 +1943,7 @@ pub struct State { ad: ::protobuf::SingularPtrField, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -1830,27 +1960,7 @@ impl State { ptr: 0 as *const State, }; unsafe { - instance.get(|| { - State { - context_uri: ::protobuf::SingularField::none(), - index: ::std::option::Option::None, - position_ms: ::std::option::Option::None, - status: ::std::option::Option::None, - position_measured_at: ::std::option::Option::None, - context_description: ::protobuf::SingularField::none(), - shuffle: ::std::option::Option::None, - repeat: ::std::option::Option::None, - last_command_ident: ::protobuf::SingularField::none(), - last_command_msgid: ::std::option::Option::None, - playing_from_fallback: ::std::option::Option::None, - row: ::std::option::Option::None, - playing_track_index: ::std::option::Option::None, - track: ::protobuf::RepeatedField::new(), - ad: ::protobuf::SingularPtrField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(State::new) } } @@ -1890,6 +2000,14 @@ impl State { } } + fn get_context_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.context_uri + } + + fn mut_context_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.context_uri + } + // optional uint32 index = 3; pub fn clear_index(&mut self) { @@ -1909,6 +2027,14 @@ impl State { self.index.unwrap_or(0) } + fn get_index_for_reflect(&self) -> &::std::option::Option { + &self.index + } + + fn mut_index_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.index + } + // optional uint32 position_ms = 4; pub fn clear_position_ms(&mut self) { @@ -1928,6 +2054,14 @@ impl State { self.position_ms.unwrap_or(0) } + fn get_position_ms_for_reflect(&self) -> &::std::option::Option { + &self.position_ms + } + + fn mut_position_ms_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.position_ms + } + // optional .PlayStatus status = 5; pub fn clear_status(&mut self) { @@ -1947,6 +2081,14 @@ impl State { self.status.unwrap_or(PlayStatus::kPlayStatusStop) } + fn get_status_for_reflect(&self) -> &::std::option::Option { + &self.status + } + + fn mut_status_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.status + } + // optional uint64 position_measured_at = 7; pub fn clear_position_measured_at(&mut self) { @@ -1966,6 +2108,14 @@ impl State { self.position_measured_at.unwrap_or(0) } + fn get_position_measured_at_for_reflect(&self) -> &::std::option::Option { + &self.position_measured_at + } + + fn mut_position_measured_at_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.position_measured_at + } + // optional string context_description = 8; pub fn clear_context_description(&mut self) { @@ -2002,6 +2152,14 @@ impl State { } } + fn get_context_description_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.context_description + } + + fn mut_context_description_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.context_description + } + // optional bool shuffle = 13; pub fn clear_shuffle(&mut self) { @@ -2021,6 +2179,14 @@ impl State { self.shuffle.unwrap_or(false) } + fn get_shuffle_for_reflect(&self) -> &::std::option::Option { + &self.shuffle + } + + fn mut_shuffle_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.shuffle + } + // optional bool repeat = 14; pub fn clear_repeat(&mut self) { @@ -2040,6 +2206,14 @@ impl State { self.repeat.unwrap_or(false) } + fn get_repeat_for_reflect(&self) -> &::std::option::Option { + &self.repeat + } + + fn mut_repeat_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.repeat + } + // optional string last_command_ident = 20; pub fn clear_last_command_ident(&mut self) { @@ -2076,6 +2250,14 @@ impl State { } } + fn get_last_command_ident_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.last_command_ident + } + + fn mut_last_command_ident_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.last_command_ident + } + // optional uint32 last_command_msgid = 21; pub fn clear_last_command_msgid(&mut self) { @@ -2095,6 +2277,14 @@ impl State { self.last_command_msgid.unwrap_or(0) } + fn get_last_command_msgid_for_reflect(&self) -> &::std::option::Option { + &self.last_command_msgid + } + + fn mut_last_command_msgid_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.last_command_msgid + } + // optional bool playing_from_fallback = 24; pub fn clear_playing_from_fallback(&mut self) { @@ -2114,6 +2304,14 @@ impl State { self.playing_from_fallback.unwrap_or(false) } + fn get_playing_from_fallback_for_reflect(&self) -> &::std::option::Option { + &self.playing_from_fallback + } + + fn mut_playing_from_fallback_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.playing_from_fallback + } + // optional uint32 row = 25; pub fn clear_row(&mut self) { @@ -2133,6 +2331,14 @@ impl State { self.row.unwrap_or(0) } + fn get_row_for_reflect(&self) -> &::std::option::Option { + &self.row + } + + fn mut_row_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.row + } + // optional uint32 playing_track_index = 26; pub fn clear_playing_track_index(&mut self) { @@ -2152,6 +2358,14 @@ impl State { self.playing_track_index.unwrap_or(0) } + fn get_playing_track_index_for_reflect(&self) -> &::std::option::Option { + &self.playing_track_index + } + + fn mut_playing_track_index_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.playing_track_index + } + // repeated .TrackRef track = 27; pub fn clear_track(&mut self) { @@ -2177,6 +2391,14 @@ impl State { &self.track } + fn get_track_for_reflect(&self) -> &::protobuf::RepeatedField { + &self.track + } + + fn mut_track_for_reflect(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.track + } + // optional .Ad ad = 28; pub fn clear_ad(&mut self) { @@ -2209,6 +2431,14 @@ impl State { pub fn get_ad(&self) -> &Ad { self.ad.as_ref().unwrap_or_else(|| Ad::default_instance()) } + + fn get_ad_for_reflect(&self) -> &::protobuf::SingularPtrField { + &self.ad + } + + fn mut_ad_for_reflect(&mut self) -> &mut ::protobuf::SingularPtrField { + &mut self.ad + } } impl ::protobuf::Message for State { @@ -2217,96 +2447,96 @@ impl ::protobuf::Message for State { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context_uri)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context_uri)?; }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.index = ::std::option::Option::Some(tmp); }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.position_ms = ::std::option::Option::Some(tmp); }, 5 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_enum()); + let tmp = is.read_enum()?; self.status = ::std::option::Option::Some(tmp); }, 7 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint64()); + let tmp = is.read_uint64()?; self.position_measured_at = ::std::option::Option::Some(tmp); }, 8 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context_description)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context_description)?; }, 13 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.shuffle = ::std::option::Option::Some(tmp); }, 14 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.repeat = ::std::option::Option::Some(tmp); }, 20 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.last_command_ident)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.last_command_ident)?; }, 21 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.last_command_msgid = ::std::option::Option::Some(tmp); }, 24 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.playing_from_fallback = ::std::option::Option::Some(tmp); }, 25 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.row = ::std::option::Option::Some(tmp); }, 26 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_uint32()); + let tmp = is.read_uint32()?; self.playing_track_index = ::std::option::Option::Some(tmp); }, 27 => { - try!(::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)); + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.track)?; }, 28 => { - try!(::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.ad)); + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.ad)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2317,51 +2547,51 @@ impl ::protobuf::Message for State { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.context_uri { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.context_uri.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - for value in &self.index { - my_size += ::protobuf::rt::value_size(3, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.index { + my_size += ::protobuf::rt::value_size(3, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.position_ms { - my_size += ::protobuf::rt::value_size(4, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.position_ms { + my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.status { - my_size += ::protobuf::rt::enum_size(5, *value); + if let Some(v) = self.status { + my_size += ::protobuf::rt::enum_size(5, v); }; - for value in &self.position_measured_at { - my_size += ::protobuf::rt::value_size(7, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.position_measured_at { + my_size += ::protobuf::rt::value_size(7, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.context_description { - my_size += ::protobuf::rt::string_size(8, &value); + if let Some(v) = self.context_description.as_ref() { + my_size += ::protobuf::rt::string_size(8, &v); }; - if self.shuffle.is_some() { + if let Some(v) = self.shuffle { my_size += 2; }; - if self.repeat.is_some() { + if let Some(v) = self.repeat { my_size += 2; }; - for value in &self.last_command_ident { - my_size += ::protobuf::rt::string_size(20, &value); + if let Some(v) = self.last_command_ident.as_ref() { + my_size += ::protobuf::rt::string_size(20, &v); }; - for value in &self.last_command_msgid { - my_size += ::protobuf::rt::value_size(21, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.last_command_msgid { + my_size += ::protobuf::rt::value_size(21, v, ::protobuf::wire_format::WireTypeVarint); }; - if self.playing_from_fallback.is_some() { + if let Some(v) = self.playing_from_fallback { my_size += 3; }; - for value in &self.row { - my_size += ::protobuf::rt::value_size(25, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.row { + my_size += ::protobuf::rt::value_size(25, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.playing_track_index { - my_size += ::protobuf::rt::value_size(26, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.playing_track_index { + my_size += ::protobuf::rt::value_size(26, v, ::protobuf::wire_format::WireTypeVarint); }; for value in &self.track { let len = value.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; - for value in &self.ad { - let len = value.compute_size(); + if let Some(v) = self.ad.as_ref() { + let len = v.compute_size(); my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); @@ -2371,55 +2601,55 @@ impl ::protobuf::Message for State { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.context_uri.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.index { - try!(os.write_uint32(3, v)); + os.write_uint32(3, v)?; }; if let Some(v) = self.position_ms { - try!(os.write_uint32(4, v)); + os.write_uint32(4, v)?; }; if let Some(v) = self.status { - try!(os.write_enum(5, v.value())); + os.write_enum(5, v.value())?; }; if let Some(v) = self.position_measured_at { - try!(os.write_uint64(7, v)); + os.write_uint64(7, v)?; }; if let Some(v) = self.context_description.as_ref() { - try!(os.write_string(8, &v)); + os.write_string(8, &v)?; }; if let Some(v) = self.shuffle { - try!(os.write_bool(13, v)); + os.write_bool(13, v)?; }; if let Some(v) = self.repeat { - try!(os.write_bool(14, v)); + os.write_bool(14, v)?; }; if let Some(v) = self.last_command_ident.as_ref() { - try!(os.write_string(20, &v)); + os.write_string(20, &v)?; }; if let Some(v) = self.last_command_msgid { - try!(os.write_uint32(21, v)); + os.write_uint32(21, v)?; }; if let Some(v) = self.playing_from_fallback { - try!(os.write_bool(24, v)); + os.write_bool(24, v)?; }; if let Some(v) = self.row { - try!(os.write_uint32(25, v)); + os.write_uint32(25, v)?; }; if let Some(v) = self.playing_track_index { - try!(os.write_uint32(26, v)); + os.write_uint32(26, v)?; }; for v in &self.track { - try!(os.write_tag(27, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(27, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; if let Some(v) = self.ad.as_ref() { - try!(os.write_tag(28, ::protobuf::wire_format::WireTypeLengthDelimited)); - try!(os.write_raw_varint32(v.get_cached_size())); - try!(v.write_to_with_cached_sizes(os)); + os.write_tag(28, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2435,10 +2665,6 @@ impl ::protobuf::Message for State { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2461,79 +2687,80 @@ impl ::protobuf::MessageStatic for State { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "context_uri", - State::has_context_uri, - State::get_context_uri, + State::get_context_uri_for_reflect, + State::mut_context_uri_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "index", - State::has_index, - State::get_index, + State::get_index_for_reflect, + State::mut_index_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "position_ms", - State::has_position_ms, - State::get_position_ms, + State::get_position_ms_for_reflect, + State::mut_position_ms_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_enum_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( "status", - State::has_status, - State::get_status, + State::get_status_for_reflect, + State::mut_status_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u64_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>( "position_measured_at", - State::has_position_measured_at, - State::get_position_measured_at, + State::get_position_measured_at_for_reflect, + State::mut_position_measured_at_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "context_description", - State::has_context_description, - State::get_context_description, + State::get_context_description_for_reflect, + State::mut_context_description_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "shuffle", - State::has_shuffle, - State::get_shuffle, + State::get_shuffle_for_reflect, + State::mut_shuffle_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "repeat", - State::has_repeat, - State::get_repeat, + State::get_repeat_for_reflect, + State::mut_repeat_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "last_command_ident", - State::has_last_command_ident, - State::get_last_command_ident, + State::get_last_command_ident_for_reflect, + State::mut_last_command_ident_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "last_command_msgid", - State::has_last_command_msgid, - State::get_last_command_msgid, + State::get_last_command_msgid_for_reflect, + State::mut_last_command_msgid_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "playing_from_fallback", - State::has_playing_from_fallback, - State::get_playing_from_fallback, + State::get_playing_from_fallback_for_reflect, + State::mut_playing_from_fallback_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "row", - State::has_row, - State::get_row, + State::get_row_for_reflect, + State::mut_row_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_u32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint32>( "playing_track_index", - State::has_playing_track_index, - State::get_playing_track_index, + State::get_playing_track_index_for_reflect, + State::mut_playing_track_index_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_repeated_message_accessor( + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "track", - State::get_track, + State::get_track_for_reflect, + State::mut_track_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_message_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( "ad", - State::has_ad, - State::get_ad, + State::get_ad_for_reflect, + State::mut_ad_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "State", @@ -2566,34 +2793,19 @@ impl ::protobuf::Clear for State { } } -impl ::std::cmp::PartialEq for State { - fn eq(&self, other: &State) -> bool { - self.context_uri == other.context_uri && - self.index == other.index && - self.position_ms == other.position_ms && - self.status == other.status && - self.position_measured_at == other.position_measured_at && - self.context_description == other.context_description && - self.shuffle == other.shuffle && - self.repeat == other.repeat && - self.last_command_ident == other.last_command_ident && - self.last_command_msgid == other.last_command_msgid && - self.playing_from_fallback == other.playing_from_fallback && - self.row == other.row && - self.playing_track_index == other.playing_track_index && - self.track == other.track && - self.ad == other.ad && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for State { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for State { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct TrackRef { // message fields gid: ::protobuf::SingularField<::std::vec::Vec>, @@ -2602,7 +2814,7 @@ pub struct TrackRef { context: ::protobuf::SingularField<::std::string::String>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2619,16 +2831,7 @@ impl TrackRef { ptr: 0 as *const TrackRef, }; unsafe { - instance.get(|| { - TrackRef { - gid: ::protobuf::SingularField::none(), - uri: ::protobuf::SingularField::none(), - queued: ::std::option::Option::None, - context: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(TrackRef::new) } } @@ -2668,6 +2871,14 @@ impl TrackRef { } } + fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gid + } + + fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gid + } + // optional string uri = 2; pub fn clear_uri(&mut self) { @@ -2704,6 +2915,14 @@ impl TrackRef { } } + fn get_uri_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.uri + } + + fn mut_uri_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.uri + } + // optional bool queued = 3; pub fn clear_queued(&mut self) { @@ -2723,6 +2942,14 @@ impl TrackRef { self.queued.unwrap_or(false) } + fn get_queued_for_reflect(&self) -> &::std::option::Option { + &self.queued + } + + fn mut_queued_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.queued + } + // optional string context = 4; pub fn clear_context(&mut self) { @@ -2758,6 +2985,14 @@ impl TrackRef { None => "", } } + + fn get_context_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.context + } + + fn mut_context_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.context + } } impl ::protobuf::Message for TrackRef { @@ -2766,27 +3001,27 @@ impl ::protobuf::Message for TrackRef { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?; }, 2 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.uri)?; }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_bool()); + let tmp = is.read_bool()?; self.queued = ::std::option::Option::Some(tmp); }, 4 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.context)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -2797,17 +3032,17 @@ impl ::protobuf::Message for TrackRef { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.gid { - my_size += ::protobuf::rt::bytes_size(1, &value); + if let Some(v) = self.gid.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); }; - for value in &self.uri { - my_size += ::protobuf::rt::string_size(2, &value); + if let Some(v) = self.uri.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); }; - if self.queued.is_some() { + if let Some(v) = self.queued { my_size += 2; }; - for value in &self.context { - my_size += ::protobuf::rt::string_size(4, &value); + if let Some(v) = self.context.as_ref() { + my_size += ::protobuf::rt::string_size(4, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -2816,18 +3051,18 @@ impl ::protobuf::Message for TrackRef { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.gid.as_ref() { - try!(os.write_bytes(1, &v)); + os.write_bytes(1, &v)?; }; if let Some(v) = self.uri.as_ref() { - try!(os.write_string(2, &v)); + os.write_string(2, &v)?; }; if let Some(v) = self.queued { - try!(os.write_bool(3, v)); + os.write_bool(3, v)?; }; if let Some(v) = self.context.as_ref() { - try!(os.write_string(4, &v)); + os.write_string(4, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -2843,10 +3078,6 @@ impl ::protobuf::Message for TrackRef { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -2869,25 +3100,25 @@ impl ::protobuf::MessageStatic for TrackRef { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - TrackRef::has_gid, - TrackRef::get_gid, + TrackRef::get_gid_for_reflect, + TrackRef::mut_gid_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "uri", - TrackRef::has_uri, - TrackRef::get_uri, + TrackRef::get_uri_for_reflect, + TrackRef::mut_uri_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "queued", - TrackRef::has_queued, - TrackRef::get_queued, + TrackRef::get_queued_for_reflect, + TrackRef::mut_queued_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "context", - TrackRef::has_context, - TrackRef::get_context, + TrackRef::get_context_for_reflect, + TrackRef::mut_context_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "TrackRef", @@ -2909,23 +3140,19 @@ impl ::protobuf::Clear for TrackRef { } } -impl ::std::cmp::PartialEq for TrackRef { - fn eq(&self, other: &TrackRef) -> bool { - self.gid == other.gid && - self.uri == other.uri && - self.queued == other.queued && - self.context == other.context && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for TrackRef { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } -#[derive(Clone,Default)] +impl ::protobuf::reflect::ProtobufValue for TrackRef { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] pub struct Ad { // message fields next: ::std::option::Option, @@ -2939,7 +3166,7 @@ pub struct Ad { gid: ::protobuf::SingularField<::std::vec::Vec>, // special fields unknown_fields: ::protobuf::UnknownFields, - cached_size: ::std::cell::Cell, + cached_size: ::protobuf::CachedSize, } // see codegen.rs for the explanation why impl Sync explicitly @@ -2956,21 +3183,7 @@ impl Ad { ptr: 0 as *const Ad, }; unsafe { - instance.get(|| { - Ad { - next: ::std::option::Option::None, - ogg_fid: ::protobuf::SingularField::none(), - image_fid: ::protobuf::SingularField::none(), - duration: ::std::option::Option::None, - click_url: ::protobuf::SingularField::none(), - impression_url: ::protobuf::SingularField::none(), - product: ::protobuf::SingularField::none(), - advertiser: ::protobuf::SingularField::none(), - gid: ::protobuf::SingularField::none(), - unknown_fields: ::protobuf::UnknownFields::new(), - cached_size: ::std::cell::Cell::new(0), - } - }) + instance.get(Ad::new) } } @@ -2993,6 +3206,14 @@ impl Ad { self.next.unwrap_or(0) } + fn get_next_for_reflect(&self) -> &::std::option::Option { + &self.next + } + + fn mut_next_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.next + } + // optional bytes ogg_fid = 2; pub fn clear_ogg_fid(&mut self) { @@ -3029,6 +3250,14 @@ impl Ad { } } + fn get_ogg_fid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.ogg_fid + } + + fn mut_ogg_fid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.ogg_fid + } + // optional bytes image_fid = 3; pub fn clear_image_fid(&mut self) { @@ -3065,6 +3294,14 @@ impl Ad { } } + fn get_image_fid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.image_fid + } + + fn mut_image_fid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.image_fid + } + // optional int32 duration = 4; pub fn clear_duration(&mut self) { @@ -3084,6 +3321,14 @@ impl Ad { self.duration.unwrap_or(0) } + fn get_duration_for_reflect(&self) -> &::std::option::Option { + &self.duration + } + + fn mut_duration_for_reflect(&mut self) -> &mut ::std::option::Option { + &mut self.duration + } + // optional string click_url = 5; pub fn clear_click_url(&mut self) { @@ -3120,6 +3365,14 @@ impl Ad { } } + fn get_click_url_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.click_url + } + + fn mut_click_url_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.click_url + } + // optional string impression_url = 6; pub fn clear_impression_url(&mut self) { @@ -3156,6 +3409,14 @@ impl Ad { } } + fn get_impression_url_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.impression_url + } + + fn mut_impression_url_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.impression_url + } + // optional string product = 7; pub fn clear_product(&mut self) { @@ -3192,6 +3453,14 @@ impl Ad { } } + fn get_product_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.product + } + + fn mut_product_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.product + } + // optional string advertiser = 8; pub fn clear_advertiser(&mut self) { @@ -3228,6 +3497,14 @@ impl Ad { } } + fn get_advertiser_for_reflect(&self) -> &::protobuf::SingularField<::std::string::String> { + &self.advertiser + } + + fn mut_advertiser_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::string::String> { + &mut self.advertiser + } + // optional bytes gid = 9; pub fn clear_gid(&mut self) { @@ -3263,6 +3540,14 @@ impl Ad { None => &[], } } + + fn get_gid_for_reflect(&self) -> &::protobuf::SingularField<::std::vec::Vec> { + &self.gid + } + + fn mut_gid_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec> { + &mut self.gid + } } impl ::protobuf::Message for Ad { @@ -3271,46 +3556,46 @@ impl ::protobuf::Message for Ad { } fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { - while !try!(is.eof()) { - let (field_number, wire_type) = try!(is.read_tag_unpack()); + 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 = try!(is.read_int32()); + let tmp = is.read_int32()?; self.next = ::std::option::Option::Some(tmp); }, 2 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.ogg_fid)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.ogg_fid)?; }, 3 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.image_fid)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.image_fid)?; }, 4 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); }; - let tmp = try!(is.read_int32()); + let tmp = is.read_int32()?; self.duration = ::std::option::Option::Some(tmp); }, 5 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.click_url)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.click_url)?; }, 6 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.impression_url)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.impression_url)?; }, 7 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.product)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.product)?; }, 8 => { - try!(::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.advertiser)); + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.advertiser)?; }, 9 => { - try!(::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)); + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?; }, _ => { - try!(::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())); + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; }, }; } @@ -3321,32 +3606,32 @@ impl ::protobuf::Message for Ad { #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; - for value in &self.next { - my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.next { + my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.ogg_fid { - my_size += ::protobuf::rt::bytes_size(2, &value); + if let Some(v) = self.ogg_fid.as_ref() { + my_size += ::protobuf::rt::bytes_size(2, &v); }; - for value in &self.image_fid { - my_size += ::protobuf::rt::bytes_size(3, &value); + if let Some(v) = self.image_fid.as_ref() { + my_size += ::protobuf::rt::bytes_size(3, &v); }; - for value in &self.duration { - my_size += ::protobuf::rt::value_size(4, *value, ::protobuf::wire_format::WireTypeVarint); + if let Some(v) = self.duration { + my_size += ::protobuf::rt::value_size(4, v, ::protobuf::wire_format::WireTypeVarint); }; - for value in &self.click_url { - my_size += ::protobuf::rt::string_size(5, &value); + if let Some(v) = self.click_url.as_ref() { + my_size += ::protobuf::rt::string_size(5, &v); }; - for value in &self.impression_url { - my_size += ::protobuf::rt::string_size(6, &value); + if let Some(v) = self.impression_url.as_ref() { + my_size += ::protobuf::rt::string_size(6, &v); }; - for value in &self.product { - my_size += ::protobuf::rt::string_size(7, &value); + if let Some(v) = self.product.as_ref() { + my_size += ::protobuf::rt::string_size(7, &v); }; - for value in &self.advertiser { - my_size += ::protobuf::rt::string_size(8, &value); + if let Some(v) = self.advertiser.as_ref() { + my_size += ::protobuf::rt::string_size(8, &v); }; - for value in &self.gid { - my_size += ::protobuf::rt::bytes_size(9, &value); + if let Some(v) = self.gid.as_ref() { + my_size += ::protobuf::rt::bytes_size(9, &v); }; my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); @@ -3355,33 +3640,33 @@ impl ::protobuf::Message for Ad { fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(v) = self.next { - try!(os.write_int32(1, v)); + os.write_int32(1, v)?; }; if let Some(v) = self.ogg_fid.as_ref() { - try!(os.write_bytes(2, &v)); + os.write_bytes(2, &v)?; }; if let Some(v) = self.image_fid.as_ref() { - try!(os.write_bytes(3, &v)); + os.write_bytes(3, &v)?; }; if let Some(v) = self.duration { - try!(os.write_int32(4, v)); + os.write_int32(4, v)?; }; if let Some(v) = self.click_url.as_ref() { - try!(os.write_string(5, &v)); + os.write_string(5, &v)?; }; if let Some(v) = self.impression_url.as_ref() { - try!(os.write_string(6, &v)); + os.write_string(6, &v)?; }; if let Some(v) = self.product.as_ref() { - try!(os.write_string(7, &v)); + os.write_string(7, &v)?; }; if let Some(v) = self.advertiser.as_ref() { - try!(os.write_string(8, &v)); + os.write_string(8, &v)?; }; if let Some(v) = self.gid.as_ref() { - try!(os.write_bytes(9, &v)); + os.write_bytes(9, &v)?; }; - try!(os.write_unknown_fields(self.get_unknown_fields())); + os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } @@ -3397,10 +3682,6 @@ impl ::protobuf::Message for Ad { &mut self.unknown_fields } - fn type_id(&self) -> ::std::any::TypeId { - ::std::any::TypeId::of::() - } - fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } @@ -3423,50 +3704,50 @@ impl ::protobuf::MessageStatic for Ad { unsafe { descriptor.get(|| { let mut fields = ::std::vec::Vec::new(); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "next", - Ad::has_next, - Ad::get_next, + Ad::get_next_for_reflect, + Ad::mut_next_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "ogg_fid", - Ad::has_ogg_fid, - Ad::get_ogg_fid, + Ad::get_ogg_fid_for_reflect, + Ad::mut_ogg_fid_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "image_fid", - Ad::has_image_fid, - Ad::get_image_fid, + Ad::get_image_fid_for_reflect, + Ad::mut_image_fid_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_i32_accessor( + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( "duration", - Ad::has_duration, - Ad::get_duration, + Ad::get_duration_for_reflect, + Ad::mut_duration_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "click_url", - Ad::has_click_url, - Ad::get_click_url, + Ad::get_click_url_for_reflect, + Ad::mut_click_url_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "impression_url", - Ad::has_impression_url, - Ad::get_impression_url, + Ad::get_impression_url_for_reflect, + Ad::mut_impression_url_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "product", - Ad::has_product, - Ad::get_product, + Ad::get_product_for_reflect, + Ad::mut_product_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_string_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "advertiser", - Ad::has_advertiser, - Ad::get_advertiser, + Ad::get_advertiser_for_reflect, + Ad::mut_advertiser_for_reflect, )); - fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor( + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( "gid", - Ad::has_gid, - Ad::get_gid, + Ad::get_gid_for_reflect, + Ad::mut_gid_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::( "Ad", @@ -3493,27 +3774,18 @@ impl ::protobuf::Clear for Ad { } } -impl ::std::cmp::PartialEq for Ad { - fn eq(&self, other: &Ad) -> bool { - self.next == other.next && - self.ogg_fid == other.ogg_fid && - self.image_fid == other.image_fid && - self.duration == other.duration && - self.click_url == other.click_url && - self.impression_url == other.impression_url && - self.product == other.product && - self.advertiser == other.advertiser && - self.gid == other.gid && - self.unknown_fields == other.unknown_fields - } -} - impl ::std::fmt::Debug for Ad { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } +impl ::protobuf::reflect::ProtobufValue for Ad { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum MessageType { kMessageTypeHello = 1, @@ -3611,6 +3883,12 @@ impl ::protobuf::ProtobufEnum for MessageType { impl ::std::marker::Copy for MessageType { } +impl ::protobuf::reflect::ProtobufValue for MessageType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum CapabilityType { kSupportedContexts = 1, @@ -3681,6 +3959,12 @@ impl ::protobuf::ProtobufEnum for CapabilityType { impl ::std::marker::Copy for CapabilityType { } +impl ::protobuf::reflect::ProtobufValue for CapabilityType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum PlayStatus { kPlayStatusStop = 0, @@ -3730,6 +4014,12 @@ impl ::protobuf::ProtobufEnum for PlayStatus { impl ::std::marker::Copy for PlayStatus { } +impl ::protobuf::reflect::ProtobufValue for PlayStatus { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + static file_descriptor_proto_data: &'static [u8] = &[ 0x0a, 0x0b, 0x73, 0x70, 0x69, 0x72, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd3, 0x03, 0x0a, 0x05, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,