// This file is generated by rust-protobuf 3.7.2. Do not edit
// .proto file is parsed by protoc 34.1
// @generated

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

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

#![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_results)]
#![allow(unused_mut)]

//! Generated file from `proto/backup_metadata.proto`
// Generated for lite runtime

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

// @@protoc_insertion_point(message:svrb.backup_metadata.MetadataPb)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct MetadataPb {
    // message fields
    // @@protoc_insertion_point(field:svrb.backup_metadata.MetadataPb.pair)
    pub pair: ::std::vec::Vec<metadata_pb::Pair>,
    // @@protoc_insertion_point(field:svrb.backup_metadata.MetadataPb.iv)
    pub iv: ::std::vec::Vec<u8>,
    // special fields
    // @@protoc_insertion_point(special_field:svrb.backup_metadata.MetadataPb.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

impl ::protobuf::Message for MetadataPb {
    const NAME: &'static str = "MetadataPb";

    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.pair.push(is.read_message()?);
                },
                18 => {
                    self.iv = is.read_bytes()?;
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        for value in &self.pair {
            let len = value.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        };
        if !self.iv.is_empty() {
            my_size += ::protobuf::rt::bytes_size(2, &self.iv);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        for v in &self.pair {
            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
        };
        if !self.iv.is_empty() {
            os.write_bytes(2, &self.iv)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

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

    fn clear(&mut self) {
        self.pair.clear();
        self.iv.clear();
        self.special_fields.clear();
    }

    fn default_instance() -> &'static MetadataPb {
        static instance: MetadataPb = MetadataPb {
            pair: ::std::vec::Vec::new(),
            iv: ::std::vec::Vec::new(),
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

/// Nested message and enums of message `MetadataPb`
pub mod metadata_pb {
    // @@protoc_insertion_point(message:svrb.backup_metadata.MetadataPb.Pair)
    #[derive(PartialEq,Clone,Default,Debug)]
    pub struct Pair {
        // message fields
        // @@protoc_insertion_point(field:svrb.backup_metadata.MetadataPb.Pair.ct)
        pub ct: ::std::vec::Vec<u8>,
        // @@protoc_insertion_point(field:svrb.backup_metadata.MetadataPb.Pair.pw_salt)
        pub pw_salt: ::std::vec::Vec<u8>,
        // special fields
        // @@protoc_insertion_point(special_field:svrb.backup_metadata.MetadataPb.Pair.special_fields)
        pub special_fields: ::protobuf::SpecialFields,
    }

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

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

    impl ::protobuf::Message for Pair {
        const NAME: &'static str = "Pair";

        fn is_initialized(&self) -> bool {
            true
        }

        fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
            while let Some(tag) = is.read_raw_tag_or_eof()? {
                match tag {
                    10 => {
                        self.ct = is.read_bytes()?;
                    },
                    18 => {
                        self.pw_salt = is.read_bytes()?;
                    },
                    tag => {
                        ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                    },
                };
            }
            ::std::result::Result::Ok(())
        }

        // Compute sizes of nested messages
        #[allow(unused_variables)]
        fn compute_size(&self) -> u64 {
            let mut my_size = 0;
            if !self.ct.is_empty() {
                my_size += ::protobuf::rt::bytes_size(1, &self.ct);
            }
            if !self.pw_salt.is_empty() {
                my_size += ::protobuf::rt::bytes_size(2, &self.pw_salt);
            }
            my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
            self.special_fields.cached_size().set(my_size as u32);
            my_size
        }

        fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
            if !self.ct.is_empty() {
                os.write_bytes(1, &self.ct)?;
            }
            if !self.pw_salt.is_empty() {
                os.write_bytes(2, &self.pw_salt)?;
            }
            os.write_unknown_fields(self.special_fields.unknown_fields())?;
            ::std::result::Result::Ok(())
        }

        fn special_fields(&self) -> &::protobuf::SpecialFields {
            &self.special_fields
        }

        fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
            &mut self.special_fields
        }

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

        fn clear(&mut self) {
            self.ct.clear();
            self.pw_salt.clear();
            self.special_fields.clear();
        }

        fn default_instance() -> &'static Pair {
            static instance: Pair = Pair {
                ct: ::std::vec::Vec::new(),
                pw_salt: ::std::vec::Vec::new(),
                special_fields: ::protobuf::SpecialFields::new(),
            };
            &instance
        }
    }
}

// @@protoc_insertion_point(message:svrb.backup_metadata.NextBackupPb)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct NextBackupPb {
    // message oneof groups
    pub from_previous: ::std::option::Option<next_backup_pb::From_previous>,
    // special fields
    // @@protoc_insertion_point(special_field:svrb.backup_metadata.NextBackupPb.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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

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

    // .svrb.backup_metadata.NextBackupPb.Backup backup = 1;

    pub fn backup(&self) -> &next_backup_pb::Backup {
        match self.from_previous {
            ::std::option::Option::Some(next_backup_pb::From_previous::Backup(ref v)) => v,
            _ => <next_backup_pb::Backup as ::protobuf::Message>::default_instance(),
        }
    }

    pub fn clear_backup(&mut self) {
        self.from_previous = ::std::option::Option::None;
    }

    pub fn has_backup(&self) -> bool {
        match self.from_previous {
            ::std::option::Option::Some(next_backup_pb::From_previous::Backup(..)) => true,
            _ => false,
        }
    }

    // Param is passed by value, moved
    pub fn set_backup(&mut self, v: next_backup_pb::Backup) {
        self.from_previous = ::std::option::Option::Some(next_backup_pb::From_previous::Backup(v))
    }

    // Mutable pointer to the field.
    pub fn mut_backup(&mut self) -> &mut next_backup_pb::Backup {
        if let ::std::option::Option::Some(next_backup_pb::From_previous::Backup(_)) = self.from_previous {
        } else {
            self.from_previous = ::std::option::Option::Some(next_backup_pb::From_previous::Backup(next_backup_pb::Backup::new()));
        }
        match self.from_previous {
            ::std::option::Option::Some(next_backup_pb::From_previous::Backup(ref mut v)) => v,
            _ => panic!(),
        }
    }

    // Take field
    pub fn take_backup(&mut self) -> next_backup_pb::Backup {
        if self.has_backup() {
            match self.from_previous.take() {
                ::std::option::Option::Some(next_backup_pb::From_previous::Backup(v)) => v,
                _ => panic!(),
            }
        } else {
            next_backup_pb::Backup::new()
        }
    }

    // .svrb.backup_metadata.NextBackupPb.Restore restore = 2;

    pub fn restore(&self) -> &next_backup_pb::Restore {
        match self.from_previous {
            ::std::option::Option::Some(next_backup_pb::From_previous::Restore(ref v)) => v,
            _ => <next_backup_pb::Restore as ::protobuf::Message>::default_instance(),
        }
    }

    pub fn clear_restore(&mut self) {
        self.from_previous = ::std::option::Option::None;
    }

    pub fn has_restore(&self) -> bool {
        match self.from_previous {
            ::std::option::Option::Some(next_backup_pb::From_previous::Restore(..)) => true,
            _ => false,
        }
    }

    // Param is passed by value, moved
    pub fn set_restore(&mut self, v: next_backup_pb::Restore) {
        self.from_previous = ::std::option::Option::Some(next_backup_pb::From_previous::Restore(v))
    }

    // Mutable pointer to the field.
    pub fn mut_restore(&mut self) -> &mut next_backup_pb::Restore {
        if let ::std::option::Option::Some(next_backup_pb::From_previous::Restore(_)) = self.from_previous {
        } else {
            self.from_previous = ::std::option::Option::Some(next_backup_pb::From_previous::Restore(next_backup_pb::Restore::new()));
        }
        match self.from_previous {
            ::std::option::Option::Some(next_backup_pb::From_previous::Restore(ref mut v)) => v,
            _ => panic!(),
        }
    }

    // Take field
    pub fn take_restore(&mut self) -> next_backup_pb::Restore {
        if self.has_restore() {
            match self.from_previous.take() {
                ::std::option::Option::Some(next_backup_pb::From_previous::Restore(v)) => v,
                _ => panic!(),
            }
        } else {
            next_backup_pb::Restore::new()
        }
    }
}

impl ::protobuf::Message for NextBackupPb {
    const NAME: &'static str = "NextBackupPb";

    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.from_previous = ::std::option::Option::Some(next_backup_pb::From_previous::Backup(is.read_message()?));
                },
                18 => {
                    self.from_previous = ::std::option::Option::Some(next_backup_pb::From_previous::Restore(is.read_message()?));
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let ::std::option::Option::Some(ref v) = self.from_previous {
            match v {
                &next_backup_pb::From_previous::Backup(ref v) => {
                    let len = v.compute_size();
                    my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
                },
                &next_backup_pb::From_previous::Restore(ref v) => {
                    let len = v.compute_size();
                    my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
                },
            };
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let ::std::option::Option::Some(ref v) = self.from_previous {
            match v {
                &next_backup_pb::From_previous::Backup(ref v) => {
                    ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
                },
                &next_backup_pb::From_previous::Restore(ref v) => {
                    ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
                },
            };
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

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

    fn clear(&mut self) {
        self.from_previous = ::std::option::Option::None;
        self.from_previous = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static NextBackupPb {
        static instance: NextBackupPb = NextBackupPb {
            from_previous: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

/// Nested message and enums of message `NextBackupPb`
pub mod next_backup_pb {

    #[derive(Clone,PartialEq,Debug)]
    #[non_exhaustive]
    // @@protoc_insertion_point(oneof:svrb.backup_metadata.NextBackupPb.from_previous)
    pub enum From_previous {
        // @@protoc_insertion_point(oneof_field:svrb.backup_metadata.NextBackupPb.backup)
        Backup(Backup),
        // @@protoc_insertion_point(oneof_field:svrb.backup_metadata.NextBackupPb.restore)
        Restore(Restore),
    }

    impl ::protobuf::Oneof for From_previous {
    }

    impl From_previous {
    }
    // @@protoc_insertion_point(message:svrb.backup_metadata.NextBackupPb.Backup)
    #[derive(PartialEq,Clone,Default,Debug)]
    pub struct Backup {
        // message fields
        // @@protoc_insertion_point(field:svrb.backup_metadata.NextBackupPb.Backup.pw_salt)
        pub pw_salt: ::std::vec::Vec<u8>,
        // @@protoc_insertion_point(field:svrb.backup_metadata.NextBackupPb.Backup.backup4)
        pub backup4: ::protobuf::MessageField<super::super::backup4::Backup4>,
        // special fields
        // @@protoc_insertion_point(special_field:svrb.backup_metadata.NextBackupPb.Backup.special_fields)
        pub special_fields: ::protobuf::SpecialFields,
    }

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

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

    impl ::protobuf::Message for Backup {
        const NAME: &'static str = "Backup";

        fn is_initialized(&self) -> bool {
            true
        }

        fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
            while let Some(tag) = is.read_raw_tag_or_eof()? {
                match tag {
                    10 => {
                        self.pw_salt = is.read_bytes()?;
                    },
                    18 => {
                        ::protobuf::rt::read_singular_message_into_field(is, &mut self.backup4)?;
                    },
                    tag => {
                        ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                    },
                };
            }
            ::std::result::Result::Ok(())
        }

        // Compute sizes of nested messages
        #[allow(unused_variables)]
        fn compute_size(&self) -> u64 {
            let mut my_size = 0;
            if !self.pw_salt.is_empty() {
                my_size += ::protobuf::rt::bytes_size(1, &self.pw_salt);
            }
            if let Some(v) = self.backup4.as_ref() {
                let len = v.compute_size();
                my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
            }
            my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
            self.special_fields.cached_size().set(my_size as u32);
            my_size
        }

        fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
            if !self.pw_salt.is_empty() {
                os.write_bytes(1, &self.pw_salt)?;
            }
            if let Some(v) = self.backup4.as_ref() {
                ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
            }
            os.write_unknown_fields(self.special_fields.unknown_fields())?;
            ::std::result::Result::Ok(())
        }

        fn special_fields(&self) -> &::protobuf::SpecialFields {
            &self.special_fields
        }

        fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
            &mut self.special_fields
        }

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

        fn clear(&mut self) {
            self.pw_salt.clear();
            self.backup4.clear();
            self.special_fields.clear();
        }

        fn default_instance() -> &'static Backup {
            static instance: Backup = Backup {
                pw_salt: ::std::vec::Vec::new(),
                backup4: ::protobuf::MessageField::none(),
                special_fields: ::protobuf::SpecialFields::new(),
            };
            &instance
        }
    }

    // @@protoc_insertion_point(message:svrb.backup_metadata.NextBackupPb.Restore)
    #[derive(PartialEq,Clone,Default,Debug)]
    pub struct Restore {
        // message fields
        // @@protoc_insertion_point(field:svrb.backup_metadata.NextBackupPb.Restore.pw_salt)
        pub pw_salt: ::std::vec::Vec<u8>,
        // @@protoc_insertion_point(field:svrb.backup_metadata.NextBackupPb.Restore.enc_salt)
        pub enc_salt: ::std::vec::Vec<u8>,
        // special fields
        // @@protoc_insertion_point(special_field:svrb.backup_metadata.NextBackupPb.Restore.special_fields)
        pub special_fields: ::protobuf::SpecialFields,
    }

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

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

    impl ::protobuf::Message for Restore {
        const NAME: &'static str = "Restore";

        fn is_initialized(&self) -> bool {
            true
        }

        fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
            while let Some(tag) = is.read_raw_tag_or_eof()? {
                match tag {
                    10 => {
                        self.pw_salt = is.read_bytes()?;
                    },
                    18 => {
                        self.enc_salt = is.read_bytes()?;
                    },
                    tag => {
                        ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                    },
                };
            }
            ::std::result::Result::Ok(())
        }

        // Compute sizes of nested messages
        #[allow(unused_variables)]
        fn compute_size(&self) -> u64 {
            let mut my_size = 0;
            if !self.pw_salt.is_empty() {
                my_size += ::protobuf::rt::bytes_size(1, &self.pw_salt);
            }
            if !self.enc_salt.is_empty() {
                my_size += ::protobuf::rt::bytes_size(2, &self.enc_salt);
            }
            my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
            self.special_fields.cached_size().set(my_size as u32);
            my_size
        }

        fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
            if !self.pw_salt.is_empty() {
                os.write_bytes(1, &self.pw_salt)?;
            }
            if !self.enc_salt.is_empty() {
                os.write_bytes(2, &self.enc_salt)?;
            }
            os.write_unknown_fields(self.special_fields.unknown_fields())?;
            ::std::result::Result::Ok(())
        }

        fn special_fields(&self) -> &::protobuf::SpecialFields {
            &self.special_fields
        }

        fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
            &mut self.special_fields
        }

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

        fn clear(&mut self) {
            self.pw_salt.clear();
            self.enc_salt.clear();
            self.special_fields.clear();
        }

        fn default_instance() -> &'static Restore {
            static instance: Restore = Restore {
                pw_salt: ::std::vec::Vec::new(),
                enc_salt: ::std::vec::Vec::new(),
                special_fields: ::protobuf::SpecialFields::new(),
            };
            &instance
        }
    }
}
