#![allow(unknown_lints)]
#![allow(clippy::all)]
#![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 NoisePayload {
nonce: ::protobuf::SingularField<::std::vec::Vec<u8>>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a NoisePayload {
fn default() -> &'a NoisePayload {
<NoisePayload as ::protobuf::Message>::default_instance()
}
}
impl NoisePayload {
pub fn new() -> NoisePayload {
::std::default::Default::default()
}
pub fn get_nonce(&self) -> &[u8] {
match self.nonce.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_nonce(&mut self) {
self.nonce.clear();
}
pub fn has_nonce(&self) -> bool {
self.nonce.is_some()
}
pub fn set_nonce(&mut self, v: ::std::vec::Vec<u8>) {
self.nonce = ::protobuf::SingularField::some(v);
}
pub fn mut_nonce(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.nonce.is_none() {
self.nonce.set_default();
}
self.nonce.as_mut().unwrap()
}
pub fn take_nonce(&mut self) -> ::std::vec::Vec<u8> {
self.nonce.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
}
impl ::protobuf::Message for NoisePayload {
fn is_initialized(&self) -> bool {
if self.nonce.is_none() {
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_singular_bytes_into(wire_type, is, &mut self.nonce)?;
},
_ => {
::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 let Some(ref v) = self.nonce.as_ref() {
my_size += ::protobuf::rt::bytes_size(1, &v);
}
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 let Some(ref v) = self.nonce.as_ref() {
os.write_bytes(1, &v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> NoisePayload {
NoisePayload::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_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"nonce",
|m: &NoisePayload| { &m.nonce },
|m: &mut NoisePayload| { &mut m.nonce },
));
::protobuf::reflect::MessageDescriptor::new::<NoisePayload>(
"NoisePayload",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static NoisePayload {
static mut instance: ::protobuf::lazy::Lazy<NoisePayload> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const NoisePayload,
};
unsafe {
instance.get(NoisePayload::new)
}
}
}
impl ::protobuf::Clear for NoisePayload {
fn clear(&mut self) {
self.nonce.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for NoisePayload {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for NoisePayload {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Open {
discoveryKey: ::protobuf::SingularField<::std::vec::Vec<u8>>,
capability: ::protobuf::SingularField<::std::vec::Vec<u8>>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Open {
fn default() -> &'a Open {
<Open as ::protobuf::Message>::default_instance()
}
}
impl Open {
pub fn new() -> Open {
::std::default::Default::default()
}
pub fn get_discoveryKey(&self) -> &[u8] {
match self.discoveryKey.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_discoveryKey(&mut self) {
self.discoveryKey.clear();
}
pub fn has_discoveryKey(&self) -> bool {
self.discoveryKey.is_some()
}
pub fn set_discoveryKey(&mut self, v: ::std::vec::Vec<u8>) {
self.discoveryKey = ::protobuf::SingularField::some(v);
}
pub fn mut_discoveryKey(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.discoveryKey.is_none() {
self.discoveryKey.set_default();
}
self.discoveryKey.as_mut().unwrap()
}
pub fn take_discoveryKey(&mut self) -> ::std::vec::Vec<u8> {
self.discoveryKey.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
pub fn get_capability(&self) -> &[u8] {
match self.capability.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_capability(&mut self) {
self.capability.clear();
}
pub fn has_capability(&self) -> bool {
self.capability.is_some()
}
pub fn set_capability(&mut self, v: ::std::vec::Vec<u8>) {
self.capability = ::protobuf::SingularField::some(v);
}
pub fn mut_capability(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.capability.is_none() {
self.capability.set_default();
}
self.capability.as_mut().unwrap()
}
pub fn take_capability(&mut self) -> ::std::vec::Vec<u8> {
self.capability.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
}
impl ::protobuf::Message for Open {
fn is_initialized(&self) -> bool {
if self.discoveryKey.is_none() {
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_singular_bytes_into(wire_type, is, &mut self.discoveryKey)?;
},
2 => {
::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.capability)?;
},
_ => {
::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 let Some(ref v) = self.discoveryKey.as_ref() {
my_size += ::protobuf::rt::bytes_size(1, &v);
}
if let Some(ref v) = self.capability.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);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if let Some(ref v) = self.discoveryKey.as_ref() {
os.write_bytes(1, &v)?;
}
if let Some(ref v) = self.capability.as_ref() {
os.write_bytes(2, &v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Open {
Open::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_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"discoveryKey",
|m: &Open| { &m.discoveryKey },
|m: &mut Open| { &mut m.discoveryKey },
));
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"capability",
|m: &Open| { &m.capability },
|m: &mut Open| { &mut m.capability },
));
::protobuf::reflect::MessageDescriptor::new::<Open>(
"Open",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Open {
static mut instance: ::protobuf::lazy::Lazy<Open> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Open,
};
unsafe {
instance.get(Open::new)
}
}
}
impl ::protobuf::Clear for Open {
fn clear(&mut self) {
self.discoveryKey.clear();
self.capability.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Open {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Open {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Options {
extensions: ::protobuf::RepeatedField<::std::string::String>,
ack: ::std::option::Option<bool>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Options {
fn default() -> &'a Options {
<Options as ::protobuf::Message>::default_instance()
}
}
impl Options {
pub fn new() -> Options {
::std::default::Default::default()
}
pub fn get_extensions(&self) -> &[::std::string::String] {
&self.extensions
}
pub fn clear_extensions(&mut self) {
self.extensions.clear();
}
pub fn set_extensions(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
self.extensions = v;
}
pub fn mut_extensions(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
&mut self.extensions
}
pub fn take_extensions(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
::std::mem::replace(&mut self.extensions, ::protobuf::RepeatedField::new())
}
pub fn get_ack(&self) -> bool {
self.ack.unwrap_or(false)
}
pub fn clear_ack(&mut self) {
self.ack = ::std::option::Option::None;
}
pub fn has_ack(&self) -> bool {
self.ack.is_some()
}
pub fn set_ack(&mut self, v: bool) {
self.ack = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Options {
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_repeated_string_into(wire_type, is, &mut self.extensions)?;
},
2 => {
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.ack = ::std::option::Option::Some(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;
for value in &self.extensions {
my_size += ::protobuf::rt::string_size(1, &value);
};
if let Some(v) = self.ack {
my_size += 2;
}
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.extensions {
os.write_string(1, &v)?;
};
if let Some(v) = self.ack {
os.write_bool(2, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Options {
Options::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::ProtobufTypeString>(
"extensions",
|m: &Options| { &m.extensions },
|m: &mut Options| { &mut m.extensions },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"ack",
|m: &Options| { &m.ack },
|m: &mut Options| { &mut m.ack },
));
::protobuf::reflect::MessageDescriptor::new::<Options>(
"Options",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Options {
static mut instance: ::protobuf::lazy::Lazy<Options> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Options,
};
unsafe {
instance.get(Options::new)
}
}
}
impl ::protobuf::Clear for Options {
fn clear(&mut self) {
self.extensions.clear();
self.ack = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Options {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Options {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Status {
uploading: ::std::option::Option<bool>,
downloading: ::std::option::Option<bool>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Status {
fn default() -> &'a Status {
<Status as ::protobuf::Message>::default_instance()
}
}
impl Status {
pub fn new() -> Status {
::std::default::Default::default()
}
pub fn get_uploading(&self) -> bool {
self.uploading.unwrap_or(false)
}
pub fn clear_uploading(&mut self) {
self.uploading = ::std::option::Option::None;
}
pub fn has_uploading(&self) -> bool {
self.uploading.is_some()
}
pub fn set_uploading(&mut self, v: bool) {
self.uploading = ::std::option::Option::Some(v);
}
pub fn get_downloading(&self) -> bool {
self.downloading.unwrap_or(false)
}
pub fn clear_downloading(&mut self) {
self.downloading = ::std::option::Option::None;
}
pub fn has_downloading(&self) -> bool {
self.downloading.is_some()
}
pub fn set_downloading(&mut self, v: bool) {
self.downloading = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Status {
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_bool()?;
self.uploading = ::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 = is.read_bool()?;
self.downloading = ::std::option::Option::Some(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 let Some(v) = self.uploading {
my_size += 2;
}
if let Some(v) = self.downloading {
my_size += 2;
}
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 let Some(v) = self.uploading {
os.write_bool(1, v)?;
}
if let Some(v) = self.downloading {
os.write_bool(2, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Status {
Status::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_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"uploading",
|m: &Status| { &m.uploading },
|m: &mut Status| { &mut m.uploading },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"downloading",
|m: &Status| { &m.downloading },
|m: &mut Status| { &mut m.downloading },
));
::protobuf::reflect::MessageDescriptor::new::<Status>(
"Status",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Status {
static mut instance: ::protobuf::lazy::Lazy<Status> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Status,
};
unsafe {
instance.get(Status::new)
}
}
}
impl ::protobuf::Clear for Status {
fn clear(&mut self) {
self.uploading = ::std::option::Option::None;
self.downloading = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Status {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Status {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Have {
start: ::std::option::Option<u64>,
length: ::std::option::Option<u64>,
bitfield: ::protobuf::SingularField<::std::vec::Vec<u8>>,
ack: ::std::option::Option<bool>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Have {
fn default() -> &'a Have {
<Have as ::protobuf::Message>::default_instance()
}
}
impl Have {
pub fn new() -> Have {
::std::default::Default::default()
}
pub fn get_start(&self) -> u64 {
self.start.unwrap_or(0)
}
pub fn clear_start(&mut self) {
self.start = ::std::option::Option::None;
}
pub fn has_start(&self) -> bool {
self.start.is_some()
}
pub fn set_start(&mut self, v: u64) {
self.start = ::std::option::Option::Some(v);
}
pub fn get_length(&self) -> u64 {
self.length.unwrap_or(1u64)
}
pub fn clear_length(&mut self) {
self.length = ::std::option::Option::None;
}
pub fn has_length(&self) -> bool {
self.length.is_some()
}
pub fn set_length(&mut self, v: u64) {
self.length = ::std::option::Option::Some(v);
}
pub fn get_bitfield(&self) -> &[u8] {
match self.bitfield.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_bitfield(&mut self) {
self.bitfield.clear();
}
pub fn has_bitfield(&self) -> bool {
self.bitfield.is_some()
}
pub fn set_bitfield(&mut self, v: ::std::vec::Vec<u8>) {
self.bitfield = ::protobuf::SingularField::some(v);
}
pub fn mut_bitfield(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.bitfield.is_none() {
self.bitfield.set_default();
}
self.bitfield.as_mut().unwrap()
}
pub fn take_bitfield(&mut self) -> ::std::vec::Vec<u8> {
self.bitfield.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
pub fn get_ack(&self) -> bool {
self.ack.unwrap_or(false)
}
pub fn clear_ack(&mut self) {
self.ack = ::std::option::Option::None;
}
pub fn has_ack(&self) -> bool {
self.ack.is_some()
}
pub fn set_ack(&mut self, v: bool) {
self.ack = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Have {
fn is_initialized(&self) -> bool {
if self.start.is_none() {
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_uint64()?;
self.start = ::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 = is.read_uint64()?;
self.length = ::std::option::Option::Some(tmp);
},
3 => {
::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.bitfield)?;
},
4 => {
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.ack = ::std::option::Option::Some(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 let Some(v) = self.start {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.length {
my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(ref v) = self.bitfield.as_ref() {
my_size += ::protobuf::rt::bytes_size(3, &v);
}
if let Some(v) = self.ack {
my_size += 2;
}
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 let Some(v) = self.start {
os.write_uint64(1, v)?;
}
if let Some(v) = self.length {
os.write_uint64(2, v)?;
}
if let Some(ref v) = self.bitfield.as_ref() {
os.write_bytes(3, &v)?;
}
if let Some(v) = self.ack {
os.write_bool(4, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Have {
Have::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"start",
|m: &Have| { &m.start },
|m: &mut Have| { &mut m.start },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"length",
|m: &Have| { &m.length },
|m: &mut Have| { &mut m.length },
));
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"bitfield",
|m: &Have| { &m.bitfield },
|m: &mut Have| { &mut m.bitfield },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"ack",
|m: &Have| { &m.ack },
|m: &mut Have| { &mut m.ack },
));
::protobuf::reflect::MessageDescriptor::new::<Have>(
"Have",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Have {
static mut instance: ::protobuf::lazy::Lazy<Have> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Have,
};
unsafe {
instance.get(Have::new)
}
}
}
impl ::protobuf::Clear for Have {
fn clear(&mut self) {
self.start = ::std::option::Option::None;
self.length = ::std::option::Option::None;
self.bitfield.clear();
self.ack = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Have {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Have {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Unhave {
start: ::std::option::Option<u64>,
length: ::std::option::Option<u64>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Unhave {
fn default() -> &'a Unhave {
<Unhave as ::protobuf::Message>::default_instance()
}
}
impl Unhave {
pub fn new() -> Unhave {
::std::default::Default::default()
}
pub fn get_start(&self) -> u64 {
self.start.unwrap_or(0)
}
pub fn clear_start(&mut self) {
self.start = ::std::option::Option::None;
}
pub fn has_start(&self) -> bool {
self.start.is_some()
}
pub fn set_start(&mut self, v: u64) {
self.start = ::std::option::Option::Some(v);
}
pub fn get_length(&self) -> u64 {
self.length.unwrap_or(1u64)
}
pub fn clear_length(&mut self) {
self.length = ::std::option::Option::None;
}
pub fn has_length(&self) -> bool {
self.length.is_some()
}
pub fn set_length(&mut self, v: u64) {
self.length = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Unhave {
fn is_initialized(&self) -> bool {
if self.start.is_none() {
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_uint64()?;
self.start = ::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 = is.read_uint64()?;
self.length = ::std::option::Option::Some(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 let Some(v) = self.start {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.length {
my_size += ::protobuf::rt::value_size(2, v, ::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 let Some(v) = self.start {
os.write_uint64(1, v)?;
}
if let Some(v) = self.length {
os.write_uint64(2, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Unhave {
Unhave::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"start",
|m: &Unhave| { &m.start },
|m: &mut Unhave| { &mut m.start },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"length",
|m: &Unhave| { &m.length },
|m: &mut Unhave| { &mut m.length },
));
::protobuf::reflect::MessageDescriptor::new::<Unhave>(
"Unhave",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Unhave {
static mut instance: ::protobuf::lazy::Lazy<Unhave> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Unhave,
};
unsafe {
instance.get(Unhave::new)
}
}
}
impl ::protobuf::Clear for Unhave {
fn clear(&mut self) {
self.start = ::std::option::Option::None;
self.length = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Unhave {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Unhave {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Want {
start: ::std::option::Option<u64>,
length: ::std::option::Option<u64>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Want {
fn default() -> &'a Want {
<Want as ::protobuf::Message>::default_instance()
}
}
impl Want {
pub fn new() -> Want {
::std::default::Default::default()
}
pub fn get_start(&self) -> u64 {
self.start.unwrap_or(0)
}
pub fn clear_start(&mut self) {
self.start = ::std::option::Option::None;
}
pub fn has_start(&self) -> bool {
self.start.is_some()
}
pub fn set_start(&mut self, v: u64) {
self.start = ::std::option::Option::Some(v);
}
pub fn get_length(&self) -> u64 {
self.length.unwrap_or(0)
}
pub fn clear_length(&mut self) {
self.length = ::std::option::Option::None;
}
pub fn has_length(&self) -> bool {
self.length.is_some()
}
pub fn set_length(&mut self, v: u64) {
self.length = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Want {
fn is_initialized(&self) -> bool {
if self.start.is_none() {
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_uint64()?;
self.start = ::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 = is.read_uint64()?;
self.length = ::std::option::Option::Some(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 let Some(v) = self.start {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.length {
my_size += ::protobuf::rt::value_size(2, v, ::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 let Some(v) = self.start {
os.write_uint64(1, v)?;
}
if let Some(v) = self.length {
os.write_uint64(2, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Want {
Want::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"start",
|m: &Want| { &m.start },
|m: &mut Want| { &mut m.start },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"length",
|m: &Want| { &m.length },
|m: &mut Want| { &mut m.length },
));
::protobuf::reflect::MessageDescriptor::new::<Want>(
"Want",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Want {
static mut instance: ::protobuf::lazy::Lazy<Want> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Want,
};
unsafe {
instance.get(Want::new)
}
}
}
impl ::protobuf::Clear for Want {
fn clear(&mut self) {
self.start = ::std::option::Option::None;
self.length = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Want {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Want {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Unwant {
start: ::std::option::Option<u64>,
length: ::std::option::Option<u64>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Unwant {
fn default() -> &'a Unwant {
<Unwant as ::protobuf::Message>::default_instance()
}
}
impl Unwant {
pub fn new() -> Unwant {
::std::default::Default::default()
}
pub fn get_start(&self) -> u64 {
self.start.unwrap_or(0)
}
pub fn clear_start(&mut self) {
self.start = ::std::option::Option::None;
}
pub fn has_start(&self) -> bool {
self.start.is_some()
}
pub fn set_start(&mut self, v: u64) {
self.start = ::std::option::Option::Some(v);
}
pub fn get_length(&self) -> u64 {
self.length.unwrap_or(0)
}
pub fn clear_length(&mut self) {
self.length = ::std::option::Option::None;
}
pub fn has_length(&self) -> bool {
self.length.is_some()
}
pub fn set_length(&mut self, v: u64) {
self.length = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Unwant {
fn is_initialized(&self) -> bool {
if self.start.is_none() {
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_uint64()?;
self.start = ::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 = is.read_uint64()?;
self.length = ::std::option::Option::Some(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 let Some(v) = self.start {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.length {
my_size += ::protobuf::rt::value_size(2, v, ::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 let Some(v) = self.start {
os.write_uint64(1, v)?;
}
if let Some(v) = self.length {
os.write_uint64(2, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Unwant {
Unwant::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"start",
|m: &Unwant| { &m.start },
|m: &mut Unwant| { &mut m.start },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"length",
|m: &Unwant| { &m.length },
|m: &mut Unwant| { &mut m.length },
));
::protobuf::reflect::MessageDescriptor::new::<Unwant>(
"Unwant",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Unwant {
static mut instance: ::protobuf::lazy::Lazy<Unwant> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Unwant,
};
unsafe {
instance.get(Unwant::new)
}
}
}
impl ::protobuf::Clear for Unwant {
fn clear(&mut self) {
self.start = ::std::option::Option::None;
self.length = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Unwant {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Unwant {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Request {
index: ::std::option::Option<u64>,
bytes: ::std::option::Option<u64>,
hash: ::std::option::Option<bool>,
nodes: ::std::option::Option<u64>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Request {
fn default() -> &'a Request {
<Request as ::protobuf::Message>::default_instance()
}
}
impl Request {
pub fn new() -> Request {
::std::default::Default::default()
}
pub fn get_index(&self) -> u64 {
self.index.unwrap_or(0)
}
pub fn clear_index(&mut self) {
self.index = ::std::option::Option::None;
}
pub fn has_index(&self) -> bool {
self.index.is_some()
}
pub fn set_index(&mut self, v: u64) {
self.index = ::std::option::Option::Some(v);
}
pub fn get_bytes(&self) -> u64 {
self.bytes.unwrap_or(0)
}
pub fn clear_bytes(&mut self) {
self.bytes = ::std::option::Option::None;
}
pub fn has_bytes(&self) -> bool {
self.bytes.is_some()
}
pub fn set_bytes(&mut self, v: u64) {
self.bytes = ::std::option::Option::Some(v);
}
pub fn get_hash(&self) -> bool {
self.hash.unwrap_or(false)
}
pub fn clear_hash(&mut self) {
self.hash = ::std::option::Option::None;
}
pub fn has_hash(&self) -> bool {
self.hash.is_some()
}
pub fn set_hash(&mut self, v: bool) {
self.hash = ::std::option::Option::Some(v);
}
pub fn get_nodes(&self) -> u64 {
self.nodes.unwrap_or(0)
}
pub fn clear_nodes(&mut self) {
self.nodes = ::std::option::Option::None;
}
pub fn has_nodes(&self) -> bool {
self.nodes.is_some()
}
pub fn set_nodes(&mut self, v: u64) {
self.nodes = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Request {
fn is_initialized(&self) -> bool {
if self.index.is_none() {
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_uint64()?;
self.index = ::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 = is.read_uint64()?;
self.bytes = ::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 = is.read_bool()?;
self.hash = ::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 = is.read_uint64()?;
self.nodes = ::std::option::Option::Some(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 let Some(v) = self.index {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.bytes {
my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.hash {
my_size += 2;
}
if let Some(v) = self.nodes {
my_size += ::protobuf::rt::value_size(4, v, ::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 let Some(v) = self.index {
os.write_uint64(1, v)?;
}
if let Some(v) = self.bytes {
os.write_uint64(2, v)?;
}
if let Some(v) = self.hash {
os.write_bool(3, v)?;
}
if let Some(v) = self.nodes {
os.write_uint64(4, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Request {
Request::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"index",
|m: &Request| { &m.index },
|m: &mut Request| { &mut m.index },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"bytes",
|m: &Request| { &m.bytes },
|m: &mut Request| { &mut m.bytes },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hash",
|m: &Request| { &m.hash },
|m: &mut Request| { &mut m.hash },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"nodes",
|m: &Request| { &m.nodes },
|m: &mut Request| { &mut m.nodes },
));
::protobuf::reflect::MessageDescriptor::new::<Request>(
"Request",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Request {
static mut instance: ::protobuf::lazy::Lazy<Request> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Request,
};
unsafe {
instance.get(Request::new)
}
}
}
impl ::protobuf::Clear for Request {
fn clear(&mut self) {
self.index = ::std::option::Option::None;
self.bytes = ::std::option::Option::None;
self.hash = ::std::option::Option::None;
self.nodes = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Request {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Request {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Cancel {
index: ::std::option::Option<u64>,
bytes: ::std::option::Option<u64>,
hash: ::std::option::Option<bool>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Cancel {
fn default() -> &'a Cancel {
<Cancel as ::protobuf::Message>::default_instance()
}
}
impl Cancel {
pub fn new() -> Cancel {
::std::default::Default::default()
}
pub fn get_index(&self) -> u64 {
self.index.unwrap_or(0)
}
pub fn clear_index(&mut self) {
self.index = ::std::option::Option::None;
}
pub fn has_index(&self) -> bool {
self.index.is_some()
}
pub fn set_index(&mut self, v: u64) {
self.index = ::std::option::Option::Some(v);
}
pub fn get_bytes(&self) -> u64 {
self.bytes.unwrap_or(0)
}
pub fn clear_bytes(&mut self) {
self.bytes = ::std::option::Option::None;
}
pub fn has_bytes(&self) -> bool {
self.bytes.is_some()
}
pub fn set_bytes(&mut self, v: u64) {
self.bytes = ::std::option::Option::Some(v);
}
pub fn get_hash(&self) -> bool {
self.hash.unwrap_or(false)
}
pub fn clear_hash(&mut self) {
self.hash = ::std::option::Option::None;
}
pub fn has_hash(&self) -> bool {
self.hash.is_some()
}
pub fn set_hash(&mut self, v: bool) {
self.hash = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Cancel {
fn is_initialized(&self) -> bool {
if self.index.is_none() {
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_uint64()?;
self.index = ::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 = is.read_uint64()?;
self.bytes = ::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 = is.read_bool()?;
self.hash = ::std::option::Option::Some(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 let Some(v) = self.index {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.bytes {
my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(v) = self.hash {
my_size += 2;
}
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 let Some(v) = self.index {
os.write_uint64(1, v)?;
}
if let Some(v) = self.bytes {
os.write_uint64(2, v)?;
}
if let Some(v) = self.hash {
os.write_bool(3, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Cancel {
Cancel::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"index",
|m: &Cancel| { &m.index },
|m: &mut Cancel| { &mut m.index },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"bytes",
|m: &Cancel| { &m.bytes },
|m: &mut Cancel| { &mut m.bytes },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>(
"hash",
|m: &Cancel| { &m.hash },
|m: &mut Cancel| { &mut m.hash },
));
::protobuf::reflect::MessageDescriptor::new::<Cancel>(
"Cancel",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Cancel {
static mut instance: ::protobuf::lazy::Lazy<Cancel> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Cancel,
};
unsafe {
instance.get(Cancel::new)
}
}
}
impl ::protobuf::Clear for Cancel {
fn clear(&mut self) {
self.index = ::std::option::Option::None;
self.bytes = ::std::option::Option::None;
self.hash = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Cancel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Cancel {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Data {
index: ::std::option::Option<u64>,
value: ::protobuf::SingularField<::std::vec::Vec<u8>>,
nodes: ::protobuf::RepeatedField<Data_Node>,
signature: ::protobuf::SingularField<::std::vec::Vec<u8>>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Data {
fn default() -> &'a Data {
<Data as ::protobuf::Message>::default_instance()
}
}
impl Data {
pub fn new() -> Data {
::std::default::Default::default()
}
pub fn get_index(&self) -> u64 {
self.index.unwrap_or(0)
}
pub fn clear_index(&mut self) {
self.index = ::std::option::Option::None;
}
pub fn has_index(&self) -> bool {
self.index.is_some()
}
pub fn set_index(&mut self, v: u64) {
self.index = ::std::option::Option::Some(v);
}
pub fn get_value(&self) -> &[u8] {
match self.value.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_value(&mut self) {
self.value.clear();
}
pub fn has_value(&self) -> bool {
self.value.is_some()
}
pub fn set_value(&mut self, v: ::std::vec::Vec<u8>) {
self.value = ::protobuf::SingularField::some(v);
}
pub fn mut_value(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.value.is_none() {
self.value.set_default();
}
self.value.as_mut().unwrap()
}
pub fn take_value(&mut self) -> ::std::vec::Vec<u8> {
self.value.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
pub fn get_nodes(&self) -> &[Data_Node] {
&self.nodes
}
pub fn clear_nodes(&mut self) {
self.nodes.clear();
}
pub fn set_nodes(&mut self, v: ::protobuf::RepeatedField<Data_Node>) {
self.nodes = v;
}
pub fn mut_nodes(&mut self) -> &mut ::protobuf::RepeatedField<Data_Node> {
&mut self.nodes
}
pub fn take_nodes(&mut self) -> ::protobuf::RepeatedField<Data_Node> {
::std::mem::replace(&mut self.nodes, ::protobuf::RepeatedField::new())
}
pub fn get_signature(&self) -> &[u8] {
match self.signature.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_signature(&mut self) {
self.signature.clear();
}
pub fn has_signature(&self) -> bool {
self.signature.is_some()
}
pub fn set_signature(&mut self, v: ::std::vec::Vec<u8>) {
self.signature = ::protobuf::SingularField::some(v);
}
pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.signature.is_none() {
self.signature.set_default();
}
self.signature.as_mut().unwrap()
}
pub fn take_signature(&mut self) -> ::std::vec::Vec<u8> {
self.signature.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
}
impl ::protobuf::Message for Data {
fn is_initialized(&self) -> bool {
if self.index.is_none() {
return false;
}
for v in &self.nodes {
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_uint64()?;
self.index = ::std::option::Option::Some(tmp);
},
2 => {
::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.value)?;
},
3 => {
::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.nodes)?;
},
4 => {
::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.signature)?;
},
_ => {
::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 let Some(v) = self.index {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(ref v) = self.value.as_ref() {
my_size += ::protobuf::rt::bytes_size(2, &v);
}
for value in &self.nodes {
let len = value.compute_size();
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
};
if let Some(ref v) = self.signature.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);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if let Some(v) = self.index {
os.write_uint64(1, v)?;
}
if let Some(ref v) = self.value.as_ref() {
os.write_bytes(2, &v)?;
}
for v in &self.nodes {
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(ref v) = self.signature.as_ref() {
os.write_bytes(4, &v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"index",
|m: &Data| { &m.index },
|m: &mut Data| { &mut m.index },
));
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"value",
|m: &Data| { &m.value },
|m: &mut Data| { &mut m.value },
));
fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<Data_Node>>(
"nodes",
|m: &Data| { &m.nodes },
|m: &mut Data| { &mut m.nodes },
));
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"signature",
|m: &Data| { &m.signature },
|m: &mut Data| { &mut m.signature },
));
::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.index = ::std::option::Option::None;
self.value.clear();
self.nodes.clear();
self.signature.clear();
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)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Data_Node {
index: ::std::option::Option<u64>,
hash: ::protobuf::SingularField<::std::vec::Vec<u8>>,
size: ::std::option::Option<u64>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Data_Node {
fn default() -> &'a Data_Node {
<Data_Node as ::protobuf::Message>::default_instance()
}
}
impl Data_Node {
pub fn new() -> Data_Node {
::std::default::Default::default()
}
pub fn get_index(&self) -> u64 {
self.index.unwrap_or(0)
}
pub fn clear_index(&mut self) {
self.index = ::std::option::Option::None;
}
pub fn has_index(&self) -> bool {
self.index.is_some()
}
pub fn set_index(&mut self, v: u64) {
self.index = ::std::option::Option::Some(v);
}
pub fn get_hash(&self) -> &[u8] {
match self.hash.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_hash(&mut self) {
self.hash.clear();
}
pub fn has_hash(&self) -> bool {
self.hash.is_some()
}
pub fn set_hash(&mut self, v: ::std::vec::Vec<u8>) {
self.hash = ::protobuf::SingularField::some(v);
}
pub fn mut_hash(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.hash.is_none() {
self.hash.set_default();
}
self.hash.as_mut().unwrap()
}
pub fn take_hash(&mut self) -> ::std::vec::Vec<u8> {
self.hash.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
pub fn get_size(&self) -> u64 {
self.size.unwrap_or(0)
}
pub fn clear_size(&mut self) {
self.size = ::std::option::Option::None;
}
pub fn has_size(&self) -> bool {
self.size.is_some()
}
pub fn set_size(&mut self, v: u64) {
self.size = ::std::option::Option::Some(v);
}
}
impl ::protobuf::Message for Data_Node {
fn is_initialized(&self) -> bool {
if self.index.is_none() {
return false;
}
if self.hash.is_none() {
return false;
}
if self.size.is_none() {
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_uint64()?;
self.index = ::std::option::Option::Some(tmp);
},
2 => {
::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hash)?;
},
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.size = ::std::option::Option::Some(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 let Some(v) = self.index {
my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
}
if let Some(ref v) = self.hash.as_ref() {
my_size += ::protobuf::rt::bytes_size(2, &v);
}
if let Some(v) = self.size {
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);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
if let Some(v) = self.index {
os.write_uint64(1, v)?;
}
if let Some(ref v) = self.hash.as_ref() {
os.write_bytes(2, &v)?;
}
if let Some(v) = self.size {
os.write_uint64(3, v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Data_Node {
Data_Node::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_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"index",
|m: &Data_Node| { &m.index },
|m: &mut Data_Node| { &mut m.index },
));
fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"hash",
|m: &Data_Node| { &m.hash },
|m: &mut Data_Node| { &mut m.hash },
));
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
"size",
|m: &Data_Node| { &m.size },
|m: &mut Data_Node| { &mut m.size },
));
::protobuf::reflect::MessageDescriptor::new::<Data_Node>(
"Data_Node",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Data_Node {
static mut instance: ::protobuf::lazy::Lazy<Data_Node> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Data_Node,
};
unsafe {
instance.get(Data_Node::new)
}
}
}
impl ::protobuf::Clear for Data_Node {
fn clear(&mut self) {
self.index = ::std::option::Option::None;
self.hash.clear();
self.size = ::std::option::Option::None;
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Data_Node {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Data_Node {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
#[derive(PartialEq,Clone,Default)]
pub struct Close {
discoveryKey: ::protobuf::SingularField<::std::vec::Vec<u8>>,
pub unknown_fields: ::protobuf::UnknownFields,
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::default::Default for &'a Close {
fn default() -> &'a Close {
<Close as ::protobuf::Message>::default_instance()
}
}
impl Close {
pub fn new() -> Close {
::std::default::Default::default()
}
pub fn get_discoveryKey(&self) -> &[u8] {
match self.discoveryKey.as_ref() {
Some(v) => &v,
None => &[],
}
}
pub fn clear_discoveryKey(&mut self) {
self.discoveryKey.clear();
}
pub fn has_discoveryKey(&self) -> bool {
self.discoveryKey.is_some()
}
pub fn set_discoveryKey(&mut self, v: ::std::vec::Vec<u8>) {
self.discoveryKey = ::protobuf::SingularField::some(v);
}
pub fn mut_discoveryKey(&mut self) -> &mut ::std::vec::Vec<u8> {
if self.discoveryKey.is_none() {
self.discoveryKey.set_default();
}
self.discoveryKey.as_mut().unwrap()
}
pub fn take_discoveryKey(&mut self) -> ::std::vec::Vec<u8> {
self.discoveryKey.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
}
impl ::protobuf::Message for Close {
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_bytes_into(wire_type, is, &mut self.discoveryKey)?;
},
_ => {
::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 let Some(ref v) = self.discoveryKey.as_ref() {
my_size += ::protobuf::rt::bytes_size(1, &v);
}
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 let Some(ref v) = self.discoveryKey.as_ref() {
os.write_bytes(1, &v)?;
}
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) -> &dyn (::std::any::Any) {
self as &dyn (::std::any::Any)
}
fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> Close {
Close::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_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
"discoveryKey",
|m: &Close| { &m.discoveryKey },
|m: &mut Close| { &mut m.discoveryKey },
));
::protobuf::reflect::MessageDescriptor::new::<Close>(
"Close",
fields,
file_descriptor_proto()
)
})
}
}
fn default_instance() -> &'static Close {
static mut instance: ::protobuf::lazy::Lazy<Close> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const Close,
};
unsafe {
instance.get(Close::new)
}
}
}
impl ::protobuf::Clear for Close {
fn clear(&mut self) {
self.discoveryKey.clear();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for Close {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for Close {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\tlib.proto\x12\0\"!\n\x0cNoisePayload\x12\x0f\n\x05nonce\x18\x01\x20\
\x02(\x0cB\0:\0\"6\n\x04Open\x12\x16\n\x0cdiscoveryKey\x18\x01\x20\x02(\
\x0cB\0\x12\x14\n\ncapability\x18\x02\x20\x01(\x0cB\0:\0\"0\n\x07Options\
\x12\x14\n\nextensions\x18\x01\x20\x03(\tB\0\x12\r\n\x03ack\x18\x02\x20\
\x01(\x08B\0:\0\"6\n\x06Status\x12\x13\n\tuploading\x18\x01\x20\x01(\x08\
B\0\x12\x15\n\x0bdownloading\x18\x02\x20\x01(\x08B\0:\0\"Q\n\x04Have\x12\
\x0f\n\x05start\x18\x01\x20\x02(\x04B\0\x12\x13\n\x06length\x18\x02\x20\
\x01(\x04:\x011B\0\x12\x12\n\x08bitfield\x18\x03\x20\x01(\x0cB\0\x12\r\n\
\x03ack\x18\x04\x20\x01(\x08B\0:\0\"0\n\x06Unhave\x12\x0f\n\x05start\x18\
\x01\x20\x02(\x04B\0\x12\x13\n\x06length\x18\x02\x20\x01(\x04:\x011B\0:\
\0\"+\n\x04Want\x12\x0f\n\x05start\x18\x01\x20\x02(\x04B\0\x12\x10\n\x06\
length\x18\x02\x20\x01(\x04B\0:\0\"-\n\x06Unwant\x12\x0f\n\x05start\x18\
\x01\x20\x02(\x04B\0\x12\x10\n\x06length\x18\x02\x20\x01(\x04B\0:\0\"N\n\
\x07Request\x12\x0f\n\x05index\x18\x01\x20\x02(\x04B\0\x12\x0f\n\x05byte\
s\x18\x02\x20\x01(\x04B\0\x12\x0e\n\x04hash\x18\x03\x20\x01(\x08B\0\x12\
\x0f\n\x05nodes\x18\x04\x20\x01(\x04B\0:\0\"<\n\x06Cancel\x12\x0f\n\x05i\
ndex\x18\x01\x20\x02(\x04B\0\x12\x0f\n\x05bytes\x18\x02\x20\x01(\x04B\0\
\x12\x0e\n\x04hash\x18\x03\x20\x01(\x08B\0:\0\"\x97\x01\n\x04Data\x12\
\x0f\n\x05index\x18\x01\x20\x02(\x04B\0\x12\x0f\n\x05value\x18\x02\x20\
\x01(\x0cB\0\x12\x1b\n\x05nodes\x18\x03\x20\x03(\x0b2\n.Data.NodeB\0\x12\
\x13\n\tsignature\x18\x04\x20\x01(\x0cB\0\x1a9\n\x04Node\x12\x0f\n\x05in\
dex\x18\x01\x20\x02(\x04B\0\x12\x0e\n\x04hash\x18\x02\x20\x02(\x0cB\0\
\x12\x0e\n\x04size\x18\x03\x20\x02(\x04B\0:\0:\0\"!\n\x05Close\x12\x16\n\
\x0cdiscoveryKey\x18\x01\x20\x01(\x0cB\0:\0B\0b\x06proto2\
";
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()
})
}
}