You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/rust/trezor-client/src/protos/generated/messages_hello.rs

463 lines
16 KiB

// This file is generated by rust-protobuf 3.3.0. Do not edit
// .proto file is parsed by protoc 3.19.6
// @generated
// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_results)]
#![allow(unused_mut)]
//! Generated file from `messages-hello.proto`
/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_3_0;
// @@protoc_insertion_point(message:hw.trezor.messages.helloworld.HelloWorldRequest)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct HelloWorldRequest {
// message fields
// @@protoc_insertion_point(field:hw.trezor.messages.helloworld.HelloWorldRequest.name)
pub name: ::std::option::Option<::std::string::String>,
// @@protoc_insertion_point(field:hw.trezor.messages.helloworld.HelloWorldRequest.amount)
pub amount: ::std::option::Option<u32>,
// @@protoc_insertion_point(field:hw.trezor.messages.helloworld.HelloWorldRequest.show_display)
pub show_display: ::std::option::Option<bool>,
// special fields
// @@protoc_insertion_point(special_field:hw.trezor.messages.helloworld.HelloWorldRequest.special_fields)
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a HelloWorldRequest {
fn default() -> &'a HelloWorldRequest {
<HelloWorldRequest as ::protobuf::Message>::default_instance()
}
}
impl HelloWorldRequest {
pub fn new() -> HelloWorldRequest {
::std::default::Default::default()
}
// required string name = 1;
pub fn name(&self) -> &str {
match self.name.as_ref() {
Some(v) => v,
None => "",
}
}
pub fn clear_name(&mut self) {
self.name = ::std::option::Option::None;
}
pub fn has_name(&self) -> bool {
self.name.is_some()
}
// Param is passed by value, moved
pub fn set_name(&mut self, v: ::std::string::String) {
self.name = ::std::option::Option::Some(v);
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_name(&mut self) -> &mut ::std::string::String {
if self.name.is_none() {
self.name = ::std::option::Option::Some(::std::string::String::new());
}
self.name.as_mut().unwrap()
}
// Take field
pub fn take_name(&mut self) -> ::std::string::String {
self.name.take().unwrap_or_else(|| ::std::string::String::new())
}
// optional uint32 amount = 2;
pub fn amount(&self) -> u32 {
self.amount.unwrap_or(1u32)
}
pub fn clear_amount(&mut self) {
self.amount = ::std::option::Option::None;
}
pub fn has_amount(&self) -> bool {
self.amount.is_some()
}
// Param is passed by value, moved
pub fn set_amount(&mut self, v: u32) {
self.amount = ::std::option::Option::Some(v);
}
// optional bool show_display = 3;
pub fn show_display(&self) -> bool {
self.show_display.unwrap_or(false)
}
pub fn clear_show_display(&mut self) {
self.show_display = ::std::option::Option::None;
}
pub fn has_show_display(&self) -> bool {
self.show_display.is_some()
}
// Param is passed by value, moved
pub fn set_show_display(&mut self, v: bool) {
self.show_display = ::std::option::Option::Some(v);
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(3);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
"name",
|m: &HelloWorldRequest| { &m.name },
|m: &mut HelloWorldRequest| { &mut m.name },
));
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
"amount",
|m: &HelloWorldRequest| { &m.amount },
|m: &mut HelloWorldRequest| { &mut m.amount },
));
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
"show_display",
|m: &HelloWorldRequest| { &m.show_display },
|m: &mut HelloWorldRequest| { &mut m.show_display },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<HelloWorldRequest>(
"HelloWorldRequest",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for HelloWorldRequest {
const NAME: &'static str = "HelloWorldRequest";
fn is_initialized(&self) -> bool {
if self.name.is_none() {
return false;
}
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.name = ::std::option::Option::Some(is.read_string()?);
},
16 => {
self.amount = ::std::option::Option::Some(is.read_uint32()?);
},
24 => {
self.show_display = ::std::option::Option::Some(is.read_bool()?);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if let Some(v) = self.name.as_ref() {
my_size += ::protobuf::rt::string_size(1, &v);
}
if let Some(v) = self.amount {
my_size += ::protobuf::rt::uint32_size(2, v);
}
if let Some(v) = self.show_display {
my_size += 1 + 1;
}
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if let Some(v) = self.name.as_ref() {
os.write_string(1, v)?;
}
if let Some(v) = self.amount {
os.write_uint32(2, v)?;
}
if let Some(v) = self.show_display {
os.write_bool(3, v)?;
}
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> HelloWorldRequest {
HelloWorldRequest::new()
}
fn clear(&mut self) {
self.name = ::std::option::Option::None;
self.amount = ::std::option::Option::None;
self.show_display = ::std::option::Option::None;
self.special_fields.clear();
}
fn default_instance() -> &'static HelloWorldRequest {
static instance: HelloWorldRequest = HelloWorldRequest {
name: ::std::option::Option::None,
amount: ::std::option::Option::None,
show_display: ::std::option::Option::None,
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for HelloWorldRequest {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("HelloWorldRequest").unwrap()).clone()
}
}
impl ::std::fmt::Display for HelloWorldRequest {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for HelloWorldRequest {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
// @@protoc_insertion_point(message:hw.trezor.messages.helloworld.HelloWorldResponse)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct HelloWorldResponse {
// message fields
// @@protoc_insertion_point(field:hw.trezor.messages.helloworld.HelloWorldResponse.text)
pub text: ::std::option::Option<::std::string::String>,
// special fields
// @@protoc_insertion_point(special_field:hw.trezor.messages.helloworld.HelloWorldResponse.special_fields)
pub special_fields: ::protobuf::SpecialFields,
}
impl<'a> ::std::default::Default for &'a HelloWorldResponse {
fn default() -> &'a HelloWorldResponse {
<HelloWorldResponse as ::protobuf::Message>::default_instance()
}
}
impl HelloWorldResponse {
pub fn new() -> HelloWorldResponse {
::std::default::Default::default()
}
// required string text = 1;
pub fn text(&self) -> &str {
match self.text.as_ref() {
Some(v) => v,
None => "",
}
}
pub fn clear_text(&mut self) {
self.text = ::std::option::Option::None;
}
pub fn has_text(&self) -> bool {
self.text.is_some()
}
// Param is passed by value, moved
pub fn set_text(&mut self, v: ::std::string::String) {
self.text = ::std::option::Option::Some(v);
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
pub fn mut_text(&mut self) -> &mut ::std::string::String {
if self.text.is_none() {
self.text = ::std::option::Option::Some(::std::string::String::new());
}
self.text.as_mut().unwrap()
}
// Take field
pub fn take_text(&mut self) -> ::std::string::String {
self.text.take().unwrap_or_else(|| ::std::string::String::new())
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
let mut fields = ::std::vec::Vec::with_capacity(1);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
"text",
|m: &HelloWorldResponse| { &m.text },
|m: &mut HelloWorldResponse| { &mut m.text },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<HelloWorldResponse>(
"HelloWorldResponse",
fields,
oneofs,
)
}
}
impl ::protobuf::Message for HelloWorldResponse {
const NAME: &'static str = "HelloWorldResponse";
fn is_initialized(&self) -> bool {
if self.text.is_none() {
return false;
}
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
while let Some(tag) = is.read_raw_tag_or_eof()? {
match tag {
10 => {
self.text = ::std::option::Option::Some(is.read_string()?);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u64 {
let mut my_size = 0;
if let Some(v) = self.text.as_ref() {
my_size += ::protobuf::rt::string_size(1, &v);
}
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
if let Some(v) = self.text.as_ref() {
os.write_string(1, v)?;
}
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
}
fn special_fields(&self) -> &::protobuf::SpecialFields {
&self.special_fields
}
fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
&mut self.special_fields
}
fn new() -> HelloWorldResponse {
HelloWorldResponse::new()
}
fn clear(&mut self) {
self.text = ::std::option::Option::None;
self.special_fields.clear();
}
fn default_instance() -> &'static HelloWorldResponse {
static instance: HelloWorldResponse = HelloWorldResponse {
text: ::std::option::Option::None,
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
}
}
impl ::protobuf::MessageFull for HelloWorldResponse {
fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
descriptor.get(|| file_descriptor().message_by_package_relative_name("HelloWorldResponse").unwrap()).clone()
}
}
impl ::std::fmt::Display for HelloWorldResponse {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for HelloWorldResponse {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x14messages-hello.proto\x12\x1dhw.trezor.messages.helloworld\x1a\x0em\
essages.proto\"e\n\x11HelloWorldRequest\x12\x12\n\x04name\x18\x01\x20\
\x02(\tR\x04name\x12\x19\n\x06amount\x18\x02\x20\x01(\r:\x011R\x06amount\
\x12!\n\x0cshow_display\x18\x03\x20\x01(\x08R\x0bshowDisplay\"(\n\x12Hel\
loWorldResponse\x12\x12\n\x04text\x18\x01\x20\x02(\tR\x04textB>\n#com.sa\
toshilabs.trezor.lib.protobufB\x17TrezorMessageHelloWorld\
";
/// `FileDescriptorProto` object which was a source for this generated file
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
file_descriptor_proto_lazy.get(|| {
::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
})
}
/// `FileDescriptor` object which allows dynamic access to files
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
file_descriptor.get(|| {
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
let mut deps = ::std::vec::Vec::with_capacity(1);
deps.push(super::messages::file_descriptor().clone());
let mut messages = ::std::vec::Vec::with_capacity(2);
messages.push(HelloWorldRequest::generated_message_descriptor_data());
messages.push(HelloWorldResponse::generated_message_descriptor_data());
let mut enums = ::std::vec::Vec::with_capacity(0);
::protobuf::reflect::GeneratedFileDescriptor::new_generated(
file_descriptor_proto(),
deps,
messages,
enums,
)
});
::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
})
}