emerald-vault 0.32.0

Emerald Vault - Key Storage for Emerald Wallet
Documentation
// This file is generated by rust-protobuf 2.25.2. Do not edit
// @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(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 `common.proto`

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

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

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

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

    // .emerald.vault.FileType file_type = 1;


    pub fn get_file_type(&self) -> FileType {
        self.file_type
    }
    pub fn clear_file_type(&mut self) {
        self.file_type = FileType::FILE_UNKNOWN;
    }

    // Param is passed by value, moved
    pub fn set_file_type(&mut self, v: FileType) {
        self.file_type = v;
    }

    // bytes id = 2;


    pub fn get_id(&self) -> &[u8] {
        &self.id
    }
    pub fn clear_id(&mut self) {
        self.id.clear();
    }

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

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

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

impl ::protobuf::Message for File {
    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.file_type, 1, &mut self.unknown_fields)?
                },
                2 => {
                    ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.id)?;
                },
                _ => {
                    ::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.file_type != FileType::FILE_UNKNOWN {
            my_size += ::protobuf::rt::enum_size(1, self.file_type);
        }
        if !self.id.is_empty() {
            my_size += ::protobuf::rt::bytes_size(2, &self.id);
        }
        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.file_type != FileType::FILE_UNKNOWN {
            os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.file_type))?;
        }
        if !self.id.is_empty() {
            os.write_bytes(2, &self.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() -> File {
        File::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<FileType>>(
                "file_type",
                |m: &File| { &m.file_type },
                |m: &mut File| { &mut m.file_type },
            ));
            fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>(
                "id",
                |m: &File| { &m.id },
                |m: &mut File| { &mut m.id },
            ));
            ::protobuf::reflect::MessageDescriptor::new_pb_name::<File>(
                "File",
                fields,
                file_descriptor_proto()
            )
        })
    }

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

impl ::protobuf::Clear for File {
    fn clear(&mut self) {
        self.file_type = FileType::FILE_UNKNOWN;
        self.id.clear();
        self.unknown_fields.clear();
    }
}

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

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

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum FileType {
    FILE_UNKNOWN = 0,
    FILE_WALLET = 1,
    FILE_PK = 2,
    FILE_SEED = 3,
    FILE_BOOK = 4,
}

impl ::protobuf::ProtobufEnum for FileType {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<FileType> {
        match value {
            0 => ::std::option::Option::Some(FileType::FILE_UNKNOWN),
            1 => ::std::option::Option::Some(FileType::FILE_WALLET),
            2 => ::std::option::Option::Some(FileType::FILE_PK),
            3 => ::std::option::Option::Some(FileType::FILE_SEED),
            4 => ::std::option::Option::Some(FileType::FILE_BOOK),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [FileType] = &[
            FileType::FILE_UNKNOWN,
            FileType::FILE_WALLET,
            FileType::FILE_PK,
            FileType::FILE_SEED,
            FileType::FILE_BOOK,
        ];
        values
    }

    fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            ::protobuf::reflect::EnumDescriptor::new_pb_name::<FileType>("FileType", file_descriptor_proto())
        })
    }
}

impl ::std::marker::Copy for FileType {
}

impl ::std::default::Default for FileType {
    fn default() -> Self {
        FileType::FILE_UNKNOWN
    }
}

impl ::protobuf::reflect::ProtobufValue for FileType {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}

#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum BlockchainId {
    CHAIN_UNSPECIFIED = 0,
    CHAIN_BITCOIN = 1,
    CHAIN_ETHEREUM = 100,
    CHAIN_ETHEREUM_CLASSIC = 101,
    CHAIN_MATIC = 1002,
    CHAIN_RSK = 1003,
    CHAIN_MORDEN = 10001,
    CHAIN_KOVAN = 10002,
    CHAIN_TESTNET_BITCOIN = 10003,
    CHAIN_GOERLI = 10005,
    CHAIN_ROPSTEN = 10006,
    CHAIN_RINKEBY = 10007,
}

impl ::protobuf::ProtobufEnum for BlockchainId {
    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<BlockchainId> {
        match value {
            0 => ::std::option::Option::Some(BlockchainId::CHAIN_UNSPECIFIED),
            1 => ::std::option::Option::Some(BlockchainId::CHAIN_BITCOIN),
            100 => ::std::option::Option::Some(BlockchainId::CHAIN_ETHEREUM),
            101 => ::std::option::Option::Some(BlockchainId::CHAIN_ETHEREUM_CLASSIC),
            1002 => ::std::option::Option::Some(BlockchainId::CHAIN_MATIC),
            1003 => ::std::option::Option::Some(BlockchainId::CHAIN_RSK),
            10001 => ::std::option::Option::Some(BlockchainId::CHAIN_MORDEN),
            10002 => ::std::option::Option::Some(BlockchainId::CHAIN_KOVAN),
            10003 => ::std::option::Option::Some(BlockchainId::CHAIN_TESTNET_BITCOIN),
            10005 => ::std::option::Option::Some(BlockchainId::CHAIN_GOERLI),
            10006 => ::std::option::Option::Some(BlockchainId::CHAIN_ROPSTEN),
            10007 => ::std::option::Option::Some(BlockchainId::CHAIN_RINKEBY),
            _ => ::std::option::Option::None
        }
    }

    fn values() -> &'static [Self] {
        static values: &'static [BlockchainId] = &[
            BlockchainId::CHAIN_UNSPECIFIED,
            BlockchainId::CHAIN_BITCOIN,
            BlockchainId::CHAIN_ETHEREUM,
            BlockchainId::CHAIN_ETHEREUM_CLASSIC,
            BlockchainId::CHAIN_MATIC,
            BlockchainId::CHAIN_RSK,
            BlockchainId::CHAIN_MORDEN,
            BlockchainId::CHAIN_KOVAN,
            BlockchainId::CHAIN_TESTNET_BITCOIN,
            BlockchainId::CHAIN_GOERLI,
            BlockchainId::CHAIN_ROPSTEN,
            BlockchainId::CHAIN_RINKEBY,
        ];
        values
    }

    fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT;
        descriptor.get(|| {
            ::protobuf::reflect::EnumDescriptor::new_pb_name::<BlockchainId>("BlockchainId", file_descriptor_proto())
        })
    }
}

impl ::std::marker::Copy for BlockchainId {
}

impl ::std::default::Default for BlockchainId {
    fn default() -> Self {
        BlockchainId::CHAIN_UNSPECIFIED
    }
}

impl ::protobuf::reflect::ProtobufValue for BlockchainId {
    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
        ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
    }
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x0ccommon.proto\x12\remerald.vault\"L\n\x04File\x124\n\tfile_type\x18\
    \x01\x20\x01(\x0e2\x17.emerald.vault.FileTypeR\x08fileType\x12\x0e\n\x02\
    id\x18\x02\x20\x01(\x0cR\x02id*X\n\x08FileType\x12\x10\n\x0cFILE_UNKNOWN\
    \x10\0\x12\x0f\n\x0bFILE_WALLET\x10\x01\x12\x0b\n\x07FILE_PK\x10\x02\x12\
    \r\n\tFILE_SEED\x10\x03\x12\r\n\tFILE_BOOK\x10\x04*\x86\x02\n\x0cBlockch\
    ainId\x12\x15\n\x11CHAIN_UNSPECIFIED\x10\0\x12\x11\n\rCHAIN_BITCOIN\x10\
    \x01\x12\x12\n\x0eCHAIN_ETHEREUM\x10d\x12\x1a\n\x16CHAIN_ETHEREUM_CLASSI\
    C\x10e\x12\x10\n\x0bCHAIN_MATIC\x10\xea\x07\x12\x0e\n\tCHAIN_RSK\x10\xeb\
    \x07\x12\x11\n\x0cCHAIN_MORDEN\x10\x91N\x12\x10\n\x0bCHAIN_KOVAN\x10\x92\
    N\x12\x1a\n\x15CHAIN_TESTNET_BITCOIN\x10\x93N\x12\x11\n\x0cCHAIN_GOERLI\
    \x10\x95N\x12\x12\n\rCHAIN_ROPSTEN\x10\x96N\x12\x12\n\rCHAIN_RINKEBY\x10\
    \x97NJ\xf9\x08\n\x06\x12\x04\0\0&\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\
    \x08\n\x01\x02\x12\x03\x01\0\x16\n\n\n\x02\x04\0\x12\x04\x03\0\x06\x01\n\
    \n\n\x03\x04\0\x01\x12\x03\x03\x08\x0c\n\x0b\n\x04\x04\0\x02\0\x12\x03\
    \x04\x04\x1b\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x04\x04\x0c\n\x0c\n\x05\
    \x04\0\x02\0\x01\x12\x03\x04\r\x16\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\
    \x04\x19\x1a\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x05\x04\x11\n\x0c\n\x05\
    \x04\0\x02\x01\x05\x12\x03\x05\x04\t\n\x0c\n\x05\x04\0\x02\x01\x01\x12\
    \x03\x05\n\x0c\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x05\x0f\x10\n\n\n\
    \x02\x05\0\x12\x04\x08\0\x0e\x01\n\n\n\x03\x05\0\x01\x12\x03\x08\x05\r\n\
    \x0b\n\x04\x05\0\x02\0\x12\x03\t\x04\x15\n\x0c\n\x05\x05\0\x02\0\x01\x12\
    \x03\t\x04\x10\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\t\x13\x14\n\x0b\n\x04\
    \x05\0\x02\x01\x12\x03\n\x04\x14\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\n\
    \x04\x0f\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\n\x12\x13\n\x0b\n\x04\x05\
    \0\x02\x02\x12\x03\x0b\x04\x10\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x0b\
    \x04\x0b\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x0b\x0e\x0f\n\x0b\n\x04\
    \x05\0\x02\x03\x12\x03\x0c\x04\x12\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\
    \x0c\x04\r\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x0c\x10\x11\n\x0b\n\x04\
    \x05\0\x02\x04\x12\x03\r\x04\x12\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\r\
    \x04\r\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\r\x10\x11\n\n\n\x02\x05\x01\
    \x12\x04\x10\0&\x01\n\n\n\x03\x05\x01\x01\x12\x03\x10\x05\x11\n\x0b\n\
    \x04\x05\x01\x02\0\x12\x03\x11\x04\x1a\n\x0c\n\x05\x05\x01\x02\0\x01\x12\
    \x03\x11\x04\x15\n\x0c\n\x05\x05\x01\x02\0\x02\x12\x03\x11\x18\x19\n\x1e\
    \n\x04\x05\x01\x02\x01\x12\x03\x13\x04\x16\"\x11\x20CHAIN_GRIN\x20=\x202\
    ;\n\n\x0c\n\x05\x05\x01\x02\x01\x01\x12\x03\x13\x04\x11\n\x0c\n\x05\x05\
    \x01\x02\x01\x02\x12\x03\x13\x14\x15\n\x0b\n\x04\x05\x01\x02\x02\x12\x03\
    \x16\x04\x19\n\x0c\n\x05\x05\x01\x02\x02\x01\x12\x03\x16\x04\x12\n\x0c\n\
    \x05\x05\x01\x02\x02\x02\x12\x03\x16\x15\x18\n\x0b\n\x04\x05\x01\x02\x03\
    \x12\x03\x17\x04!\n\x0c\n\x05\x05\x01\x02\x03\x01\x12\x03\x17\x04\x1a\n\
    \x0c\n\x05\x05\x01\x02\x03\x02\x12\x03\x17\x1d\x20\n\x87\x01\n\x04\x05\
    \x01\x02\x04\x12\x03\x1b\x04\x17\x1aI\x20Sidechains\x20and\x20state\x20c\
    hannels\x20start\x20with\x201_000\n\x20CHAIN_LIGHTNING\x20=\x201001;\n\"\
    /\x20Matic\x20PoS\x20Ethereum\x20sidechain\x20based\x20on\x20Polygon\n\n\
    \x0c\n\x05\x05\x01\x02\x04\x01\x12\x03\x1b\x04\x0f\n\x0c\n\x05\x05\x01\
    \x02\x04\x02\x12\x03\x1b\x12\x16\n1\n\x04\x05\x01\x02\x05\x12\x03\x1c\
    \x04\x15\"$\x20RSK\x20sidechain,\x20https://www.rsk.co/\n\n\x0c\n\x05\
    \x05\x01\x02\x05\x01\x12\x03\x1c\x04\r\n\x0c\n\x05\x05\x01\x02\x05\x02\
    \x12\x03\x1c\x10\x14\n)\n\x04\x05\x01\x02\x06\x12\x03\x1f\x04\x19\x1a\
    \x1c\x20Testnets\x20start\x20with\x2010_000\n\n\x0c\n\x05\x05\x01\x02\
    \x06\x01\x12\x03\x1f\x04\x10\n\x0c\n\x05\x05\x01\x02\x06\x02\x12\x03\x1f\
    \x13\x18\n\x0b\n\x04\x05\x01\x02\x07\x12\x03\x20\x04\x18\n\x0c\n\x05\x05\
    \x01\x02\x07\x01\x12\x03\x20\x04\x0f\n\x0c\n\x05\x05\x01\x02\x07\x02\x12\
    \x03\x20\x12\x17\n\x0b\n\x04\x05\x01\x02\x08\x12\x03!\x04\"\n\x0c\n\x05\
    \x05\x01\x02\x08\x01\x12\x03!\x04\x19\n\x0c\n\x05\x05\x01\x02\x08\x02\
    \x12\x03!\x1c!\n%\n\x04\x05\x01\x02\t\x12\x03#\x04\x19\x1a\x18\x20CHAIN_\
    FLOONET\x20=\x2010004;\n\n\x0c\n\x05\x05\x01\x02\t\x01\x12\x03#\x04\x10\
    \n\x0c\n\x05\x05\x01\x02\t\x02\x12\x03#\x13\x18\n\x0b\n\x04\x05\x01\x02\
    \n\x12\x03$\x04\x1a\n\x0c\n\x05\x05\x01\x02\n\x01\x12\x03$\x04\x11\n\x0c\
    \n\x05\x05\x01\x02\n\x02\x12\x03$\x14\x19\n\x0b\n\x04\x05\x01\x02\x0b\
    \x12\x03%\x04\x1a\n\x0c\n\x05\x05\x01\x02\x0b\x01\x12\x03%\x04\x11\n\x0c\
    \n\x05\x05\x01\x02\x0b\x02\x12\x03%\x14\x19b\x06proto3\
";

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

fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
    ::protobuf::Message::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()
    })
}