bayard-proto 0.8.2

Protocol Buffers for Bayard
// This file is generated by rust-protobuf 2.17.0. Do not edit
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]

#![allow(unused_attributes)]
#![rustfmt::skip]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_imports)]
#![allow(unused_results)]
//! Generated file from `raftpb.proto`

/// Generated files are compatible only with the same version
/// of protobuf runtime.
// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_17_0;

#[derive(PartialEq,Clone,Default)]
pub struct Null {
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a Null {
    fn default() -> &'a Null {
        <Null as ::protobuf::Message>::default_instance()
    }
}

impl Null {
    pub fn new() -> Null {
        ::std::default::Default::default()
    }
}

impl ::protobuf::Message for Null {
    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 {
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        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<()> {
        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: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> Null {
        Null::new()
    }

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            let fields = ::std::vec::Vec::new();
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<Null>(
                "Null",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static Null {
        static instance: ::protobuf::rt::LazyV2<Null> = ::protobuf::rt::LazyV2::INIT;
        instance.get(Null::new)
    }
}

impl ::protobuf::Clear for Null {
    fn clear(&mut self) {
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for Null {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for Null {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
pub struct AddressState {
    // message fields
    pub address_map: ::std::vec::Vec<u8>,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a AddressState {
    fn default() -> &'a AddressState {
        <AddressState as ::protobuf::Message>::default_instance()
    }
}

impl AddressState {
    pub fn new() -> AddressState {
        ::std::default::Default::default()
    }

    // bytes address_map = 1;


    pub fn get_address_map(&self) -> &[u8] {
        &self.address_map
    }
    pub fn clear_address_map(&mut self) {
        self.address_map.clear();
    }

    // Param is passed by value, moved
    pub fn set_address_map(&mut self, v: ::std::vec::Vec<u8>) {
        self.address_map = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_address_map(&mut self) -> &mut ::std::vec::Vec<u8> {
        &mut self.address_map
    }

    // Take field
    pub fn take_address_map(&mut self) -> ::std::vec::Vec<u8> {
        ::std::mem::replace(&mut self.address_map, ::std::vec::Vec::new())
    }
}

impl ::protobuf::Message for AddressState {
    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_map)?;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if !self.address_map.is_empty() {
            my_size += ::protobuf::rt::bytes_size(1, &self.address_map);
        }
        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_map.is_empty() {
            os.write_bytes(1, &self.address_map)?;
        }
        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: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> AddressState {
        AddressState::new()
    }

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            let mut fields = ::std::vec::Vec::new();
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
                "address_map",
                |m: &AddressState| { &m.address_map },
                |m: &mut AddressState| { &mut m.address_map },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<AddressState>(
                "AddressState",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static AddressState {
        static instance: ::protobuf::rt::LazyV2<AddressState> = ::protobuf::rt::LazyV2::INIT;
        instance.get(AddressState::new)
    }
}

impl ::protobuf::Clear for AddressState {
    fn clear(&mut self) {
        self.address_map.clear();
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for AddressState {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for AddressState {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

#[derive(PartialEq,Clone,Default)]
pub struct ChangeReply {
    // message fields
    pub state: super::commonpb::State,
    pub address_map: ::std::vec::Vec<u8>,
    pub leader_id: u64,
    // special fields
    pub unknown_fields: ::protobuf::UnknownFields,
    pub cached_size: ::protobuf::CachedSize,
}

impl<'a> ::std::default::Default for &'a ChangeReply {
    fn default() -> &'a ChangeReply {
        <ChangeReply as ::protobuf::Message>::default_instance()
    }
}

impl ChangeReply {
    pub fn new() -> ChangeReply {
        ::std::default::Default::default()
    }

    // .bayard.common.State state = 1;


    pub fn get_state(&self) -> super::commonpb::State {
        self.state
    }
    pub fn clear_state(&mut self) {
        self.state = super::commonpb::State::OK;
    }

    // Param is passed by value, moved
    pub fn set_state(&mut self, v: super::commonpb::State) {
        self.state = v;
    }

    // bytes address_map = 2;


    pub fn get_address_map(&self) -> &[u8] {
        &self.address_map
    }
    pub fn clear_address_map(&mut self) {
        self.address_map.clear();
    }

    // Param is passed by value, moved
    pub fn set_address_map(&mut self, v: ::std::vec::Vec<u8>) {
        self.address_map = v;
    }

    // Mutable pointer to the field.
    // If field is not initialized, it is initialized with default value first.
    pub fn mut_address_map(&mut self) -> &mut ::std::vec::Vec<u8> {
        &mut self.address_map
    }

    // Take field
    pub fn take_address_map(&mut self) -> ::std::vec::Vec<u8> {
        ::std::mem::replace(&mut self.address_map, ::std::vec::Vec::new())
    }

    // uint64 leader_id = 3;


    pub fn get_leader_id(&self) -> u64 {
        self.leader_id
    }
    pub fn clear_leader_id(&mut self) {
        self.leader_id = 0;
    }

    // Param is passed by value, moved
    pub fn set_leader_id(&mut self, v: u64) {
        self.leader_id = v;
    }
}

impl ::protobuf::Message for ChangeReply {
    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_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.state, 1, &mut self.unknown_fields)?
                },
                2 => {
                    ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.address_map)?;
                },
                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.leader_id = tmp;
                },
                _ => {
                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u32 {
        let mut my_size = 0;
        if self.state != super::commonpb::State::OK {
            my_size += ::protobuf::rt::enum_size(1, self.state);
        }
        if !self.address_map.is_empty() {
            my_size += ::protobuf::rt::bytes_size(2, &self.address_map);
        }
        if self.leader_id != 0 {
            my_size += ::protobuf::rt::value_size(3, self.leader_id, ::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.state != super::commonpb::State::OK {
            os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.state))?;
        }
        if !self.address_map.is_empty() {
            os.write_bytes(2, &self.address_map)?;
        }
        if self.leader_id != 0 {
            os.write_uint64(3, self.leader_id)?;
        }
        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: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
        self
    }

    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
        Self::descriptor_static()
    }

    fn new() -> ChangeReply {
        ChangeReply::new()
    }

    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            let mut fields = ::std::vec::Vec::new();
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<super::commonpb::State>>(
                "state",
                |m: &ChangeReply| { &m.state },
                |m: &mut ChangeReply| { &mut m.state },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
                "address_map",
                |m: &ChangeReply| { &m.address_map },
                |m: &mut ChangeReply| { &mut m.address_map },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeUint64>(
                "leader_id",
                |m: &ChangeReply| { &m.leader_id },
                |m: &mut ChangeReply| { &mut m.leader_id },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<ChangeReply>(
                "ChangeReply",
                fields,
                file_descriptor_proto()
            )
        })
    }

    fn default_instance() -> &'static ChangeReply {
        static instance: ::protobuf::rt::LazyV2<ChangeReply> = ::protobuf::rt::LazyV2::INIT;
        instance.get(ChangeReply::new)
    }
}

impl ::protobuf::Clear for ChangeReply {
    fn clear(&mut self) {
        self.state = super::commonpb::State::OK;
        self.address_map.clear();
        self.leader_id = 0;
        self.unknown_fields.clear();
    }
}

impl ::std::fmt::Debug for ChangeReply {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for ChangeReply {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Message(self)
    }
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x0craftpb.proto\x12\x0bbayard.raft\x1a\reraftpb.proto\x1a\x0ecommonpb\
    .proto\"\x06\n\x04Null\"/\n\x0cAddressState\x12\x1f\n\x0baddress_map\x18\
    \x01\x20\x01(\x0cR\naddressMap\"w\n\x0bChangeReply\x12*\n\x05state\x18\
    \x01\x20\x01(\x0e2\x14.bayard.common.StateR\x05state\x12\x1f\n\x0baddres\
    s_map\x18\x02\x20\x01(\x0cR\naddressMap\x12\x1b\n\tleader_id\x18\x03\x20\
    \x01(\x04R\x08leaderId2\xf3\x01\n\x0bRaftService\x122\n\x08Snapshot\x12\
    \x11.eraftpb.Snapshot\x1a\x11.bayard.raft.Null\"\0\x12?\n\x0cChangeConfi\
    g\x12\x13.eraftpb.ConfChange\x1a\x18.bayard.raft.ChangeReply\"\0\x120\n\
    \x07SendMsg\x12\x10.eraftpb.Message\x1a\x11.bayard.raft.Null\"\0\x12=\n\
    \x0bSendAddress\x12\x19.bayard.raft.AddressState\x1a\x11.bayard.raft.Nul\
    l\"\0B\x0bZ\tpkg/protoJ\x9a\x05\n\x06\x12\x04\0\0\x1a\x01\n\x08\n\x01\
    \x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\x03\x02\x07\x16\n\t\n\x02\x03\
    \x01\x12\x03\x03\x07\x17\n\x08\n\x01\x02\x12\x03\x05\x08\x13\n\x08\n\x01\
    \x08\x12\x03\x07\0\x20\n\t\n\x02\x08\x0b\x12\x03\x07\0\x20\n\n\n\x02\x06\
    \0\x12\x04\t\0\x0e\x01\n\n\n\x03\x06\0\x01\x12\x03\t\x08\x13\n\x0b\n\x04\
    \x06\0\x02\0\x12\x03\n\x043\n\x0c\n\x05\x06\0\x02\0\x01\x12\x03\n\x08\
    \x10\n\x0c\n\x05\x06\0\x02\0\x02\x12\x03\n\x11!\n\x0c\n\x05\x06\0\x02\0\
    \x03\x12\x03\n+/\n\x0b\n\x04\x06\0\x02\x01\x12\x03\x0b\x04@\n\x0c\n\x05\
    \x06\0\x02\x01\x01\x12\x03\x0b\x08\x14\n\x0c\n\x05\x06\0\x02\x01\x02\x12\
    \x03\x0b\x15'\n\x0c\n\x05\x06\0\x02\x01\x03\x12\x03\x0b1<\n\x0b\n\x04\
    \x06\0\x02\x02\x12\x03\x0c\x041\n\x0c\n\x05\x06\0\x02\x02\x01\x12\x03\
    \x0c\x08\x0f\n\x0c\n\x05\x06\0\x02\x02\x02\x12\x03\x0c\x10\x1f\n\x0c\n\
    \x05\x06\0\x02\x02\x03\x12\x03\x0c)-\n\x0b\n\x04\x06\0\x02\x03\x12\x03\r\
    \x042\n\x0c\n\x05\x06\0\x02\x03\x01\x12\x03\r\x08\x13\n\x0c\n\x05\x06\0\
    \x02\x03\x02\x12\x03\r\x14\x20\n\x0c\n\x05\x06\0\x02\x03\x03\x12\x03\r*.\
    \n\t\n\x02\x04\0\x12\x03\x10\0\x0f\n\n\n\x03\x04\0\x01\x12\x03\x10\x08\
    \x0c\n\n\n\x02\x04\x01\x12\x04\x12\0\x14\x01\n\n\n\x03\x04\x01\x01\x12\
    \x03\x12\x08\x14\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x13\x04\x1a\n\r\n\x05\
    \x04\x01\x02\0\x04\x12\x04\x13\x04\x12\x16\n\x0c\n\x05\x04\x01\x02\0\x05\
    \x12\x03\x13\x04\t\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x13\n\x15\n\x0c\
    \n\x05\x04\x01\x02\0\x03\x12\x03\x13\x18\x19\n\n\n\x02\x04\x02\x12\x04\
    \x16\0\x1a\x01\n\n\n\x03\x04\x02\x01\x12\x03\x16\x08\x13\n\x0b\n\x04\x04\
    \x02\x02\0\x12\x03\x17\x04\"\n\r\n\x05\x04\x02\x02\0\x04\x12\x04\x17\x04\
    \x16\x15\n\x0c\n\x05\x04\x02\x02\0\x06\x12\x03\x17\x04\x17\n\x0c\n\x05\
    \x04\x02\x02\0\x01\x12\x03\x17\x18\x1d\n\x0c\n\x05\x04\x02\x02\0\x03\x12\
    \x03\x17\x20!\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x18\x04\x1a\n\r\n\x05\
    \x04\x02\x02\x01\x04\x12\x04\x18\x04\x17\"\n\x0c\n\x05\x04\x02\x02\x01\
    \x05\x12\x03\x18\x04\t\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x18\n\x15\
    \n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x18\x18\x19\n\x0b\n\x04\x04\x02\
    \x02\x02\x12\x03\x19\x04\x19\n\r\n\x05\x04\x02\x02\x02\x04\x12\x04\x19\
    \x04\x18\x1a\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\x19\x04\n\n\x0c\n\
    \x05\x04\x02\x02\x02\x01\x12\x03\x19\x0b\x14\n\x0c\n\x05\x04\x02\x02\x02\
    \x03\x12\x03\x19\x17\x18b\x06proto3\
";

static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

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 {
    file_descriptor_proto_lazy.get(|| {
        parse_descriptor_proto()
    })
}