#![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 Peer {
pub host: ::std::string::String,
pub port: u32,
pub lastSeen: u64,
pub failCount: u32,
pub lastAttempt: u64,
pub active: bool,
pub currentQueue: i32,
pub successCount: u32,
unknown_fields: ::protobuf::UnknownFields,
cached_size: ::protobuf::CachedSize,
}
impl Peer {
pub fn new() -> Peer {
::std::default::Default::default()
}
pub fn clear_host(&mut self) {
self.host.clear();
}
pub fn set_host(&mut self, v: ::std::string::String) {
self.host = v;
}
pub fn mut_host(&mut self) -> &mut ::std::string::String {
&mut self.host
}
pub fn take_host(&mut self) -> ::std::string::String {
::std::mem::replace(&mut self.host, ::std::string::String::new())
}
pub fn get_host(&self) -> &str {
&self.host
}
pub fn clear_port(&mut self) {
self.port = 0;
}
pub fn set_port(&mut self, v: u32) {
self.port = v;
}
pub fn get_port(&self) -> u32 {
self.port
}
pub fn clear_lastSeen(&mut self) {
self.lastSeen = 0;
}
pub fn set_lastSeen(&mut self, v: u64) {
self.lastSeen = v;
}
pub fn get_lastSeen(&self) -> u64 {
self.lastSeen
}
pub fn clear_failCount(&mut self) {
self.failCount = 0;
}
pub fn set_failCount(&mut self, v: u32) {
self.failCount = v;
}
pub fn get_failCount(&self) -> u32 {
self.failCount
}
pub fn clear_lastAttempt(&mut self) {
self.lastAttempt = 0;
}
pub fn set_lastAttempt(&mut self, v: u64) {
self.lastAttempt = v;
}
pub fn get_lastAttempt(&self) -> u64 {
self.lastAttempt
}
pub fn clear_active(&mut self) {
self.active = false;
}
pub fn set_active(&mut self, v: bool) {
self.active = v;
}
pub fn get_active(&self) -> bool {
self.active
}
pub fn clear_currentQueue(&mut self) {
self.currentQueue = 0;
}
pub fn set_currentQueue(&mut self, v: i32) {
self.currentQueue = v;
}
pub fn get_currentQueue(&self) -> i32 {
self.currentQueue
}
pub fn clear_successCount(&mut self) {
self.successCount = 0;
}
pub fn set_successCount(&mut self, v: u32) {
self.successCount = v;
}
pub fn get_successCount(&self) -> u32 {
self.successCount
}
}
impl ::protobuf::Message for Peer {
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_string_into(wire_type, is, &mut self.host)?;
},
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.port = tmp;
},
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.lastSeen = 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.failCount = tmp;
},
5 => {
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.lastAttempt = tmp;
},
6 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_bool()?;
self.active = tmp;
},
7 => {
if wire_type != ::protobuf::wire_format::WireTypeVarint {
return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
}
let tmp = is.read_int32()?;
self.currentQueue = tmp;
},
8 => {
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.successCount = 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.host.is_empty() {
my_size += ::protobuf::rt::string_size(1, &self.host);
}
if true {
my_size += ::protobuf::rt::value_size(2, self.port, ::protobuf::wire_format::WireTypeVarint);
}
if true {
my_size += ::protobuf::rt::value_size(3, self.lastSeen, ::protobuf::wire_format::WireTypeVarint);
}
if true {
my_size += ::protobuf::rt::value_size(4, self.failCount, ::protobuf::wire_format::WireTypeVarint);
}
if true {
my_size += ::protobuf::rt::value_size(5, self.lastAttempt, ::protobuf::wire_format::WireTypeVarint);
}
if true {
my_size += 2;
}
if true {
my_size += ::protobuf::rt::value_size(7, self.currentQueue, ::protobuf::wire_format::WireTypeVarint);
}
if true {
my_size += ::protobuf::rt::value_size(8, self.successCount, ::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.host.is_empty() {
os.write_string(1, &self.host)?;
}
if true {
os.write_uint32(2, self.port)?;
}
if true {
os.write_uint64(3, self.lastSeen)?;
}
if true {
os.write_uint32(4, self.failCount)?;
}
if true {
os.write_uint64(5, self.lastAttempt)?;
}
if true {
os.write_bool(6, self.active)?;
}
if true {
os.write_int32(7, self.currentQueue)?;
}
if true {
os.write_uint32(8, self.successCount)?;
}
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() -> Peer {
Peer::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::ProtobufTypeString>(
"host",
|m: &Peer| { &m.host },
|m: &mut Peer| { &mut m.host },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"port",
|m: &Peer| { &m.port },
|m: &mut Peer| { &mut m.port },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"lastSeen",
|m: &Peer| { &m.lastSeen },
|m: &mut Peer| { &mut m.lastSeen },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"failCount",
|m: &Peer| { &m.failCount },
|m: &mut Peer| { &mut m.failCount },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"lastAttempt",
|m: &Peer| { &m.lastAttempt },
|m: &mut Peer| { &mut m.lastAttempt },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"active",
|m: &Peer| { &m.active },
|m: &mut Peer| { &mut m.active },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>(
"currentQueue",
|m: &Peer| { &m.currentQueue },
|m: &mut Peer| { &mut m.currentQueue },
));
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint32>(
"successCount",
|m: &Peer| { &m.successCount },
|m: &mut Peer| { &mut m.successCount },
));
::protobuf::reflect::MessageDescriptor::new::<Peer>(
"Peer",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Peer {
static mut instance: ::protobuf::lazy::Lazy<Peer> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Peer,
};
unsafe {
instance.get(Peer::new)
}
}
}
impl ::protobuf::Clear for Peer {
fn clear(&mut self) {
self.clear_host();
self.clear_port();
self.clear_lastSeen();
self.clear_failCount();
self.clear_lastAttempt();
self.clear_active();
self.clear_currentQueue();
self.clear_successCount();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Peer {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Peer {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\npeer.proto\x1a\x0bblock.proto\"\xea\x01\n\x04Peer\x12\x12\n\x04host\
\x18\x01\x20\x01(\tR\x04host\x12\x12\n\x04port\x18\x02\x20\x01(\rR\x04po\
rt\x12\x1a\n\x08lastSeen\x18\x03\x20\x01(\x04R\x08lastSeen\x12\x1c\n\tfa\
ilCount\x18\x04\x20\x01(\rR\tfailCount\x12\x20\n\x0blastAttempt\x18\x05\
\x20\x01(\x04R\x0blastAttempt\x12\x16\n\x06active\x18\x06\x20\x01(\x08R\
\x06active\x12\"\n\x0ccurrentQueue\x18\x07\x20\x01(\x05R\x0ccurrentQueue\
\x12\"\n\x0csuccessCount\x18\x08\x20\x01(\rR\x0csuccessCountb\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()
})
}
}