#![allow(unknown_lints)]
#![allow(clippy)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unsafe_code)]
#![allow(unused_imports)]
#![allow(unused_results)]
use protobuf::Message as Message_imported_for_functions;
use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions;
#[derive(PartialEq,Clone,Default)]
pub struct DBState {
pub refCount: u32,
pub state: ::std::option::Option<DBState_oneof_state>,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
#[derive(Clone,PartialEq)]
pub enum DBState_oneof_state {
account(Account),
node(StateNode),
}
impl DBState {
pub fn new() -> DBState {
::std::default::Default::default()
}
pub fn clear_account(&mut self) {
self.state = ::std::option::Option::None;
}
pub fn has_account(&self) -> bool {
match self.state {
::std::option::Option::Some(DBState_oneof_state::account(..)) => true,
_ => false,
}
}
pub fn set_account(&mut self, v: Account) {
self.state = ::std::option::Option::Some(DBState_oneof_state::account(v))
}
pub fn mut_account(&mut self) -> &mut Account {
if let ::std::option::Option::Some(DBState_oneof_state::account(_)) = self.state {
} else {
self.state = ::std::option::Option::Some(DBState_oneof_state::account(Account::new()));
}
match self.state {
::std::option::Option::Some(DBState_oneof_state::account(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_account(&mut self) -> Account {
if self.has_account() {
match self.state.take() {
::std::option::Option::Some(DBState_oneof_state::account(v)) => v,
_ => panic!(),
}
} else {
Account::new()
}
}
pub fn get_account(&self) -> &Account {
match self.state {
::std::option::Option::Some(DBState_oneof_state::account(ref v)) => v,
_ => Account::default_instance(),
}
}
pub fn clear_node(&mut self) {
self.state = ::std::option::Option::None;
}
pub fn has_node(&self) -> bool {
match self.state {
::std::option::Option::Some(DBState_oneof_state::node(..)) => true,
_ => false,
}
}
pub fn set_node(&mut self, v: StateNode) {
self.state = ::std::option::Option::Some(DBState_oneof_state::node(v))
}
pub fn mut_node(&mut self) -> &mut StateNode {
if let ::std::option::Option::Some(DBState_oneof_state::node(_)) = self.state {
} else {
self.state = ::std::option::Option::Some(DBState_oneof_state::node(StateNode::new()));
}
match self.state {
::std::option::Option::Some(DBState_oneof_state::node(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_node(&mut self) -> StateNode {
if self.has_node() {
match self.state.take() {
::std::option::Option::Some(DBState_oneof_state::node(v)) => v,
_ => panic!(),
}
} else {
StateNode::new()
}
}
pub fn get_node(&self) -> &StateNode {
match self.state {
::std::option::Option::Some(DBState_oneof_state::node(ref v)) => v,
_ => StateNode::default_instance(),
}
}
pub fn clear_refCount(&mut self) {
self.refCount = 0;
}
pub fn set_refCount(&mut self, v: u32) {
self.refCount = v;
}
pub fn get_refCount(&self) -> u32 {
self.refCount
}
}
impl ::protobuf::Message for DBState {
fn is_initialized(&self) -> bool {
if let Some(DBState_oneof_state::account(ref v)) = self.state {
if !v.is_initialized() {
return false;
}
}
if let Some(DBState_oneof_state::node(ref v)) = self.state {
if !v.is_initialized() {
return false;
}
}
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.state = ::std::option::Option::Some(DBState_oneof_state::account(is.read_message()?));
},
2 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.state = ::std::option::Option::Some(DBState_oneof_state::node(is.read_message()?));
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint32()?;
self.refCount = tmp;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if true {
my_size += ::protobuf::rt::value_size(3, self.refCount, ::protobuf::wire_format::WireTypeVarint);
}
if let ::std::option::Option::Some(ref v) = self.state {
match v {
&DBState_oneof_state::account(ref v) => {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
},
&DBState_oneof_state::node(ref v) => {
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());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if true {
os.write_uint32(3, self.refCount)?;
}
if let ::std::option::Option::Some(ref v) = self.state {
match v {
&DBState_oneof_state::account(ref v) => {
os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
},
&DBState_oneof_state::node(ref v) => {
os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
},
};
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> DBState {
DBState::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, Account>(
"account",
DBState::has_account,
DBState::get_account,
));
fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, StateNode>(
"node",
DBState::has_node,
DBState::get_node,
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"refCount",
|m: &DBState| { &m.refCount },
|m: &mut DBState| { &mut m.refCount },
));
::protobuf::reflect::MessageDescriptor::new::<DBState>(
"DBState",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static DBState {
static mut instance: ::protobuf::lazy::Lazy<DBState> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const DBState,
};
unsafe {
instance.get(DBState::new)
}
}
}
impl ::protobuf::Clear for DBState {
fn clear(&mut self) {
self.clear_account();
self.clear_node();
self.clear_refCount();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for DBState {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for DBState {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Account {
pub balance: u64,
pub nonce: u32,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
impl Account {
pub fn new() -> Account {
::std::default::Default::default()
}
pub fn clear_balance(&mut self) {
self.balance = 0;
}
pub fn set_balance(&mut self, v: u64) {
self.balance = v;
}
pub fn get_balance(&self) -> u64 {
self.balance
}
pub fn clear_nonce(&mut self) {
self.nonce = 0;
}
pub fn set_nonce(&mut self, v: u32) {
self.nonce = v;
}
pub fn get_nonce(&self) -> u32 {
self.nonce
}
}
impl ::protobuf::Message for Account {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint64()?;
self.balance = tmp;
},
2 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint32()?;
self.nonce = tmp;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if true {
my_size += ::protobuf::rt::value_size(1, self.balance, ::protobuf::wire_format::WireTypeVarint);
}
if true {
my_size += ::protobuf::rt::value_size(2, self.nonce, ::protobuf::wire_format::WireTypeVarint);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if true {
os.write_uint64(1, self.balance)?;
}
if true {
os.write_uint32(2, self.nonce)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Account {
Account::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"balance",
|m: &Account| { &m.balance },
|m: &mut Account| { &mut m.balance },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"nonce",
|m: &Account| { &m.nonce },
|m: &mut Account| { &mut m.nonce },
));
::protobuf::reflect::MessageDescriptor::new::<Account>(
"Account",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Account {
static mut instance: ::protobuf::lazy::Lazy<Account> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Account,
};
unsafe {
instance.get(Account::new)
}
}
}
impl ::protobuf::Clear for Account {
fn clear(&mut self) {
self.clear_balance();
self.clear_nonce();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Account {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Account {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct StateNode {
pub nodeRefs: ::protobuf::RepeatedField<NodeRef>,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
impl StateNode {
pub fn new() -> StateNode {
::std::default::Default::default()
}
pub fn clear_nodeRefs(&mut self) {
self.nodeRefs.clear();
}
pub fn set_nodeRefs(&mut self, v: ::protobuf::RepeatedField<NodeRef>) {
self.nodeRefs = v;
}
pub fn mut_nodeRefs(&mut self) -> &mut ::protobuf::RepeatedField<NodeRef> {
&mut self.nodeRefs
}
pub fn take_nodeRefs(&mut self) -> ::protobuf::RepeatedField<NodeRef> {
::std::mem::replace(&mut self.nodeRefs, ::protobuf::RepeatedField::new())
}
pub fn get_nodeRefs(&self) -> &[NodeRef] {
&self.nodeRefs
}
}
impl ::protobuf::Message for StateNode {
fn is_initialized(&self) -> bool {
for v in &self.nodeRefs {
if !v.is_initialized() {
return false;
}
};
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.nodeRefs)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
for value in &self.nodeRefs {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
};
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
for v in &self.nodeRefs {
os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
};
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> StateNode {
StateNode::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<NodeRef>>(
"nodeRefs",
|m: &StateNode| { &m.nodeRefs },
|m: &mut StateNode| { &mut m.nodeRefs },
));
::protobuf::reflect::MessageDescriptor::new::<StateNode>(
"StateNode",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static StateNode {
static mut instance: ::protobuf::lazy::Lazy<StateNode> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const StateNode,
};
unsafe {
instance.get(StateNode::new)
}
}
}
impl ::protobuf::Clear for StateNode {
fn clear(&mut self) {
self.clear_nodeRefs();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for StateNode {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for StateNode {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct NodeRef {
pub address: ::std::vec::Vec<u8>,
pub child: ::std::vec::Vec<u8>,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
impl NodeRef {
pub fn new() -> NodeRef {
::std::default::Default::default()
}
pub fn clear_address(&mut self) {
self.address.clear();
}
pub fn set_address(&mut self, v: ::std::vec::Vec<u8>) {
self.address = v;
}
pub fn mut_address(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.address
}
pub fn take_address(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.address, ::std::vec::Vec::new())
}
pub fn get_address(&self) -> &[u8] {
&self.address
}
pub fn clear_child(&mut self) {
self.child.clear();
}
pub fn set_child(&mut self, v: ::std::vec::Vec<u8>) {
self.child = v;
}
pub fn mut_child(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.child
}
pub fn take_child(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.child, ::std::vec::Vec::new())
}
pub fn get_child(&self) -> &[u8] {
&self.child
}
}
impl ::protobuf::Message for NodeRef {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.address)?;
},
2 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.child)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if !self.address.is_empty() {
my_size += ::protobuf::rt::bytes_size(1, &self.address);
}
if !self.child.is_empty() {
my_size += ::protobuf::rt::bytes_size(2, &self.child);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if !self.address.is_empty() {
os.write_bytes(1, &self.address)?;
}
if !self.child.is_empty() {
os.write_bytes(2, &self.child)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> NodeRef {
NodeRef::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"address",
|m: &NodeRef| { &m.address },
|m: &mut NodeRef| { &mut m.address },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"child",
|m: &NodeRef| { &m.child },
|m: &mut NodeRef| { &mut m.child },
));
::protobuf::reflect::MessageDescriptor::new::<NodeRef>(
"NodeRef",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static NodeRef {
static mut instance: ::protobuf::lazy::Lazy<NodeRef> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const NodeRef,
};
unsafe {
instance.get(NodeRef::new)
}
}
}
impl ::protobuf::Clear for NodeRef {
fn clear(&mut self) {
self.clear_address();
self.clear_child();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for NodeRef {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for NodeRef {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct ProtoMerkleNode {
pub references: u32,
pub node: ::std::option::Option<ProtoMerkleNode_oneof_node>,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
#[derive(Clone,PartialEq)]
pub enum ProtoMerkleNode_oneof_node {
branch(Branch),
leaf(Leaf),
data(Data),
}
impl ProtoMerkleNode {
pub fn new() -> ProtoMerkleNode {
::std::default::Default::default()
}
pub fn clear_references(&mut self) {
self.references = 0;
}
pub fn set_references(&mut self, v: u32) {
self.references = v;
}
pub fn get_references(&self) -> u32 {
self.references
}
pub fn clear_branch(&mut self) {
self.node = ::std::option::Option::None;
}
pub fn has_branch(&self) -> bool {
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(..)) => true,
_ => false,
}
}
pub fn set_branch(&mut self, v: Branch) {
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(v))
}
pub fn mut_branch(&mut self) -> &mut Branch {
if let ::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(_)) = self.node {
} else {
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(Branch::new()));
}
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_branch(&mut self) -> Branch {
if self.has_branch() {
match self.node.take() {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(v)) => v,
_ => panic!(),
}
} else {
Branch::new()
}
}
pub fn get_branch(&self) -> &Branch {
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(ref v)) => v,
_ => Branch::default_instance(),
}
}
pub fn clear_leaf(&mut self) {
self.node = ::std::option::Option::None;
}
pub fn has_leaf(&self) -> bool {
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(..)) => true,
_ => false,
}
}
pub fn set_leaf(&mut self, v: Leaf) {
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(v))
}
pub fn mut_leaf(&mut self) -> &mut Leaf {
if let ::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(_)) = self.node {
} else {
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(Leaf::new()));
}
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_leaf(&mut self) -> Leaf {
if self.has_leaf() {
match self.node.take() {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(v)) => v,
_ => panic!(),
}
} else {
Leaf::new()
}
}
pub fn get_leaf(&self) -> &Leaf {
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(ref v)) => v,
_ => Leaf::default_instance(),
}
}
pub fn clear_data(&mut self) {
self.node = ::std::option::Option::None;
}
pub fn has_data(&self) -> bool {
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(..)) => true,
_ => false,
}
}
pub fn set_data(&mut self, v: Data) {
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(v))
}
pub fn mut_data(&mut self) -> &mut Data {
if let ::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(_)) = self.node {
} else {
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(Data::new()));
}
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(ref mut v)) => v,
_ => panic!(),
}
}
pub fn take_data(&mut self) -> Data {
if self.has_data() {
match self.node.take() {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(v)) => v,
_ => panic!(),
}
} else {
Data::new()
}
}
pub fn get_data(&self) -> &Data {
match self.node {
::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(ref v)) => v,
_ => Data::default_instance(),
}
}
}
impl ::protobuf::Message for ProtoMerkleNode {
fn is_initialized(&self) -> bool {
if let Some(ProtoMerkleNode_oneof_node::branch(ref v)) = self.node {
if !v.is_initialized() {
return false;
}
}
if let Some(ProtoMerkleNode_oneof_node::leaf(ref v)) = self.node {
if !v.is_initialized() {
return false;
}
}
if let Some(ProtoMerkleNode_oneof_node::data(ref v)) = self.node {
if !v.is_initialized() {
return false;
}
}
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint32()?;
self.references = tmp;
},
2 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::branch(is.read_message()?));
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::leaf(is.read_message()?));
},
4 => {
if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
self.node = ::std::option::Option::Some(ProtoMerkleNode_oneof_node::data(is.read_message()?));
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if true {
my_size += ::protobuf::rt::value_size(1, self.references, ::protobuf::wire_format::WireTypeVarint);
}
if let ::std::option::Option::Some(ref v) = self.node {
match v {
&ProtoMerkleNode_oneof_node::branch(ref v) => {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
},
&ProtoMerkleNode_oneof_node::leaf(ref v) => {
let len = v.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
},
&ProtoMerkleNode_oneof_node::data(ref v) => {
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());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if true {
os.write_uint32(1, self.references)?;
}
if let ::std::option::Option::Some(ref v) = self.node {
match v {
&ProtoMerkleNode_oneof_node::branch(ref v) => {
os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
},
&ProtoMerkleNode_oneof_node::leaf(ref v) => {
os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
},
&ProtoMerkleNode_oneof_node::data(ref v) => {
os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
},
};
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> ProtoMerkleNode {
ProtoMerkleNode::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"references",
|m: &ProtoMerkleNode| { &m.references },
|m: &mut ProtoMerkleNode| { &mut m.references },
));
fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, Branch>(
"branch",
ProtoMerkleNode::has_branch,
ProtoMerkleNode::get_branch,
));
fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, Leaf>(
"leaf",
ProtoMerkleNode::has_leaf,
ProtoMerkleNode::get_leaf,
));
fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, Data>(
"data",
ProtoMerkleNode::has_data,
ProtoMerkleNode::get_data,
));
::protobuf::reflect::MessageDescriptor::new::<ProtoMerkleNode>(
"ProtoMerkleNode",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static ProtoMerkleNode {
static mut instance: ::protobuf::lazy::Lazy<ProtoMerkleNode> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ProtoMerkleNode,
};
unsafe {
instance.get(ProtoMerkleNode::new)
}
}
}
impl ::protobuf::Clear for ProtoMerkleNode {
fn clear(&mut self) {
self.clear_references();
self.clear_branch();
self.clear_leaf();
self.clear_data();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for ProtoMerkleNode {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for ProtoMerkleNode {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Branch {
pub zero: ::std::vec::Vec<u8>,
pub one: ::std::vec::Vec<u8>,
pub count: u64,
pub split_index: u32,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
impl Branch {
pub fn new() -> Branch {
::std::default::Default::default()
}
pub fn clear_zero(&mut self) {
self.zero.clear();
}
pub fn set_zero(&mut self, v: ::std::vec::Vec<u8>) {
self.zero = v;
}
pub fn mut_zero(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.zero
}
pub fn take_zero(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.zero, ::std::vec::Vec::new())
}
pub fn get_zero(&self) -> &[u8] {
&self.zero
}
pub fn clear_one(&mut self) {
self.one.clear();
}
pub fn set_one(&mut self, v: ::std::vec::Vec<u8>) {
self.one = v;
}
pub fn mut_one(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.one
}
pub fn take_one(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.one, ::std::vec::Vec::new())
}
pub fn get_one(&self) -> &[u8] {
&self.one
}
pub fn clear_count(&mut self) {
self.count = 0;
}
pub fn set_count(&mut self, v: u64) {
self.count = v;
}
pub fn get_count(&self) -> u64 {
self.count
}
pub fn clear_split_index(&mut self) {
self.split_index = 0;
}
pub fn set_split_index(&mut self, v: u32) {
self.split_index = v;
}
pub fn get_split_index(&self) -> u32 {
self.split_index
}
}
impl ::protobuf::Message for Branch {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.zero)?;
},
2 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.one)?;
},
3 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint64()?;
self.count = tmp;
},
4 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_uint32()?;
self.split_index = tmp;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if !self.zero.is_empty() {
my_size += ::protobuf::rt::bytes_size(1, &self.zero);
}
if !self.one.is_empty() {
my_size += ::protobuf::rt::bytes_size(2, &self.one);
}
if true {
my_size += ::protobuf::rt::value_size(3, self.count, ::protobuf::wire_format::WireTypeVarint);
}
if true {
my_size += ::protobuf::rt::value_size(4, self.split_index, ::protobuf::wire_format::WireTypeVarint);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if !self.zero.is_empty() {
os.write_bytes(1, &self.zero)?;
}
if !self.one.is_empty() {
os.write_bytes(2, &self.one)?;
}
if true {
os.write_uint64(3, self.count)?;
}
if true {
os.write_uint32(4, self.split_index)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Branch {
Branch::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"zero",
|m: &Branch| { &m.zero },
|m: &mut Branch| { &mut m.zero },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"one",
|m: &Branch| { &m.one },
|m: &mut Branch| { &mut m.one },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"count",
|m: &Branch| { &m.count },
|m: &mut Branch| { &mut m.count },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"split_index",
|m: &Branch| { &m.split_index },
|m: &mut Branch| { &mut m.split_index },
));
::protobuf::reflect::MessageDescriptor::new::<Branch>(
"Branch",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Branch {
static mut instance: ::protobuf::lazy::Lazy<Branch> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Branch,
};
unsafe {
instance.get(Branch::new)
}
}
}
impl ::protobuf::Clear for Branch {
fn clear(&mut self) {
self.clear_zero();
self.clear_one();
self.clear_count();
self.clear_split_index();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Branch {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Branch {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Leaf {
pub key: ::std::vec::Vec<u8>,
pub data: ::std::vec::Vec<u8>,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
impl Leaf {
pub fn new() -> Leaf {
::std::default::Default::default()
}
pub fn clear_key(&mut self) {
self.key.clear();
}
pub fn set_key(&mut self, v: ::std::vec::Vec<u8>) {
self.key = v;
}
pub fn mut_key(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.key
}
pub fn take_key(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.key, ::std::vec::Vec::new())
}
pub fn get_key(&self) -> &[u8] {
&self.key
}
pub fn clear_data(&mut self) {
self.data.clear();
}
pub fn set_data(&mut self, v: ::std::vec::Vec<u8>) {
self.data = v;
}
pub fn mut_data(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.data
}
pub fn take_data(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.data, ::std::vec::Vec::new())
}
pub fn get_data(&self) -> &[u8] {
&self.data
}
}
impl ::protobuf::Message for Leaf {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.key)?;
},
2 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.data)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if !self.key.is_empty() {
my_size += ::protobuf::rt::bytes_size(1, &self.key);
}
if !self.data.is_empty() {
my_size += ::protobuf::rt::bytes_size(2, &self.data);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if !self.key.is_empty() {
os.write_bytes(1, &self.key)?;
}
if !self.data.is_empty() {
os.write_bytes(2, &self.data)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Leaf {
Leaf::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"key",
|m: &Leaf| { &m.key },
|m: &mut Leaf| { &mut m.key },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"data",
|m: &Leaf| { &m.data },
|m: &mut Leaf| { &mut m.data },
));
::protobuf::reflect::MessageDescriptor::new::<Leaf>(
"Leaf",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Leaf {
static mut instance: ::protobuf::lazy::Lazy<Leaf> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Leaf,
};
unsafe {
instance.get(Leaf::new)
}
}
}
impl ::protobuf::Clear for Leaf {
fn clear(&mut self) {
self.clear_key();
self.clear_data();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Leaf {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Leaf {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Data {
pub value: ::std::vec::Vec<u8>,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
impl Data {
pub fn new() -> Data {
::std::default::Default::default()
}
pub fn clear_value(&mut self) {
self.value.clear();
}
pub fn set_value(&mut self, v: ::std::vec::Vec<u8>) {
self.value = v;
}
pub fn mut_value(&mut self) -> &mut ::std::vec::Vec<u8> {
&mut self.value
}
pub fn take_value(&mut self) -> ::std::vec::Vec<u8> {
::std::mem::replace(&mut self.value, ::std::vec::Vec::new())
}
pub fn get_value(&self) -> &[u8] {
&self.value
}
}
impl ::protobuf::Message for Data {
fn is_initialized(&self) -> bool {
true
}
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.value)?;
},
_ => {
::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
},
};
}
::std::result::Result::Ok(())
}
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if !self.value.is_empty() {
my_size += ::protobuf::rt::bytes_size(1, &self.value);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if !self.value.is_empty() {
os.write_bytes(1, &self.value)?;
}
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &::std::any::Any {
self as &::std::any::Any
}
fn as_any_mut(&mut self) -> &mut ::std::any::Any {
self as &mut ::std::any::Any
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Data {
Data::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::reflect::MessageDescriptor,
};
unsafe {
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"value",
|m: &Data| { &m.value },
|m: &mut Data| { &mut m.value },
));
::protobuf::reflect::MessageDescriptor::new::<Data>(
"Data",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Data {
static mut instance: ::protobuf::lazy::Lazy<Data> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Data,
};
unsafe {
instance.get(Data::new)
}
}
}
impl ::protobuf::Clear for Data {
fn clear(&mut self) {
self.clear_value();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Data {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Data {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x0bstate.proto\"v\n\x07DBState\x12$\n\x07account\x18\x01\x20\x01(\x0b\
2\x08.AccountH\0R\x07account\x12\x20\n\x04node\x18\x02\x20\x01(\x0b2\n.S\
tateNodeH\0R\x04node\x12\x1a\n\x08refCount\x18\x03\x20\x01(\rR\x08refCou\
ntB\x07\n\x05state\"9\n\x07Account\x12\x18\n\x07balance\x18\x01\x20\x01(\
\x04R\x07balance\x12\x14\n\x05nonce\x18\x02\x20\x01(\rR\x05nonce\"1\n\tS\
tateNode\x12$\n\x08nodeRefs\x18\x01\x20\x03(\x0b2\x08.NodeRefR\x08nodeRe\
fs\"9\n\x07NodeRef\x12\x18\n\x07address\x18\x01\x20\x01(\x0cR\x07address\
\x12\x14\n\x05child\x18\x02\x20\x01(\x0cR\x05child\"\x96\x01\n\x0fProtoM\
erkleNode\x12\x1e\n\nreferences\x18\x01\x20\x01(\rR\nreferences\x12!\n\
\x06branch\x18\x02\x20\x01(\x0b2\x07.BranchH\0R\x06branch\x12\x1b\n\x04l\
eaf\x18\x03\x20\x01(\x0b2\x05.LeafH\0R\x04leaf\x12\x1b\n\x04data\x18\x04\
\x20\x01(\x0b2\x05.DataH\0R\x04dataB\x06\n\x04node\"e\n\x06Branch\x12\
\x12\n\x04zero\x18\x01\x20\x01(\x0cR\x04zero\x12\x10\n\x03one\x18\x02\
\x20\x01(\x0cR\x03one\x12\x14\n\x05count\x18\x03\x20\x01(\x04R\x05count\
\x12\x1f\n\x0bsplit_index\x18\x04\x20\x01(\rR\nsplitIndex\",\n\x04Leaf\
\x12\x10\n\x03key\x18\x01\x20\x01(\x0cR\x03key\x12\x12\n\x04data\x18\x02\
\x20\x01(\x0cR\x04data\"\x1c\n\x04Data\x12\x14\n\x05value\x18\x01\x20\
\x01(\x0cR\x05valueb\x06proto3\
";
static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
};
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}
pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
unsafe {
file_descriptor_proto_lazy.get(|| {
parse_descriptor_proto()
})
}
}