anychain_tron/protocol/
common.rs

1// This file is generated by rust-protobuf 3.3.0. Do not edit
2// .proto file is parsed by protoc --rust-out=...
3// @generated
4
5// https://github.com/rust-lang/rust-clippy/issues/702
6#![allow(unknown_lints)]
7#![allow(clippy::all)]
8
9#![allow(unused_attributes)]
10#![cfg_attr(rustfmt, rustfmt::skip)]
11
12#![allow(dead_code)]
13#![allow(missing_docs)]
14#![allow(non_camel_case_types)]
15#![allow(non_snake_case)]
16#![allow(non_upper_case_globals)]
17#![allow(trivial_casts)]
18#![allow(unused_results)]
19#![allow(unused_mut)]
20
21//! Generated file from `core/contract/common.proto`
22
23/// Generated files are compatible only with the same version
24/// of protobuf runtime.
25const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_2;
26
27#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
28// @@protoc_insertion_point(enum:protocol.ResourceCode)
29pub enum ResourceCode {
30    // @@protoc_insertion_point(enum_value:protocol.ResourceCode.BANDWIDTH)
31    BANDWIDTH = 0,
32    // @@protoc_insertion_point(enum_value:protocol.ResourceCode.ENERGY)
33    ENERGY = 1,
34    // @@protoc_insertion_point(enum_value:protocol.ResourceCode.TRON_POWER)
35    TRON_POWER = 2,
36}
37
38impl ::protobuf::Enum for ResourceCode {
39    const NAME: &'static str = "ResourceCode";
40
41    fn value(&self) -> i32 {
42        *self as i32
43    }
44
45    fn from_i32(value: i32) -> ::std::option::Option<ResourceCode> {
46        match value {
47            0 => ::std::option::Option::Some(ResourceCode::BANDWIDTH),
48            1 => ::std::option::Option::Some(ResourceCode::ENERGY),
49            2 => ::std::option::Option::Some(ResourceCode::TRON_POWER),
50            _ => ::std::option::Option::None
51        }
52    }
53
54    fn from_str(str: &str) -> ::std::option::Option<ResourceCode> {
55        match str {
56            "BANDWIDTH" => ::std::option::Option::Some(ResourceCode::BANDWIDTH),
57            "ENERGY" => ::std::option::Option::Some(ResourceCode::ENERGY),
58            "TRON_POWER" => ::std::option::Option::Some(ResourceCode::TRON_POWER),
59            _ => ::std::option::Option::None
60        }
61    }
62
63    const VALUES: &'static [ResourceCode] = &[
64        ResourceCode::BANDWIDTH,
65        ResourceCode::ENERGY,
66        ResourceCode::TRON_POWER,
67    ];
68}
69
70impl ::protobuf::EnumFull for ResourceCode {
71    fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
72        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
73        descriptor.get(|| file_descriptor().enum_by_package_relative_name("ResourceCode").unwrap()).clone()
74    }
75
76    fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
77        let index = *self as usize;
78        Self::enum_descriptor().value_by_index(index)
79    }
80}
81
82impl ::std::default::Default for ResourceCode {
83    fn default() -> Self {
84        ResourceCode::BANDWIDTH
85    }
86}
87
88impl ResourceCode {
89    fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
90        ::protobuf::reflect::GeneratedEnumDescriptorData::new::<ResourceCode>("ResourceCode")
91    }
92}
93
94static file_descriptor_proto_data: &'static [u8] = b"\
95    \n\x1acore/contract/common.proto\x12\x08protocol*9\n\x0cResourceCode\x12\
96    \r\n\tBANDWIDTH\x10\0\x12\n\n\x06ENERGY\x10\x01\x12\x0e\n\nTRON_POWER\
97    \x10\x02BE\n\x18org.tron.protos.contractZ)github.com/tronprotocol/grpc-g\
98    ateway/coreJ\xf6\x02\n\x06\x12\x04\0\0\x0c\x01\n\x08\n\x01\x0c\x12\x03\0\
99    \0\x12\n\x08\n\x01\x02\x12\x03\x02\0\x11\n\x08\n\x01\x08\x12\x03\x04\01\
100    \nH\n\x02\x08\x01\x12\x03\x04\01\"=Specify\x20the\x20name\x20of\x20the\
101    \x20package\x20that\x20generated\x20the\x20Java\x20file\n\n\x08\n\x01\
102    \x08\x12\x03\x06\0@\ng\n\x02\x08\x0b\x12\x03\x06\0@\x1a\\option\x20java_\
103    outer_classname\x20=\x20\"common\";\x20//Specify\x20the\x20class\x20name\
104    \x20of\x20the\x20generated\x20Java\x20file\n\n\n\n\x02\x05\0\x12\x04\x08\
105    \0\x0c\x01\n\n\n\x03\x05\0\x01\x12\x03\x08\x05\x11\n\x0b\n\x04\x05\0\x02\
106    \0\x12\x03\t\x02\x13\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\t\x02\x0b\n\x0c\
107    \n\x05\x05\0\x02\0\x02\x12\x03\t\x0e\x12\n\x0b\n\x04\x05\0\x02\x01\x12\
108    \x03\n\x02\x10\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\n\x02\x08\n\x0c\n\
109    \x05\x05\0\x02\x01\x02\x12\x03\n\x0b\x0f\n\x0b\n\x04\x05\0\x02\x02\x12\
110    \x03\x0b\x02\x14\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x0b\x02\x0c\n\x0c\
111    \n\x05\x05\0\x02\x02\x02\x12\x03\x0b\x0f\x13b\x06proto3\
112";
113
114/// `FileDescriptorProto` object which was a source for this generated file
115fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
116    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
117    file_descriptor_proto_lazy.get(|| {
118        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
119    })
120}
121
122/// `FileDescriptor` object which allows dynamic access to files
123pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
124    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
125    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
126    file_descriptor.get(|| {
127        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
128            let mut deps = ::std::vec::Vec::with_capacity(0);
129            let mut messages = ::std::vec::Vec::with_capacity(0);
130            let mut enums = ::std::vec::Vec::with_capacity(1);
131            enums.push(ResourceCode::generated_enum_descriptor_data());
132            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
133                file_descriptor_proto(),
134                deps,
135                messages,
136                enums,
137            )
138        });
139        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
140    })
141}