diff --git a/Cargo.toml b/Cargo.toml index ca1029f3..b3d05cda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ lazy_static = "1" log = "0.4" pin-project = "1" prometheus = { version = "0.13", default-features = false } -prost = "0.13" +prost = "0.14" rand = "0.8" regex = "1" semver = "1.0" @@ -46,7 +46,8 @@ serde_json = "1" take_mut = "0.2.2" thiserror = "1" tokio = { version = "1.21", features = ["sync", "rt-multi-thread", "macros"] } -tonic = { version = "0.12", features = ["tls", "gzip"] } +tonic = { version = "0.14", features = ["tls-ring", "gzip"] } +tonic-prost = "0.14" [dev-dependencies] clap = "2" diff --git a/proto-build/Cargo.toml b/proto-build/Cargo.toml index ca3fad6e..fb69f1d7 100644 --- a/proto-build/Cargo.toml +++ b/proto-build/Cargo.toml @@ -12,6 +12,6 @@ edition = "2021" [dependencies] glob = "0.3" -tonic-build = { version = "0.10", features = ["cleanup-markdown"] } -# Keep this compatible with rust-toolchain 1.84.1. +tonic-prost-build = { version = "0.14", features = ["cleanup-markdown"] } +# Keep this pinned for reproducible builds. tempfile = "=3.14.0" diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 4c4d7acd..c1e148b5 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -1,17 +1,19 @@ // Copyright 2023 TiKV Project Authors. Licensed under Apache-2.0. +use std::path::PathBuf; + fn main() { - tonic_build::configure() + let protos = glob::glob("proto/*.proto") + .unwrap() + .collect::, _>>() + .unwrap(); + let includes = [PathBuf::from("proto/include"), PathBuf::from("proto")]; + + tonic_prost_build::configure() .emit_rerun_if_changed(false) .build_server(false) .include_file("mod.rs") .out_dir("src/generated") - .compile( - &glob::glob("proto/*.proto") - .unwrap() - .collect::, _>>() - .unwrap(), - &["proto/include", "proto"], - ) + .compile_protos(&protos, &includes) .unwrap(); } diff --git a/src/generated/autoid.rs b/src/generated/autoid.rs index 503024ab..c148b6f4 100644 --- a/src/generated/autoid.rs +++ b/src/generated/autoid.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct AutoIdRequest { #[prost(int64, tag = "1")] pub db_id: i64, @@ -17,8 +16,7 @@ pub struct AutoIdRequest { #[prost(uint32, tag = "7")] pub keyspace_id: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AutoIdResponse { #[prost(int64, tag = "1")] pub min: i64, @@ -27,8 +25,7 @@ pub struct AutoIdResponse { #[prost(bytes = "vec", tag = "3")] pub errmsg: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RebaseRequest { #[prost(int64, tag = "1")] pub db_id: i64, @@ -41,15 +38,20 @@ pub struct RebaseRequest { #[prost(bool, tag = "5")] pub force: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RebaseResponse { #[prost(bytes = "vec", tag = "1")] pub errmsg: ::prost::alloc::vec::Vec, } /// Generated client implementations. pub mod auto_id_alloc_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -69,10 +71,10 @@ pub mod auto_id_alloc_client { } impl AutoIdAllocClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -90,14 +92,14 @@ pub mod auto_id_alloc_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { AutoIdAllocClient::new(InterceptedService::new(inner, interceptor)) } @@ -140,12 +142,11 @@ pub mod auto_id_alloc_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/autoid.AutoIDAlloc/AllocAutoID", ); @@ -162,12 +163,11 @@ pub mod auto_id_alloc_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/autoid.AutoIDAlloc/Rebase", ); diff --git a/src/generated/backup.rs b/src/generated/backup.rs index 1d4d331d..42cabc46 100644 --- a/src/generated/backup.rs +++ b/src/generated/backup.rs @@ -1,5 +1,4 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrepareSnapshotBackupRequest { /// The type of the request. @@ -13,7 +12,6 @@ pub struct PrepareSnapshotBackupRequest { #[prost(uint64, tag = "3")] pub lease_in_seconds: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrepareSnapshotBackupResponse { /// The type of the event. @@ -32,7 +30,6 @@ pub struct PrepareSnapshotBackupResponse { pub last_lease_is_valid: bool, } /// The message save the metadata of a backup. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BackupMeta { /// ID and version of backuped cluster. @@ -122,7 +119,6 @@ pub struct BackupMeta { #[prost(uint64, tag = "25")] pub backup_size: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BackupRange { #[prost(bytes = "vec", tag = "1")] @@ -133,8 +129,7 @@ pub struct BackupRange { pub files: ::prost::alloc::vec::Vec, } /// The message saves the physical table checksum -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TableMeta { /// physical id is either table id or partition id #[prost(int64, tag = "1")] @@ -146,7 +141,6 @@ pub struct TableMeta { #[prost(uint64, tag = "4")] pub total_bytes: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct File { #[prost(string, tag = "1")] @@ -180,7 +174,6 @@ pub struct File { pub cipher_iv: ::prost::alloc::vec::Vec, } /// MetaFile describes a multi-level index of data used in backup. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MetaFile { /// A set of files that contains a MetaFile. @@ -203,14 +196,12 @@ pub struct MetaFile { #[prost(bytes = "vec", repeated, tag = "5")] pub ddls: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PlacementPolicy { #[prost(bytes = "vec", tag = "1")] pub info: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StatsBlock { /// The physical id which the stats json data belongs to. #[prost(int64, tag = "1")] @@ -219,15 +210,13 @@ pub struct StatsBlock { #[prost(bytes = "vec", tag = "2")] pub json_table: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatsFile { /// A set of files that contains json_tables. #[prost(message, repeated, tag = "1")] pub blocks: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StatsFileIndex { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -246,7 +235,6 @@ pub struct StatsFileIndex { #[prost(bytes = "vec", tag = "6")] pub inline_data: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Schema { #[prost(bytes = "vec", tag = "1")] @@ -280,15 +268,13 @@ pub struct Schema { bool, >, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct IdMap { #[prost(int64, tag = "1")] pub upstream_id: i64, #[prost(int64, tag = "2")] pub downstream_id: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PitrTableMap { #[prost(string, tag = "1")] @@ -301,7 +287,6 @@ pub struct PitrTableMap { #[prost(bool, tag = "4")] pub filtered_out: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PitrDbMap { #[prost(string, tag = "1")] @@ -318,8 +303,7 @@ pub struct PitrDbMap { #[prost(bool, tag = "5")] pub reused: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RawRange { #[prost(bytes = "vec", tag = "1")] pub start_key: ::prost::alloc::vec::Vec, @@ -328,15 +312,13 @@ pub struct RawRange { #[prost(string, tag = "3")] pub cf: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ClusterIdError { #[prost(uint64, tag = "1")] pub current: u64, #[prost(uint64, tag = "2")] pub request: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Error { #[prost(string, tag = "1")] @@ -346,7 +328,6 @@ pub struct Error { } /// Nested message and enum types in `Error`. pub mod error { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Detail { #[prost(message, tag = "3")] @@ -357,7 +338,6 @@ pub mod error { RegionError(super::super::errorpb::Error), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamBackupTaskSecurityConfig { #[prost(oneof = "stream_backup_task_security_config::Encryption", tags = "1, 2")] @@ -367,7 +347,6 @@ pub struct StreamBackupTaskSecurityConfig { } /// Nested message and enum types in `StreamBackupTaskSecurityConfig`. pub mod stream_backup_task_security_config { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Encryption { /// not recommended in production. configure KMS based or locally managed master key instead in TiKV StreamBackupConfig @@ -377,15 +356,13 @@ pub mod stream_backup_task_security_config { MasterKeyConfig(super::MasterKeyConfig), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CipherInfo { #[prost(enumeration = "super::encryptionpb::EncryptionMethod", tag = "1")] pub cipher_type: i32, #[prost(bytes = "vec", tag = "2")] pub cipher_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MasterKeyConfig { #[prost(enumeration = "super::encryptionpb::EncryptionMethod", tag = "1")] @@ -393,13 +370,11 @@ pub struct MasterKeyConfig { #[prost(message, repeated, tag = "2")] pub master_keys: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SortedSubRanges { #[prost(message, repeated, tag = "1")] pub sub_ranges: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BackupRequest { #[prost(uint64, tag = "1")] @@ -467,7 +442,6 @@ pub struct BackupRequest { #[prost(message, optional, tag = "20")] pub context: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StreamBackupTaskInfo { /// The storage for backup, parsed by BR. @@ -493,7 +467,6 @@ pub struct StreamBackupTaskInfo { #[prost(message, optional, tag = "7")] pub security_config: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StorageBackend { #[prost(oneof = "storage_backend::Backend", tags = "1, 2, 3, 4, 5, 6, 7")] @@ -501,7 +474,6 @@ pub struct StorageBackend { } /// Nested message and enum types in `StorageBackend`. pub mod storage_backend { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Backend { #[prost(message, tag = "1")] @@ -521,20 +493,17 @@ pub mod storage_backend { } } /// Noop storage backend saves files into void. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Noop {} /// Local storage backend saves files into local disk -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Local { #[prost(string, tag = "1")] pub path: ::prost::alloc::string::String, } /// S3 storage backend saves files into S3 compatible storages /// For non-aws providers, endpoint must be provided -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct S3 { #[prost(string, tag = "1")] pub endpoint: ::prost::alloc::string::String, @@ -573,8 +542,7 @@ pub struct S3 { pub profile: ::prost::alloc::string::String, } /// GCS storage backend saves files into google cloud storage. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Gcs { #[prost(string, tag = "1")] pub endpoint: ::prost::alloc::string::String, @@ -596,8 +564,7 @@ pub struct Gcs { pub credentials_blob: ::prost::alloc::string::String, } /// The encryption algorithm must be AES256. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AzureCustomerKey { /// A Base64-encoded AES-256 encryption key value. #[prost(string, tag = "1")] @@ -607,8 +574,7 @@ pub struct AzureCustomerKey { pub encryption_key_sha256: ::prost::alloc::string::String, } /// AzureBlobStorage storage backend saves files into azure blob storage. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AzureBlobStorage { #[prost(string, tag = "1")] pub endpoint: ::prost::alloc::string::String, @@ -663,8 +629,7 @@ pub struct AzureBlobStorage { #[prost(message, optional, tag = "10")] pub encryption_key: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Bucket { #[prost(string, tag = "1")] pub endpoint: ::prost::alloc::string::String, @@ -678,7 +643,6 @@ pub struct Bucket { pub storage_class: ::prost::alloc::string::String, } /// CloudDynamic allows testing new cloud providers and new fields without changing protobuf definitions -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CloudDynamic { #[prost(message, optional, tag = "1")] @@ -693,14 +657,12 @@ pub struct CloudDynamic { >, } /// HDFS storage backend saves file into HDFS compatible storages -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Hdfs { /// a URL: hdfs:///some/path or hdfs://host:port/some/path #[prost(string, tag = "1")] pub remote: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BackupResponse { #[prost(message, optional, tag = "1")] @@ -715,15 +677,13 @@ pub struct BackupResponse { #[prost(enumeration = "super::kvrpcpb::ApiVersion", tag = "5")] pub api_version: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CleanupRequest { /// unique_id represents the unique handle of the whole backup predecure. /// it generated in prepare request and corrosponed to one specific backup. #[prost(string, tag = "1")] pub unique_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CleanupResponse { #[prost(message, optional, tag = "1")] @@ -731,14 +691,12 @@ pub struct CleanupResponse { #[prost(bool, tag = "2")] pub success: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PrepareRequest { /// whether save state to the storage. #[prost(bool, tag = "1")] pub save_to_storage: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrepareResponse { #[prost(message, optional, tag = "1")] @@ -753,10 +711,8 @@ pub struct PrepareResponse { #[prost(uint64, tag = "4")] pub collect_file_size: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CheckAdminRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckAdminResponse { #[prost(message, optional, tag = "1")] @@ -766,7 +722,6 @@ pub struct CheckAdminResponse { #[prost(bool, tag = "3")] pub has_pending_admin: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExternalStorageRestoreRequest { #[prost(message, optional, tag = "1")] @@ -778,10 +733,8 @@ pub struct ExternalStorageRestoreRequest { #[prost(uint64, tag = "4")] pub content_length: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ExternalStorageRestoreResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExternalStorageSaveRequest { #[prost(message, optional, tag = "1")] @@ -791,10 +744,8 @@ pub struct ExternalStorageSaveRequest { #[prost(uint64, tag = "3")] pub content_length: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ExternalStorageSaveResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { /// deprecated after(in) v6.3.0 TiKV cluster @@ -814,7 +765,6 @@ pub struct Metadata { pub meta_version: i32, } /// DataFileGroup is the merged file info in log-backup -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataFileGroup { /// Path of the file. @@ -837,7 +787,6 @@ pub struct DataFileGroup { #[prost(uint64, tag = "6")] pub length: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DataFileInfo { /// Checksum of the plaintext file, i.e., pre-compression, pre-encryption. @@ -923,8 +872,7 @@ pub struct DataFileInfo { super::encryptionpb::FileEncryptionInfo, >, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StreamBackupError { /// the unix epoch time (in millisecs) of the time the error reported. #[prost(uint64, tag = "1")] @@ -939,15 +887,13 @@ pub struct StreamBackupError { #[prost(uint64, tag = "4")] pub store_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Span { #[prost(uint64, tag = "1")] pub offset: u64, #[prost(uint64, tag = "2")] pub length: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SpansOfFile { #[prost(string, tag = "1")] @@ -955,7 +901,6 @@ pub struct SpansOfFile { #[prost(message, repeated, tag = "2")] pub spans: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LogFileSubcompactionMeta { /// The whole size of this subcompaction. @@ -994,7 +939,6 @@ pub struct LogFileSubcompactionMeta { } /// A subcompaction from a compaction. /// Subcompactions are actions that collect then sort key values from one region. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LogFileSubcompaction { /// The metadata of the subcompaction. @@ -1009,8 +953,7 @@ pub struct LogFileSubcompaction { pub region_meta_hints: ::prost::alloc::vec::Vec, } /// You may get region id from `LogFileSubcompactionMeta`. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionMetaHint { /// The left boundary of the region of this epoch. /// It is an byte-comparable encoded key without TS. @@ -1025,14 +968,12 @@ pub struct RegionMetaHint { } /// Batched version of `LogFileSubcompaction`. /// So we can store many subcompactions to one file, to reduce the number of file. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LogFileSubcompactions { #[prost(message, repeated, tag = "1")] pub subcompactions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LogFileCompaction { /// The selector of compaction source. /// Files contains ANY record greater than this (and less than `until_ts`) will be selected. @@ -1076,7 +1017,6 @@ pub struct LogFileCompaction { #[prost(uint64, tag = "11")] pub generated_sst_files_total_size: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MetaEdit { /// Path to the meta file. @@ -1105,8 +1045,7 @@ pub struct MetaEdit { /// When "backing up" this "restored" SST, we want to backup the original SST before any rewrite. /// But in some cases, SSTs are not restored "as is", TiKV may rewrite or truncate its /// content by the client's request. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RewrittenTableId { /// The table ID in the backup data. #[prost(int64, tag = "1")] @@ -1118,7 +1057,6 @@ pub struct RewrittenTableId { /// IngestedSSTs is created by a client that wants to put data to the cluster by `Ingest` APIs, /// these write cannot be directly recorded by log backup. The client should put a migration /// that contains the SSTs it uploaded. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IngestedSsTs { /// The table IDs rewritten during restoring. @@ -1156,7 +1094,6 @@ pub struct IngestedSsTs { } /// An extended version of `SpansOfFile`, added more metadata for the /// execution of delayed deletion. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteSpansOfFile { #[prost(string, tag = "1")] @@ -1168,7 +1105,6 @@ pub struct DeleteSpansOfFile { #[prost(uint64, tag = "3")] pub whole_file_length: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Migration { #[prost(string, tag = "5")] @@ -1211,9 +1147,9 @@ impl PrepareSnapshotBackupRequestType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PrepareSnapshotBackupRequestType::UpdateLease => "UpdateLease", - PrepareSnapshotBackupRequestType::WaitApply => "WaitApply", - PrepareSnapshotBackupRequestType::Finish => "Finish", + Self::UpdateLease => "UpdateLease", + Self::WaitApply => "WaitApply", + Self::Finish => "Finish", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1241,8 +1177,8 @@ impl PrepareSnapshotBackupEventType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PrepareSnapshotBackupEventType::WaitApplyDone => "WaitApplyDone", - PrepareSnapshotBackupEventType::UpdateLeaseResult => "UpdateLeaseResult", + Self::WaitApplyDone => "WaitApplyDone", + Self::UpdateLeaseResult => "UpdateLeaseResult", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1271,10 +1207,10 @@ impl CompressionType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - CompressionType::Unknown => "UNKNOWN", - CompressionType::Lz4 => "LZ4", - CompressionType::Snappy => "SNAPPY", - CompressionType::Zstd => "ZSTD", + Self::Unknown => "UNKNOWN", + Self::Lz4 => "LZ4", + Self::Snappy => "SNAPPY", + Self::Zstd => "ZSTD", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1309,8 +1245,8 @@ impl BackupMode { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - BackupMode::Scan => "SCAN", - BackupMode::File => "FILE", + Self::Scan => "SCAN", + Self::File => "FILE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1335,8 +1271,8 @@ impl MetaVersion { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - MetaVersion::V1 => "V1", - MetaVersion::V2 => "V2", + Self::V1 => "V1", + Self::V2 => "V2", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1361,8 +1297,8 @@ impl FileType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - FileType::Delete => "Delete", - FileType::Put => "Put", + Self::Delete => "Delete", + Self::Put => "Put", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1391,9 +1327,9 @@ impl MigrationVersion { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - MigrationVersion::M0 => "M0", - MigrationVersion::M1 => "M1", - MigrationVersion::M2 => "M2", + Self::M0 => "M0", + Self::M1 => "M1", + Self::M2 => "M2", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1408,7 +1344,13 @@ impl MigrationVersion { } /// Generated client implementations. pub mod backup_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -1428,10 +1370,10 @@ pub mod backup_client { } impl BackupClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -1449,14 +1391,14 @@ pub mod backup_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { BackupClient::new(InterceptedService::new(inner, interceptor)) } @@ -1502,12 +1444,11 @@ pub mod backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/backup.Backup/backup"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("backup.Backup", "backup")); @@ -1527,12 +1468,11 @@ pub mod backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/backup.Backup/CheckPendingAdminOp", ); @@ -1558,12 +1498,11 @@ pub mod backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/backup.Backup/PrepareSnapshotBackup", ); @@ -1585,12 +1524,11 @@ pub mod backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/backup.Backup/prepare"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("backup.Backup", "prepare")); @@ -1609,12 +1547,11 @@ pub mod backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/backup.Backup/cleanup"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("backup.Backup", "cleanup")); @@ -1624,7 +1561,13 @@ pub mod backup_client { } /// Generated client implementations. pub mod external_storage_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// ExternalStorage is a service for using a cloud backend from StorageBackend to store files. @@ -1646,10 +1589,10 @@ pub mod external_storage_client { } impl ExternalStorageClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -1667,14 +1610,14 @@ pub mod external_storage_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ExternalStorageClient::new(InterceptedService::new(inner, interceptor)) } @@ -1721,12 +1664,11 @@ pub mod external_storage_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/backup.ExternalStorage/restore", ); @@ -1747,12 +1689,11 @@ pub mod external_storage_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/backup.ExternalStorage/save", ); diff --git a/src/generated/cdcpb.rs b/src/generated/cdcpb.rs index 5d2a993f..9b47121f 100644 --- a/src/generated/cdcpb.rs +++ b/src/generated/cdcpb.rs @@ -1,28 +1,24 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Header { #[prost(uint64, tag = "1")] pub cluster_id: u64, #[prost(string, tag = "2")] pub ticdc_version: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct DuplicateRequest { #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Compatibility { #[prost(string, tag = "1")] pub required_version: ::prost::alloc::string::String, } /// ClusterIDMismatch is an error variable that /// tells people that the cluster ID of the request does not match the TiKV cluster ID. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ClusterIdMismatch { /// The current tikv cluster ID. #[prost(uint64, tag = "1")] @@ -33,14 +29,12 @@ pub struct ClusterIdMismatch { } /// Congested is an error variable that /// tells people that the TiKV-CDC is congested. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Congested { /// The region ID that triggers the congestion. #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Error { #[prost(message, optional, tag = "1")] @@ -60,16 +54,14 @@ pub struct Error { #[prost(message, optional, tag = "8")] pub congested: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TxnInfo { #[prost(uint64, tag = "1")] pub start_ts: u64, #[prost(bytes = "vec", tag = "2")] pub primary: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TxnStatus { #[prost(uint64, tag = "1")] pub start_ts: u64, @@ -80,7 +72,6 @@ pub struct TxnStatus { #[prost(bool, tag = "4")] pub is_rolled_back: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Event { #[prost(uint64, tag = "1")] @@ -94,8 +85,7 @@ pub struct Event { } /// Nested message and enum types in `Event`. pub mod event { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Row { #[prost(uint64, tag = "1")] pub start_ts: u64, @@ -149,9 +139,9 @@ pub mod event { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - OpType::Unknown => "UNKNOWN", - OpType::Put => "PUT", - OpType::Delete => "DELETE", + Self::Unknown => "UNKNOWN", + Self::Put => "PUT", + Self::Delete => "DELETE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -165,13 +155,11 @@ pub mod event { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Entries { #[prost(message, repeated, tag = "1")] pub entries: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Admin { #[prost(message, optional, tag = "1")] @@ -183,7 +171,6 @@ pub mod event { super::super::raft_cmdpb::AdminResponse, >, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LongTxn { #[prost(message, repeated, tag = "1")] @@ -216,12 +203,12 @@ pub mod event { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - LogType::Unknown => "UNKNOWN", - LogType::Prewrite => "PREWRITE", - LogType::Commit => "COMMIT", - LogType::Rollback => "ROLLBACK", - LogType::Committed => "COMMITTED", - LogType::Initialized => "INITIALIZED", + Self::Unknown => "UNKNOWN", + Self::Prewrite => "PREWRITE", + Self::Commit => "COMMIT", + Self::Rollback => "ROLLBACK", + Self::Committed => "COMMITTED", + Self::Initialized => "INITIALIZED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -237,7 +224,6 @@ pub mod event { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { #[prost(message, tag = "3")] @@ -246,6 +232,7 @@ pub mod event { Admin(Admin), #[prost(message, tag = "5")] Error(super::Error), + #[deprecated] #[prost(uint64, tag = "6")] ResolvedTs(u64), /// Note that field 7 is taken by request_id. @@ -256,7 +243,6 @@ pub mod event { } } /// NOTE: events and resolved_ts won't appear simultaneously in one ChangeDataEvent. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangeDataEvent { #[prost(message, repeated, tag = "1")] @@ -265,8 +251,7 @@ pub struct ChangeDataEvent { #[prost(message, optional, tag = "2")] pub resolved_ts: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResolvedTs { #[prost(uint64, repeated, tag = "1")] pub regions: ::prost::alloc::vec::Vec, @@ -275,7 +260,6 @@ pub struct ResolvedTs { #[prost(uint64, tag = "3")] pub request_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangeDataRequest { #[prost(message, optional, tag = "1")] @@ -307,13 +291,10 @@ pub struct ChangeDataRequest { } /// Nested message and enum types in `ChangeDataRequest`. pub mod change_data_request { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Register {} - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Deregister {} - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NotifyTxnStatus { #[prost(message, repeated, tag = "1")] @@ -345,9 +326,9 @@ pub mod change_data_request { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - KvApi::TiDb => "TiDB", - KvApi::RawKv => "RawKV", - KvApi::TxnKv => "TxnKV", + Self::TiDb => "TiDB", + Self::RawKv => "RawKV", + Self::TxnKv => "TxnKV", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -360,7 +341,6 @@ pub mod change_data_request { } } } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Request { /// A normal request that trying to register change data feed on a region. @@ -376,7 +356,13 @@ pub mod change_data_request { } /// Generated client implementations. pub mod change_data_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -396,10 +382,10 @@ pub mod change_data_client { } impl ChangeDataClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -417,14 +403,14 @@ pub mod change_data_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ChangeDataClient::new(InterceptedService::new(inner, interceptor)) } @@ -470,12 +456,11 @@ pub mod change_data_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cdcpb.ChangeData/EventFeed", ); @@ -500,12 +485,11 @@ pub mod change_data_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/cdcpb.ChangeData/EventFeedV2", ); diff --git a/src/generated/configpb.rs b/src/generated/configpb.rs index 58f3c345..1852ff10 100644 --- a/src/generated/configpb.rs +++ b/src/generated/configpb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Status { #[prost(enumeration = "StatusCode", tag = "1")] pub code: i32, @@ -13,36 +12,31 @@ pub struct Status { /// which can be shared, each kind of component only have one. /// For local version, every component will have one to represent /// the version of these configuration which cannot be shared. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Version { #[prost(uint64, tag = "1")] pub local: u64, #[prost(uint64, tag = "2")] pub global: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Local { #[prost(string, tag = "1")] pub component_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Global { #[prost(string, tag = "1")] pub component: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ConfigKind { #[prost(oneof = "config_kind::Kind", tags = "1, 2")] pub kind: ::core::option::Option, } /// Nested message and enum types in `ConfigKind`. pub mod config_kind { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Kind { #[prost(message, tag = "1")] Local(super::Local), @@ -50,16 +44,14 @@ pub mod config_kind { Global(super::Global), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ConfigEntry { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LocalConfig { #[prost(message, optional, tag = "1")] pub version: ::core::option::Option, @@ -70,14 +62,12 @@ pub struct LocalConfig { #[prost(string, tag = "4")] pub config: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Header { #[prost(uint64, tag = "1")] pub cluster_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CreateRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, @@ -90,8 +80,7 @@ pub struct CreateRequest { #[prost(string, tag = "5")] pub config: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CreateResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, @@ -102,13 +91,11 @@ pub struct CreateResponse { #[prost(string, tag = "4")] pub config: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAllRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAllResponse { #[prost(message, optional, tag = "1")] @@ -118,8 +105,7 @@ pub struct GetAllResponse { #[prost(message, repeated, tag = "3")] pub local_configs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, @@ -130,8 +116,7 @@ pub struct GetRequest { #[prost(string, tag = "4")] pub component_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, @@ -142,7 +127,6 @@ pub struct GetResponse { #[prost(string, tag = "4")] pub config: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateRequest { #[prost(message, optional, tag = "1")] @@ -154,8 +138,7 @@ pub struct UpdateRequest { #[prost(message, repeated, tag = "4")] pub entries: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, @@ -166,8 +149,7 @@ pub struct UpdateResponse { #[prost(string, tag = "4")] pub config: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, @@ -176,8 +158,7 @@ pub struct DeleteRequest { #[prost(message, optional, tag = "3")] pub kind: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, @@ -203,12 +184,12 @@ impl StatusCode { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - StatusCode::Unknown => "UNKNOWN", - StatusCode::Ok => "OK", - StatusCode::WrongVersion => "WRONG_VERSION", - StatusCode::NotChange => "NOT_CHANGE", - StatusCode::ComponentNotFound => "COMPONENT_NOT_FOUND", - StatusCode::ComponentIdNotFound => "COMPONENT_ID_NOT_FOUND", + Self::Unknown => "UNKNOWN", + Self::Ok => "OK", + Self::WrongVersion => "WRONG_VERSION", + Self::NotChange => "NOT_CHANGE", + Self::ComponentNotFound => "COMPONENT_NOT_FOUND", + Self::ComponentIdNotFound => "COMPONENT_ID_NOT_FOUND", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -226,7 +207,13 @@ impl StatusCode { } /// Generated client implementations. pub mod config_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -246,10 +233,10 @@ pub mod config_client { } impl ConfigClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -267,14 +254,14 @@ pub mod config_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ConfigClient::new(InterceptedService::new(inner, interceptor)) } @@ -317,12 +304,11 @@ pub mod config_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/configpb.Config/Create"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("configpb.Config", "Create")); @@ -336,12 +322,11 @@ pub mod config_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/configpb.Config/GetAll"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("configpb.Config", "GetAll")); @@ -355,12 +340,11 @@ pub mod config_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/configpb.Config/Get"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("configpb.Config", "Get")); @@ -374,12 +358,11 @@ pub mod config_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/configpb.Config/Update"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("configpb.Config", "Update")); @@ -393,12 +376,11 @@ pub mod config_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/configpb.Config/Delete"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("configpb.Config", "Delete")); diff --git a/src/generated/coprocessor.rs b/src/generated/coprocessor.rs index 16676352..fdf7a84a 100644 --- a/src/generated/coprocessor.rs +++ b/src/generated/coprocessor.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// \[start, end) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyRange { #[prost(bytes = "vec", tag = "1")] pub start: ::prost::alloc::vec::Vec, @@ -10,15 +9,13 @@ pub struct KeyRange { } /// KeyRange with an attached read_ts (version). /// It is used by TiCI versioned lookup. Callers must ensure `range` is a point range. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct VersionedKeyRange { #[prost(message, optional, tag = "1")] pub range: ::core::option::Option, #[prost(uint64, tag = "2")] pub read_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Request { #[prost(message, optional, tag = "1")] @@ -82,7 +79,6 @@ pub struct Request { #[prost(uint64, tag = "17")] pub paging_size_bytes: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Response { #[prost(bytes = "vec", tag = "1")] @@ -117,7 +113,6 @@ pub struct Response { #[prost(message, repeated, tag = "13")] pub batch_responses: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionInfo { #[prost(uint64, tag = "1")] @@ -127,7 +122,6 @@ pub struct RegionInfo { #[prost(message, repeated, tag = "3")] pub ranges: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ShardInfo { #[prost(uint64, tag = "1")] @@ -137,7 +131,6 @@ pub struct ShardInfo { #[prost(message, repeated, tag = "3")] pub ranges: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TableShardInfos { /// The executor ID is used to identify the tici executor. @@ -147,7 +140,6 @@ pub struct TableShardInfos { #[prost(message, repeated, tag = "2")] pub shard_infos: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TiCiEstimateCountRequest { #[prost(message, optional, tag = "1")] @@ -167,15 +159,13 @@ pub struct TiCiEstimateCountRequest { #[prost(message, repeated, tag = "8")] pub shard_infos: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TiCiEstimateCountResponse { #[prost(uint64, tag = "1")] pub est_count: u64, #[prost(string, tag = "2")] pub other_error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TableRegions { #[prost(int64, tag = "1")] @@ -183,7 +173,6 @@ pub struct TableRegions { #[prost(message, repeated, tag = "2")] pub regions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchRequest { #[prost(message, optional, tag = "1")] @@ -214,7 +203,6 @@ pub struct BatchRequest { #[prost(message, repeated, tag = "11")] pub table_shard_infos: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchResponse { #[prost(bytes = "vec", tag = "1")] @@ -228,7 +216,6 @@ pub struct BatchResponse { #[prost(message, repeated, tag = "5")] pub retry_shards: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreBatchTask { #[prost(uint64, tag = "1")] @@ -249,7 +236,6 @@ pub struct StoreBatchTask { #[prost(uint64, tag = "7")] pub buckets_version: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreBatchTaskResponse { #[prost(bytes = "vec", tag = "1")] @@ -265,7 +251,6 @@ pub struct StoreBatchTaskResponse { #[prost(message, optional, tag = "6")] pub exec_details_v2: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegateRequest { #[prost(message, optional, tag = "1")] @@ -283,7 +268,6 @@ pub struct DelegateRequest { #[prost(uint64, tag = "5")] pub snapshot_sequence: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegateResponse { #[prost(bytes = "vec", tag = "1")] diff --git a/src/generated/deadlock.rs b/src/generated/deadlock.rs index da4c957a..79cd42b2 100644 --- a/src/generated/deadlock.rs +++ b/src/generated/deadlock.rs @@ -1,15 +1,12 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct WaitForEntriesRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WaitForEntriesResponse { #[prost(message, repeated, tag = "1")] pub entries: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WaitForEntry { /// The transaction id that is waiting. #[prost(uint64, tag = "1")] @@ -30,8 +27,7 @@ pub struct WaitForEntry { #[prost(uint64, tag = "6")] pub wait_time: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReplaceLockByKeyItem { #[prost(uint64, tag = "1")] pub key_hash: u64, @@ -42,13 +38,11 @@ pub struct ReplaceLockByKeyItem { #[prost(uint64, tag = "4")] pub new_lock_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReplaceLocksByKeysRequest { #[prost(message, repeated, tag = "1")] pub items: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeadlockRequest { #[prost(enumeration = "DeadlockRequestType", tag = "1")] @@ -58,7 +52,6 @@ pub struct DeadlockRequest { #[prost(message, optional, tag = "3")] pub replace_locks_by_keys: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeadlockResponse { /// The same entry sent by DeadlockRequest, identifies the sender. @@ -91,9 +84,9 @@ impl DeadlockRequestType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - DeadlockRequestType::Detect => "Detect", - DeadlockRequestType::CleanUpWaitFor => "CleanUpWaitFor", - DeadlockRequestType::CleanUp => "CleanUp", + Self::Detect => "Detect", + Self::CleanUpWaitFor => "CleanUpWaitFor", + Self::CleanUp => "CleanUp", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -108,7 +101,13 @@ impl DeadlockRequestType { } /// Generated client implementations. pub mod deadlock_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -128,10 +127,10 @@ pub mod deadlock_client { } impl DeadlockClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -149,14 +148,14 @@ pub mod deadlock_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { DeadlockClient::new(InterceptedService::new(inner, interceptor)) } @@ -204,12 +203,11 @@ pub mod deadlock_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/deadlock.Deadlock/GetWaitForEntries", ); @@ -232,12 +230,11 @@ pub mod deadlock_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/deadlock.Deadlock/Detect"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("deadlock.Deadlock", "Detect")); diff --git a/src/generated/debugpb.rs b/src/generated/debugpb.rs index dbe0d3e1..032d74a3 100644 --- a/src/generated/debugpb.rs +++ b/src/generated/debugpb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRequest { #[prost(enumeration = "Db", tag = "1")] pub db: i32, @@ -9,33 +8,28 @@ pub struct GetRequest { #[prost(bytes = "vec", tag = "3")] pub key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetResponse { #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RaftLogRequest { #[prost(uint64, tag = "1")] pub region_id: u64, #[prost(uint64, tag = "2")] pub log_index: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RaftLogResponse { #[prost(message, optional, tag = "1")] pub entry: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionInfoRequest { #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionInfoResponse { #[prost(message, optional, tag = "1")] @@ -47,15 +41,13 @@ pub struct RegionInfoResponse { super::raft_serverpb::RegionLocalState, >, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionSizeRequest { #[prost(uint64, tag = "1")] pub region_id: u64, #[prost(string, repeated, tag = "2")] pub cfs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionSizeResponse { #[prost(message, repeated, tag = "1")] @@ -63,8 +55,7 @@ pub struct RegionSizeResponse { } /// Nested message and enum types in `RegionSizeResponse`. pub mod region_size_response { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Entry { #[prost(string, tag = "1")] pub cf: ::prost::alloc::string::String, @@ -72,8 +63,7 @@ pub mod region_size_response { pub size: u64, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScanMvccRequest { #[prost(bytes = "vec", tag = "1")] pub from_key: ::prost::alloc::vec::Vec, @@ -82,7 +72,6 @@ pub struct ScanMvccRequest { #[prost(uint64, tag = "3")] pub limit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScanMvccResponse { #[prost(bytes = "vec", tag = "1")] @@ -90,8 +79,7 @@ pub struct ScanMvccResponse { #[prost(message, optional, tag = "2")] pub info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactRequest { #[prost(enumeration = "Db", tag = "1")] pub db: i32, @@ -106,33 +94,26 @@ pub struct CompactRequest { #[prost(enumeration = "BottommostLevelCompaction", tag = "6")] pub bottommost_level_compaction: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct InjectFailPointRequest { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub actions: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct InjectFailPointResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RecoverFailPointRequest { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RecoverFailPointResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListFailPointsRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListFailPointsResponse { #[prost(message, repeated, tag = "1")] @@ -140,8 +121,7 @@ pub struct ListFailPointsResponse { } /// Nested message and enum types in `ListFailPointsResponse`. pub mod list_fail_points_response { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Entry { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -149,14 +129,12 @@ pub mod list_fail_points_response { pub actions: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMetricsRequest { #[prost(bool, tag = "1")] pub all: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMetricsResponse { #[prost(string, tag = "1")] pub prometheus: ::prost::alloc::string::String, @@ -169,17 +147,14 @@ pub struct GetMetricsResponse { #[prost(uint64, tag = "5")] pub store_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionConsistencyCheckRequest { #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionConsistencyCheckResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ModifyTikvConfigRequest { #[prost(enumeration = "Module", tag = "1")] pub module: i32, @@ -188,76 +163,62 @@ pub struct ModifyTikvConfigRequest { #[prost(string, tag = "3")] pub config_value: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ModifyTikvConfigResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Property { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRegionPropertiesRequest { #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetRegionPropertiesResponse { #[prost(message, repeated, tag = "1")] pub props: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetStoreInfoRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetStoreInfoResponse { #[prost(uint64, tag = "1")] pub store_id: u64, #[prost(enumeration = "super::kvrpcpb::ApiVersion", tag = "2")] pub api_version: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetClusterInfoRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetClusterInfoResponse { #[prost(uint64, tag = "1")] pub cluster_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAllRegionsInStoreRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAllRegionsInStoreResponse { #[prost(uint64, repeated, tag = "1")] pub regions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResetToVersionRequest { #[prost(uint64, tag = "1")] pub ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResetToVersionResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRangePropertiesRequest { #[prost(bytes = "vec", tag = "1")] pub start_key: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "2")] pub end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetRangePropertiesResponse { #[prost(message, repeated, tag = "1")] @@ -267,8 +228,7 @@ pub struct GetRangePropertiesResponse { } /// Nested message and enum types in `GetRangePropertiesResponse`. pub mod get_range_properties_response { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RangeProperty { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, @@ -276,7 +236,6 @@ pub mod get_range_properties_response { pub value: ::prost::alloc::string::String, } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlashbackToVersionRequest { #[prost(message, optional, tag = "1")] @@ -294,14 +253,12 @@ pub struct FlashbackToVersionRequest { #[prost(uint64, tag = "7")] pub commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlashbackToVersionResponse { #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRegionReadProgressRequest { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -312,8 +269,7 @@ pub struct GetRegionReadProgressRequest { #[prost(uint64, tag = "3")] pub min_start_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRegionReadProgressResponse { /// below are from region_read_progress module #[prost(uint64, tag = "1")] @@ -372,9 +328,9 @@ impl Db { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Db::Invalid => "INVALID", - Db::Kv => "KV", - Db::Raft => "RAFT", + Self::Invalid => "INVALID", + Self::Kv => "KV", + Self::Raft => "RAFT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -409,17 +365,17 @@ impl Module { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Module::Unused => "UNUSED", - Module::Kvdb => "KVDB", - Module::Raftdb => "RAFTDB", - Module::Readpool => "READPOOL", - Module::Server => "SERVER", - Module::Storage => "STORAGE", - Module::Pd => "PD", - Module::Metric => "METRIC", - Module::Coprocessor => "COPROCESSOR", - Module::Security => "SECURITY", - Module::Import => "IMPORT", + Self::Unused => "UNUSED", + Self::Kvdb => "KVDB", + Self::Raftdb => "RAFTDB", + Self::Readpool => "READPOOL", + Self::Server => "SERVER", + Self::Storage => "STORAGE", + Self::Pd => "PD", + Self::Metric => "METRIC", + Self::Coprocessor => "COPROCESSOR", + Self::Security => "SECURITY", + Self::Import => "IMPORT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -457,9 +413,9 @@ impl BottommostLevelCompaction { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - BottommostLevelCompaction::Skip => "Skip", - BottommostLevelCompaction::Force => "Force", - BottommostLevelCompaction::IfHaveCompactionFilter => "IfHaveCompactionFilter", + Self::Skip => "Skip", + Self::Force => "Force", + Self::IfHaveCompactionFilter => "IfHaveCompactionFilter", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -474,7 +430,13 @@ impl BottommostLevelCompaction { } /// Generated client implementations. pub mod debug_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Debug service for TiKV. @@ -504,10 +466,10 @@ pub mod debug_client { } impl DebugClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -525,14 +487,14 @@ pub mod debug_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { DebugClient::new(InterceptedService::new(inner, interceptor)) } @@ -577,12 +539,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/debugpb.Debug/Get"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("debugpb.Debug", "Get")); @@ -600,12 +561,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/debugpb.Debug/RaftLog"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("debugpb.Debug", "RaftLog")); @@ -622,12 +582,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/debugpb.Debug/RegionInfo"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("debugpb.Debug", "RegionInfo")); @@ -646,12 +605,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/debugpb.Debug/RegionSize"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("debugpb.Debug", "RegionSize")); @@ -671,12 +629,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/debugpb.Debug/ScanMvcc"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("debugpb.Debug", "ScanMvcc")); @@ -695,12 +652,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/debugpb.Debug/Compact"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("debugpb.Debug", "Compact")); @@ -719,12 +675,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/InjectFailPoint", ); @@ -745,12 +700,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/RecoverFailPoint", ); @@ -771,12 +725,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/ListFailPoints", ); @@ -797,12 +750,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/debugpb.Debug/GetMetrics"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("debugpb.Debug", "GetMetrics")); @@ -820,12 +772,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/CheckRegionConsistency", ); @@ -846,12 +797,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/ModifyTikvConfig", ); @@ -872,12 +822,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/GetRegionProperties", ); @@ -898,12 +847,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/GetStoreInfo", ); @@ -924,12 +872,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/GetClusterInfo", ); @@ -950,12 +897,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/GetAllRegionsInStore", ); @@ -976,12 +922,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/ResetToVersion", ); @@ -1002,12 +947,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/GetRangeProperties", ); @@ -1028,12 +972,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/FlashbackToVersion", ); @@ -1054,12 +997,11 @@ pub mod debug_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/debugpb.Debug/GetRegionReadProgress", ); diff --git a/src/generated/diagnosticspb.rs b/src/generated/diagnosticspb.rs index edb1dd45..8ae09183 100644 --- a/src/generated/diagnosticspb.rs +++ b/src/generated/diagnosticspb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SearchLogRequest { #[prost(int64, tag = "1")] pub start_time: i64, @@ -41,8 +40,8 @@ pub mod search_log_request { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Target::Normal => "Normal", - Target::Slow => "Slow", + Self::Normal => "Normal", + Self::Slow => "Slow", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -55,14 +54,12 @@ pub mod search_log_request { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SearchLogResponse { #[prost(message, repeated, tag = "1")] pub messages: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LogMessage { #[prost(int64, tag = "1")] pub time: i64, @@ -71,21 +68,18 @@ pub struct LogMessage { #[prost(string, tag = "3")] pub message: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ServerInfoRequest { #[prost(enumeration = "ServerInfoType", tag = "1")] pub tp: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ServerInfoPair { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ServerInfoItem { /// cpu, memory, disk, network ... @@ -106,7 +100,6 @@ pub struct ServerInfoItem { #[prost(message, repeated, tag = "3")] pub pairs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ServerInfoResponse { #[prost(message, repeated, tag = "1")] @@ -130,13 +123,13 @@ impl LogLevel { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - LogLevel::Unknown => "UNKNOWN", - LogLevel::Debug => "Debug", - LogLevel::Info => "Info", - LogLevel::Warn => "Warn", - LogLevel::Trace => "Trace", - LogLevel::Critical => "Critical", - LogLevel::Error => "Error", + Self::Unknown => "UNKNOWN", + Self::Debug => "Debug", + Self::Info => "Info", + Self::Warn => "Warn", + Self::Trace => "Trace", + Self::Critical => "Critical", + Self::Error => "Error", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -168,10 +161,10 @@ impl ServerInfoType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ServerInfoType::All => "All", - ServerInfoType::HardwareInfo => "HardwareInfo", - ServerInfoType::SystemInfo => "SystemInfo", - ServerInfoType::LoadInfo => "LoadInfo", + Self::All => "All", + Self::HardwareInfo => "HardwareInfo", + Self::SystemInfo => "SystemInfo", + Self::LoadInfo => "LoadInfo", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -187,7 +180,13 @@ impl ServerInfoType { } /// Generated client implementations. pub mod diagnostics_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Diagnostics service for TiDB cluster components. @@ -208,10 +207,10 @@ pub mod diagnostics_client { } impl DiagnosticsClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -229,14 +228,14 @@ pub mod diagnostics_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { DiagnosticsClient::new(InterceptedService::new(inner, interceptor)) } @@ -283,12 +282,11 @@ pub mod diagnostics_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/diagnosticspb.Diagnostics/search_log", ); @@ -309,12 +307,11 @@ pub mod diagnostics_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/diagnosticspb.Diagnostics/server_info", ); diff --git a/src/generated/disaggregated.rs b/src/generated/disaggregated.rs index 0b24ba7a..215f6fb4 100644 --- a/src/generated/disaggregated.rs +++ b/src/generated/disaggregated.rs @@ -1,14 +1,12 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct S3LockResult { #[prost(oneof = "s3_lock_result::Error", tags = "1, 2, 3")] pub error: ::core::option::Option, } /// Nested message and enum types in `S3LockResult`. pub mod s3_lock_result { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Error { #[prost(message, tag = "1")] Success(super::Success), @@ -18,24 +16,20 @@ pub mod s3_lock_result { Conflict(super::Conflict), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Success {} /// Error caused by S3GC owner changed /// client should retry -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct NotOwner {} /// Error caused by concurrency conflict, /// request cancel -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Conflict { #[prost(string, tag = "1")] pub reason: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TryAddLockRequest { /// The data file key to add lock #[prost(bytes = "vec", tag = "1")] @@ -47,30 +41,25 @@ pub struct TryAddLockRequest { #[prost(uint64, tag = "4")] pub lock_seq: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TryAddLockResponse { #[prost(message, optional, tag = "1")] pub result: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TryMarkDeleteRequest { /// The data file key to be marked as deleted #[prost(bytes = "vec", tag = "1")] pub data_file_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TryMarkDeleteResponse { #[prost(message, optional, tag = "1")] pub result: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetDisaggConfigRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DisaggS3Config { #[prost(string, tag = "1")] pub bucket: ::prost::alloc::string::String, @@ -79,14 +68,12 @@ pub struct DisaggS3Config { #[prost(string, tag = "3")] pub endpoint: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetDisaggConfigResponse { #[prost(message, optional, tag = "1")] pub s3_config: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DisaggTaskMeta { /// start ts of a query #[prost(uint64, tag = "1")] @@ -124,15 +111,13 @@ pub struct DisaggTaskMeta { #[prost(string, tag = "11")] pub connection_alias: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DisaggReadError { #[prost(int32, tag = "1")] pub code: i32, #[prost(string, tag = "2")] pub msg: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EstablishDisaggTaskError { #[prost(oneof = "establish_disagg_task_error::Errors", tags = "1, 2, 99")] @@ -140,7 +125,6 @@ pub struct EstablishDisaggTaskError { } /// Nested message and enum types in `EstablishDisaggTaskError`. pub mod establish_disagg_task_error { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Errors { #[prost(message, tag = "1")] @@ -151,8 +135,7 @@ pub mod establish_disagg_task_error { ErrorOther(super::ErrorOther), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ErrorRegion { #[prost(string, tag = "1")] pub msg: ::prost::alloc::string::String, @@ -160,7 +143,6 @@ pub struct ErrorRegion { #[prost(uint64, repeated, tag = "2")] pub region_ids: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ErrorLocked { #[prost(string, tag = "1")] @@ -169,15 +151,13 @@ pub struct ErrorLocked { #[prost(message, repeated, tag = "2")] pub locked: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ErrorOther { #[prost(int32, tag = "1")] pub code: i32, #[prost(string, tag = "2")] pub msg: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EstablishDisaggTaskRequest { #[prost(message, optional, tag = "1")] @@ -202,7 +182,6 @@ pub struct EstablishDisaggTaskRequest { #[prost(bytes = "vec", tag = "7")] pub encoded_plan: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EstablishDisaggTaskResponse { #[prost(message, optional, tag = "1")] @@ -221,17 +200,14 @@ pub struct EstablishDisaggTaskResponse { #[prost(bytes = "vec", repeated, tag = "5")] pub tables: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CancelDisaggTaskRequest { #[prost(message, optional, tag = "1")] pub meta: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CancelDisaggTaskResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct FetchDisaggPagesRequest { /// The snapshot id to fetch pages #[prost(message, optional, tag = "1")] @@ -245,8 +221,7 @@ pub struct FetchDisaggPagesRequest { #[prost(uint64, repeated, tag = "4")] pub page_ids: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PagesPacket { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, diff --git a/src/generated/disk_usage.rs b/src/generated/disk_usage.rs index 4b2c1fc5..f905514b 100644 --- a/src/generated/disk_usage.rs +++ b/src/generated/disk_usage.rs @@ -13,9 +13,9 @@ impl DiskUsage { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - DiskUsage::Normal => "Normal", - DiskUsage::AlmostFull => "AlmostFull", - DiskUsage::AlreadyFull => "AlreadyFull", + Self::Normal => "Normal", + Self::AlmostFull => "AlmostFull", + Self::AlreadyFull => "AlreadyFull", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/encryptionpb.rs b/src/generated/encryptionpb.rs index 6a944b9d..62753fb0 100644 --- a/src/generated/encryptionpb.rs +++ b/src/generated/encryptionpb.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// General encryption metadata for any data type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct EncryptionMeta { /// ID of the key used to encrypt the data. #[prost(uint64, tag = "1")] @@ -11,8 +10,7 @@ pub struct EncryptionMeta { pub iv: ::prost::alloc::vec::Vec, } /// Information about an encrypted file. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct FileInfo { /// ID of the key used to encrypt the file. #[prost(uint64, tag = "1")] @@ -24,7 +22,6 @@ pub struct FileInfo { #[prost(enumeration = "EncryptionMethod", tag = "3")] pub method: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileDictionary { /// A map of file name to file info. @@ -32,8 +29,7 @@ pub struct FileDictionary { pub files: ::std::collections::HashMap<::prost::alloc::string::String, FileInfo>, } /// The key used to encrypt the user data. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DataKey { /// A sequence of secret bytes used to encrypt data. #[prost(bytes = "vec", tag = "1")] @@ -48,7 +44,6 @@ pub struct DataKey { #[prost(bool, tag = "4")] pub was_exposed: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyDictionary { /// A map of key ID to dat key. @@ -59,16 +54,14 @@ pub struct KeyDictionary { pub current_key_id: u64, } /// Master key config. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MasterKey { #[prost(oneof = "master_key::Backend", tags = "1, 2, 3")] pub backend: ::core::option::Option, } /// Nested message and enum types in `MasterKey`. pub mod master_key { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Backend { #[prost(message, tag = "1")] Plaintext(super::MasterKeyPlaintext), @@ -79,13 +72,11 @@ pub mod master_key { } } /// MasterKeyPlaintext indicates content is stored as plaintext. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct MasterKeyPlaintext {} /// MasterKeyFile is a master key backed by a file containing encryption key in human-readable /// hex format. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MasterKeyFile { /// Local file path. #[prost(string, tag = "1")] @@ -93,8 +84,7 @@ pub struct MasterKeyFile { } /// MasterKeyKms is a master key backed by KMS service that manages the encryption key, /// and provide API to encrypt and decrypt a data key, which is used to encrypt the content. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MasterKeyKms { /// KMS vendor. #[prost(string, tag = "1")] @@ -118,8 +108,7 @@ pub struct MasterKeyKms { #[prost(message, optional, tag = "7")] pub aws_kms: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AzureKms { #[prost(string, tag = "1")] pub tenant_id: ::prost::alloc::string::String, @@ -142,21 +131,18 @@ pub struct AzureKms { #[prost(string, tag = "9")] pub client_certificate_password: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GcpKms { #[prost(string, tag = "1")] pub credential: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AwsKms { #[prost(string, tag = "1")] pub access_key: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub secret_access_key: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EncryptedContent { /// Metadata of the encrypted content. @@ -181,7 +167,6 @@ pub struct EncryptedContent { #[prost(bytes = "vec", tag = "5")] pub ciphertext_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileEncryptionInfo { /// file encryption method @@ -198,7 +183,6 @@ pub struct FileEncryptionInfo { } /// Nested message and enum types in `FileEncryptionInfo`. pub mod file_encryption_info { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Mode { #[prost(message, tag = "1")] @@ -209,10 +193,8 @@ pub mod file_encryption_info { } /// not recommended in production. /// user needs to pass back the same data key for restore. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PlainTextDataKey {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MasterKeyBased { /// encrypted data key with metadata @@ -236,12 +218,12 @@ impl EncryptionMethod { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - EncryptionMethod::Unknown => "UNKNOWN", - EncryptionMethod::Plaintext => "PLAINTEXT", - EncryptionMethod::Aes128Ctr => "AES128_CTR", - EncryptionMethod::Aes192Ctr => "AES192_CTR", - EncryptionMethod::Aes256Ctr => "AES256_CTR", - EncryptionMethod::Sm4Ctr => "SM4_CTR", + Self::Unknown => "UNKNOWN", + Self::Plaintext => "PLAINTEXT", + Self::Aes128Ctr => "AES128_CTR", + Self::Aes192Ctr => "AES192_CTR", + Self::Aes256Ctr => "AES256_CTR", + Self::Sm4Ctr => "SM4_CTR", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/enginepb.rs b/src/generated/enginepb.rs index b0841074..ca4d8374 100644 --- a/src/generated/enginepb.rs +++ b/src/generated/enginepb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CommandRequestHeader { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -18,7 +17,6 @@ pub struct CommandRequestHeader { #[prost(bytes = "vec", tag = "6")] pub context: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandRequest { #[prost(message, optional, tag = "1")] @@ -33,14 +31,12 @@ pub struct CommandRequest { #[prost(message, optional, tag = "4")] pub admin_response: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandRequestBatch { #[prost(message, repeated, tag = "1")] pub requests: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CommandResponseHeader { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -48,8 +44,7 @@ pub struct CommandResponseHeader { #[prost(bool, tag = "2")] pub destroyed: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CommandResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -58,13 +53,11 @@ pub struct CommandResponse { #[prost(uint64, tag = "3")] pub applied_term: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandResponseBatch { #[prost(message, repeated, tag = "1")] pub responses: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotState { #[prost(message, optional, tag = "1")] @@ -74,7 +67,6 @@ pub struct SnapshotState { #[prost(message, optional, tag = "3")] pub apply_state: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotData { #[prost(string, tag = "1")] @@ -84,7 +76,6 @@ pub struct SnapshotData { #[prost(message, repeated, tag = "3")] pub data: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotRequest { #[prost(oneof = "snapshot_request::Chunk", tags = "1, 2")] @@ -92,7 +83,6 @@ pub struct SnapshotRequest { } /// Nested message and enum types in `SnapshotRequest`. pub mod snapshot_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Chunk { /// The first message for snapshots. @@ -104,12 +94,17 @@ pub mod snapshot_request { Data(super::SnapshotData), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SnapshotDone {} /// Generated client implementations. pub mod engine_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -129,10 +124,10 @@ pub mod engine_client { } impl EngineClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -150,14 +145,14 @@ pub mod engine_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { EngineClient::new(InterceptedService::new(inner, interceptor)) } @@ -205,12 +200,11 @@ pub mod engine_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/enginepb.Engine/ApplyCommandBatch", ); @@ -227,12 +221,11 @@ pub mod engine_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/enginepb.Engine/ApplySnapshot", ); diff --git a/src/generated/eraftpb.rs b/src/generated/eraftpb.rs index 6724cb25..3bea03e1 100644 --- a/src/generated/eraftpb.rs +++ b/src/generated/eraftpb.rs @@ -9,8 +9,7 @@ /// For configuration changes, the data will contain the ConfChange message and the /// context will provide anything needed to assist the configuration change. The context /// if for the user to set and use in this case. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Entry { #[prost(enumeration = "EntryType", tag = "1")] pub entry_type: i32, @@ -27,8 +26,7 @@ pub struct Entry { #[prost(bool, tag = "5")] pub sync_log: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SnapshotMetadata { /// The current `ConfState`. #[prost(message, optional, tag = "1")] @@ -40,15 +38,13 @@ pub struct SnapshotMetadata { #[prost(uint64, tag = "3")] pub term: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Snapshot { #[prost(bytes = "vec", tag = "1")] pub data: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] pub metadata: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Message { #[prost(enumeration = "MessageType", tag = "1")] @@ -87,8 +83,7 @@ pub struct Message { #[prost(int64, tag = "15")] pub priority: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct HardState { #[prost(uint64, tag = "1")] pub term: u64, @@ -97,8 +92,7 @@ pub struct HardState { #[prost(uint64, tag = "3")] pub commit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ConfState { #[prost(uint64, repeated, tag = "1")] pub voters: ::prost::alloc::vec::Vec, @@ -117,8 +111,7 @@ pub struct ConfState { #[prost(bool, tag = "5")] pub auto_leave: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ConfChange { #[prost(enumeration = "ConfChangeType", tag = "2")] pub change_type: i32, @@ -131,8 +124,7 @@ pub struct ConfChange { } /// ConfChangeSingle is an individual configuration change operation. Multiple /// such operations can be carried out atomically via a ConfChangeV2. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ConfChangeSingle { #[prost(enumeration = "ConfChangeType", tag = "1")] pub change_type: i32, @@ -171,7 +163,6 @@ pub struct ConfChangeSingle { /// For details on Raft membership changes, see: /// /// \[1\]: -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConfChangeV2 { #[prost(enumeration = "ConfChangeTransition", tag = "1")] @@ -195,9 +186,9 @@ impl EntryType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - EntryType::EntryNormal => "EntryNormal", - EntryType::EntryConfChange => "EntryConfChange", - EntryType::EntryConfChangeV2 => "EntryConfChangeV2", + Self::EntryNormal => "EntryNormal", + Self::EntryConfChange => "EntryConfChange", + Self::EntryConfChangeV2 => "EntryConfChangeV2", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -240,25 +231,25 @@ impl MessageType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - MessageType::MsgHup => "MsgHup", - MessageType::MsgBeat => "MsgBeat", - MessageType::MsgPropose => "MsgPropose", - MessageType::MsgAppend => "MsgAppend", - MessageType::MsgAppendResponse => "MsgAppendResponse", - MessageType::MsgRequestVote => "MsgRequestVote", - MessageType::MsgRequestVoteResponse => "MsgRequestVoteResponse", - MessageType::MsgSnapshot => "MsgSnapshot", - MessageType::MsgHeartbeat => "MsgHeartbeat", - MessageType::MsgHeartbeatResponse => "MsgHeartbeatResponse", - MessageType::MsgUnreachable => "MsgUnreachable", - MessageType::MsgSnapStatus => "MsgSnapStatus", - MessageType::MsgCheckQuorum => "MsgCheckQuorum", - MessageType::MsgTransferLeader => "MsgTransferLeader", - MessageType::MsgTimeoutNow => "MsgTimeoutNow", - MessageType::MsgReadIndex => "MsgReadIndex", - MessageType::MsgReadIndexResp => "MsgReadIndexResp", - MessageType::MsgRequestPreVote => "MsgRequestPreVote", - MessageType::MsgRequestPreVoteResponse => "MsgRequestPreVoteResponse", + Self::MsgHup => "MsgHup", + Self::MsgBeat => "MsgBeat", + Self::MsgPropose => "MsgPropose", + Self::MsgAppend => "MsgAppend", + Self::MsgAppendResponse => "MsgAppendResponse", + Self::MsgRequestVote => "MsgRequestVote", + Self::MsgRequestVoteResponse => "MsgRequestVoteResponse", + Self::MsgSnapshot => "MsgSnapshot", + Self::MsgHeartbeat => "MsgHeartbeat", + Self::MsgHeartbeatResponse => "MsgHeartbeatResponse", + Self::MsgUnreachable => "MsgUnreachable", + Self::MsgSnapStatus => "MsgSnapStatus", + Self::MsgCheckQuorum => "MsgCheckQuorum", + Self::MsgTransferLeader => "MsgTransferLeader", + Self::MsgTimeoutNow => "MsgTimeoutNow", + Self::MsgReadIndex => "MsgReadIndex", + Self::MsgReadIndexResp => "MsgReadIndexResp", + Self::MsgRequestPreVote => "MsgRequestPreVote", + Self::MsgRequestPreVoteResponse => "MsgRequestPreVoteResponse", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -313,9 +304,9 @@ impl ConfChangeTransition { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ConfChangeTransition::Auto => "Auto", - ConfChangeTransition::Implicit => "Implicit", - ConfChangeTransition::Explicit => "Explicit", + Self::Auto => "Auto", + Self::Implicit => "Implicit", + Self::Explicit => "Explicit", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -342,9 +333,9 @@ impl ConfChangeType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ConfChangeType::AddNode => "AddNode", - ConfChangeType::RemoveNode => "RemoveNode", - ConfChangeType::AddLearnerNode => "AddLearnerNode", + Self::AddNode => "AddNode", + Self::RemoveNode => "RemoveNode", + Self::AddLearnerNode => "AddLearnerNode", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/errorpb.rs b/src/generated/errorpb.rs index ddba0b60..1781e746 100644 --- a/src/generated/errorpb.rs +++ b/src/generated/errorpb.rs @@ -1,8 +1,7 @@ // This file is @generated by prost-build. /// NotLeader is the error variant that tells a request be handle by raft leader /// is sent to raft follower or learner. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct NotLeader { /// The requested region ID #[prost(uint64, tag = "1")] @@ -13,8 +12,7 @@ pub struct NotLeader { } /// IsWitness is the error variant that tells a request be handle by witness /// which should be forbidden and retry. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct IsWitness { /// The requested region ID #[prost(uint64, tag = "1")] @@ -22,16 +20,14 @@ pub struct IsWitness { } /// BucketVersionNotMatch is the error variant that tells the request buckets version is not match. /// client should update the buckets version and retry. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct BucketVersionNotMatch { #[prost(uint64, tag = "1")] pub version: u64, #[prost(bytes = "vec", repeated, tag = "2")] pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DiskFull { /// The requested store ID #[prost(uint64, repeated, tag = "1")] @@ -42,8 +38,7 @@ pub struct DiskFull { } /// StoreNotMatch is the error variant that tells the request is sent to wrong store. /// (i.e. inconsistency of the store ID that request shows and the real store ID of this server.) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreNotMatch { /// Store id in request #[prost(uint64, tag = "1")] @@ -54,8 +49,7 @@ pub struct StoreNotMatch { } /// RegionNotFound is the error variant that tells there isn't any region in this TiKV /// matches the requested region ID. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionNotFound { /// The requested region ID #[prost(uint64, tag = "1")] @@ -63,8 +57,7 @@ pub struct RegionNotFound { } /// RegionNotInitialized is the error variant that tells there isn't any initialized peer /// matchesthe request region ID. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionNotInitialized { /// The request region ID #[prost(uint64, tag = "1")] @@ -72,8 +65,7 @@ pub struct RegionNotInitialized { } /// KeyNotInRegion is the error variant that tells the key the request requires isn't present in /// this region. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyNotInRegion { /// The requested key #[prost(bytes = "vec", tag = "1")] @@ -91,7 +83,6 @@ pub struct KeyNotInRegion { /// EpochNotMatch is the error variant that tells a region has been updated. /// (e.g. by splitting / merging, or raft Confchange.) /// Hence, a command is based on a stale version of a region. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EpochNotMatch { /// Available regions that may be siblings of the requested one. @@ -99,8 +90,7 @@ pub struct EpochNotMatch { pub current_regions: ::prost::alloc::vec::Vec, } /// ServerIsBusy is the error variant that tells the server is too busy to response. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ServerIsBusy { #[prost(string, tag = "1")] pub reason: ::prost::alloc::string::String, @@ -116,14 +106,12 @@ pub struct ServerIsBusy { /// StaleCommand is the error variant that tells the command is stale, that is, /// the current request term is lower than current raft term. /// This can be retried at most time. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StaleCommand {} /// RaftEntryTooLarge is the error variant that tells the request is too large to be serialized to a /// reasonable small raft entry. /// (i.e. greater than the configured value `raft_entry_max_size` in `raftstore`) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RaftEntryTooLarge { /// The requested region ID #[prost(uint64, tag = "1")] @@ -136,15 +124,13 @@ pub struct RaftEntryTooLarge { /// updating the max timestamp in the concurrency manager from PD TSO is ongoing. In this case, /// the prewrite of an async commit transaction cannot succeed. The client can backoff and /// resend the request. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct MaxTimestampNotSynced {} /// ReadIndexNotReady is the error variant that tells the read index request is not ready, that is, /// the current region is in a status that not ready to serve the read index request. For example, /// region is in splitting or merging status. /// This can be retried at most time. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReadIndexNotReady { /// The reason why the region is not ready to serve read index request #[prost(string, tag = "1")] @@ -156,15 +142,13 @@ pub struct ReadIndexNotReady { /// ProposalInMergingMode is the error variant that tells the proposal is rejected because raft is /// in the merging mode. This may happen when BR/Lightning try to ingest SST. /// This can be retried at most time. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ProposalInMergingMode { /// The requested region ID #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct DataIsNotReady { /// The requested region ID #[prost(uint64, tag = "1")] @@ -174,15 +158,13 @@ pub struct DataIsNotReady { #[prost(uint64, tag = "3")] pub safe_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RecoveryInProgress { /// The requested region ID #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlashbackInProgress { /// The requested region ID #[prost(uint64, tag = "1")] @@ -190,8 +172,7 @@ pub struct FlashbackInProgress { #[prost(uint64, tag = "2")] pub flashback_start_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlashbackNotPrepared { /// The requested region ID #[prost(uint64, tag = "1")] @@ -199,8 +180,7 @@ pub struct FlashbackNotPrepared { } /// MismatchPeerId is the error variant that tells the request is sent to wrong peer. /// Client receives this error should reload the region info and retry. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct MismatchPeerId { #[prost(uint64, tag = "1")] pub request_peer_id: u64, @@ -209,14 +189,12 @@ pub struct MismatchPeerId { } /// UndeterminedResult is the error variant that tells the result is not determined yet. /// For example, the raft protocol timed out and the apply result is unknown. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UndeterminedResult { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } /// Error wraps all region errors, indicates an error encountered by a request. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Error { /// The error message diff --git a/src/generated/gcpb.rs b/src/generated/gcpb.rs index ef87aeb3..6bd6fd55 100644 --- a/src/generated/gcpb.rs +++ b/src/generated/gcpb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RequestHeader { /// cluster_id is the ID of the cluster which be sent to. #[prost(uint64, tag = "1")] @@ -9,8 +8,7 @@ pub struct RequestHeader { #[prost(uint64, tag = "2")] pub sender_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResponseHeader { /// cluster_id is the ID of the cluster which sent the response. #[prost(uint64, tag = "1")] @@ -18,24 +16,21 @@ pub struct ResponseHeader { #[prost(message, optional, tag = "2")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(enumeration = "ErrorType", tag = "1")] pub r#type: i32, #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeySpace { #[prost(bytes = "vec", tag = "1")] pub space_id: ::prost::alloc::vec::Vec, #[prost(uint64, tag = "2")] pub gc_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListKeySpacesRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -43,7 +38,6 @@ pub struct ListKeySpacesRequest { #[prost(bool, tag = "2")] pub with_gc_safe_point: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListKeySpacesResponse { #[prost(message, optional, tag = "1")] @@ -51,16 +45,14 @@ pub struct ListKeySpacesResponse { #[prost(message, repeated, tag = "2")] pub key_spaces: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMinServiceSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(bytes = "vec", tag = "2")] pub space_id: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMinServiceSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -71,8 +63,7 @@ pub struct GetMinServiceSafePointResponse { #[prost(int64, tag = "3")] pub revision: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateGcSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -85,8 +76,7 @@ pub struct UpdateGcSafePointRequest { #[prost(int64, tag = "4")] pub revision: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateGcSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -97,8 +87,7 @@ pub struct UpdateGcSafePointResponse { #[prost(uint64, tag = "3")] pub new_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateServiceSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -114,8 +103,7 @@ pub struct UpdateServiceSafePointRequest { #[prost(uint64, tag = "5")] pub safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateServiceSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -148,11 +136,11 @@ impl ErrorType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ErrorType::Ok => "OK", - ErrorType::Unknown => "UNKNOWN", - ErrorType::NotBootstrapped => "NOT_BOOTSTRAPPED", - ErrorType::RevisionMismatch => "REVISION_MISMATCH", - ErrorType::SafepointRollback => "SAFEPOINT_ROLLBACK", + Self::Ok => "OK", + Self::Unknown => "UNKNOWN", + Self::NotBootstrapped => "NOT_BOOTSTRAPPED", + Self::RevisionMismatch => "REVISION_MISMATCH", + Self::SafepointRollback => "SAFEPOINT_ROLLBACK", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -169,7 +157,13 @@ impl ErrorType { } /// Generated client implementations. pub mod gc_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -189,10 +183,10 @@ pub mod gc_client { } impl GcClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -210,14 +204,14 @@ pub mod gc_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { GcClient::new(InterceptedService::new(inner, interceptor)) } @@ -263,12 +257,11 @@ pub mod gc_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/gcpb.GC/ListKeySpaces"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("gcpb.GC", "ListKeySpaces")); @@ -285,12 +278,11 @@ pub mod gc_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/gcpb.GC/GetMinServiceSafePoint", ); @@ -310,12 +302,11 @@ pub mod gc_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/gcpb.GC/UpdateGCSafePoint", ); @@ -334,12 +325,11 @@ pub mod gc_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/gcpb.GC/UpdateServiceSafePoint", ); diff --git a/src/generated/google.api.rs b/src/generated/google.api.rs index bb9f7204..b7f234ce 100644 --- a/src/generated/google.api.rs +++ b/src/generated/google.api.rs @@ -2,7 +2,6 @@ /// Defines the HTTP configuration for an API service. It contains a list of /// \[HttpRule\]\[google.api.HttpRule\], each specifying the mapping of an RPC method /// to one or more HTTP REST API methods. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Http { /// A list of HTTP configuration rules that apply to individual API methods. @@ -301,7 +300,6 @@ pub struct Http { /// If an API needs to use a JSON array for request or response body, it can map /// the request or response body to a repeated field. However, some gRPC /// Transcoding implementations may not support this feature. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HttpRule { /// Selects a method to which this rule applies. @@ -341,8 +339,7 @@ pub mod http_rule { /// Determines the URL pattern is matched by this rules. This pattern can be /// used with any of the {get|put|post|delete|patch} methods. A custom method /// can be defined using the 'custom' field. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Pattern { /// Maps to HTTP GET. Used for listing and getting information about /// resources. @@ -369,8 +366,7 @@ pub mod http_rule { } } /// A custom pattern is used for defining custom HTTP verb. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CustomHttpPattern { /// The name of this custom HTTP verb. #[prost(string, tag = "1")] diff --git a/src/generated/import_kvpb.rs b/src/generated/import_kvpb.rs index 104b4346..90e651ce 100644 --- a/src/generated/import_kvpb.rs +++ b/src/generated/import_kvpb.rs @@ -1,5 +1,4 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SwitchModeRequest { #[prost(string, tag = "1")] @@ -7,28 +6,23 @@ pub struct SwitchModeRequest { #[prost(message, optional, tag = "2")] pub request: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SwitchModeResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct OpenEngineRequest { #[prost(bytes = "vec", tag = "1")] pub uuid: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "2")] pub key_prefix: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct OpenEngineResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WriteHead { #[prost(bytes = "vec", tag = "1")] pub uuid: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Mutation { #[prost(enumeration = "mutation::Op", tag = "1")] pub op: i32, @@ -61,7 +55,7 @@ pub mod mutation { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Op::Put => "Put", + Self::Put => "Put", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -73,7 +67,6 @@ pub mod mutation { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WriteBatch { #[prost(uint64, tag = "1")] @@ -81,7 +74,6 @@ pub struct WriteBatch { #[prost(message, repeated, tag = "2")] pub mutations: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WriteEngineRequest { #[prost(oneof = "write_engine_request::Chunk", tags = "1, 2")] @@ -89,7 +81,6 @@ pub struct WriteEngineRequest { } /// Nested message and enum types in `WriteEngineRequest`. pub mod write_engine_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Chunk { #[prost(message, tag = "1")] @@ -98,15 +89,13 @@ pub mod write_engine_request { Batch(super::WriteBatch), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KvPair { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WriteEngineV3Request { #[prost(bytes = "vec", tag = "1")] @@ -116,45 +105,37 @@ pub struct WriteEngineV3Request { #[prost(message, repeated, tag = "3")] pub pairs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WriteEngineResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CloseEngineRequest { #[prost(bytes = "vec", tag = "1")] pub uuid: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CloseEngineResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ImportEngineRequest { #[prost(bytes = "vec", tag = "1")] pub uuid: ::prost::alloc::vec::Vec, #[prost(string, tag = "2")] pub pd_addr: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ImportEngineResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CleanupEngineRequest { #[prost(bytes = "vec", tag = "1")] pub uuid: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CleanupEngineResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactClusterRequest { #[prost(string, tag = "1")] @@ -162,31 +143,25 @@ pub struct CompactClusterRequest { #[prost(message, optional, tag = "2")] pub request: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactClusterResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetVersionRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetVersionResponse { #[prost(string, tag = "1")] pub version: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub commit: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMetricsRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMetricsResponse { #[prost(string, tag = "1")] pub prometheus: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { /// This can happen if the client hasn't opened the engine, or the server /// restarts while the client is writing or closing. An unclosed engine will @@ -197,8 +172,7 @@ pub struct Error { } /// Nested message and enum types in `Error`. pub mod error { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct EngineNotFound { #[prost(bytes = "vec", tag = "1")] pub uuid: ::prost::alloc::vec::Vec, @@ -206,7 +180,13 @@ pub mod error { } /// Generated client implementations. pub mod import_kv_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// ImportKV provides a service to import key-value pairs to TiKV. @@ -245,10 +225,10 @@ pub mod import_kv_client { } impl ImportKvClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -266,14 +246,14 @@ pub mod import_kv_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ImportKvClient::new(InterceptedService::new(inner, interceptor)) } @@ -320,12 +300,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/SwitchMode", ); @@ -346,12 +325,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/OpenEngine", ); @@ -374,12 +352,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/WriteEngine", ); @@ -400,12 +377,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/WriteEngineV3", ); @@ -426,12 +402,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/CloseEngine", ); @@ -452,12 +427,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/ImportEngine", ); @@ -478,12 +452,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/CleanupEngine", ); @@ -504,12 +477,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/CompactCluster", ); @@ -530,12 +502,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/GetVersion", ); @@ -556,12 +527,11 @@ pub mod import_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_kvpb.ImportKV/GetMetrics", ); diff --git a/src/generated/import_sstpb.rs b/src/generated/import_sstpb.rs index f1169ae0..703fa5ac 100644 --- a/src/generated/import_sstpb.rs +++ b/src/generated/import_sstpb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SuspendImportRpcRequest { /// whether to suspend new imports. #[prost(bool, tag = "1")] @@ -14,14 +13,12 @@ pub struct SuspendImportRpcRequest { #[prost(string, tag = "3")] pub caller: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SuspendImportRpcResponse { /// The last state before this RPC. #[prost(bool, tag = "1")] pub already_suspended: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SwitchModeRequest { #[prost(enumeration = "SwitchMode", tag = "1")] @@ -29,28 +26,23 @@ pub struct SwitchModeRequest { #[prost(message, repeated, tag = "2")] pub ranges: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SwitchModeResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetModeRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetModeResponse { #[prost(enumeration = "SwitchMode", tag = "1")] pub mode: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Range { #[prost(bytes = "vec", tag = "1")] pub start: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "2")] pub end: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SstMeta { #[prost(bytes = "vec", tag = "1")] pub uuid: ::prost::alloc::vec::Vec, @@ -83,8 +75,7 @@ pub struct SstMeta { } /// A rewrite rule is applied on the *encoded* keys (the internal storage /// representation). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RewriteRule { #[prost(bytes = "vec", tag = "1")] pub old_key_prefix: ::prost::alloc::vec::Vec, @@ -100,16 +91,14 @@ pub struct RewriteRule { #[prost(uint64, tag = "5")] pub ignore_before_timestamp: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UploadRequest { #[prost(oneof = "upload_request::Chunk", tags = "1, 2")] pub chunk: ::core::option::Option, } /// Nested message and enum types in `UploadRequest`. pub mod upload_request { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Chunk { #[prost(message, tag = "1")] Meta(super::SstMeta), @@ -117,10 +106,8 @@ pub mod upload_request { Data(::prost::alloc::vec::Vec), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct UploadResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IngestRequest { #[prost(message, optional, tag = "1")] @@ -128,7 +115,6 @@ pub struct IngestRequest { #[prost(message, optional, tag = "2")] pub sst: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MultiIngestRequest { #[prost(message, optional, tag = "1")] @@ -136,13 +122,11 @@ pub struct MultiIngestRequest { #[prost(message, repeated, tag = "2")] pub ssts: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IngestResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactRequest { /// Compact files in the range and above the output level. @@ -155,10 +139,8 @@ pub struct CompactRequest { #[prost(message, optional, tag = "3")] pub context: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DownloadRequest { /// Map represents the map of \. @@ -214,7 +196,6 @@ pub struct DownloadRequest { } /// For now it is just used for distinguishing the error of the request with the error /// of gRPC, add more concrete types if it is necessary later. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Error { #[prost(string, tag = "1")] @@ -223,7 +204,6 @@ pub struct Error { #[prost(message, optional, tag = "2")] pub store_error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DownloadResponse { /// The actual key range (after rewrite) of the downloaded SST. The range is @@ -249,8 +229,7 @@ pub struct DownloadResponse { #[prost(message, repeated, tag = "6")] pub ssts: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetDownloadSpeedLimitRequest { /// The download speed limit (bytes/second). Set to 0 for unlimited speed. #[prost(uint64, tag = "1")] @@ -262,11 +241,9 @@ pub struct SetDownloadSpeedLimitRequest { #[prost(uint64, tag = "3")] pub ttl_seconds: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetDownloadSpeedLimitResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Pair { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, @@ -300,8 +277,8 @@ pub mod pair { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Op::Put => "Put", - Op::Delete => "Delete", + Self::Put => "Put", + Self::Delete => "Delete", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -314,7 +291,6 @@ pub mod pair { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WriteBatch { #[prost(uint64, tag = "1")] @@ -322,7 +298,6 @@ pub struct WriteBatch { #[prost(message, repeated, tag = "2")] pub pairs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WriteRequest { #[prost(message, optional, tag = "3")] @@ -332,7 +307,6 @@ pub struct WriteRequest { } /// Nested message and enum types in `WriteRequest`. pub mod write_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Chunk { #[prost(message, tag = "1")] @@ -341,7 +315,6 @@ pub mod write_request { Batch(super::WriteBatch), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WriteResponse { #[prost(message, optional, tag = "1")] @@ -349,7 +322,6 @@ pub struct WriteResponse { #[prost(message, repeated, tag = "2")] pub metas: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawWriteBatch { #[prost(uint64, tag = "1")] @@ -364,7 +336,6 @@ pub struct RawWriteBatch { #[prost(uint64, tag = "3")] pub ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawWriteRequest { #[prost(message, optional, tag = "3")] @@ -374,7 +345,6 @@ pub struct RawWriteRequest { } /// Nested message and enum types in `RawWriteRequest`. pub mod raw_write_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Chunk { #[prost(message, tag = "1")] @@ -383,7 +353,6 @@ pub mod raw_write_request { Batch(super::RawWriteBatch), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawWriteResponse { #[prost(message, optional, tag = "1")] @@ -391,7 +360,6 @@ pub struct RawWriteResponse { #[prost(message, repeated, tag = "2")] pub metas: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DuplicateDetectRequest { #[prost(message, optional, tag = "1")] @@ -407,8 +375,7 @@ pub struct DuplicateDetectRequest { #[prost(uint64, tag = "5")] pub min_commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KvPair { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, @@ -417,7 +384,6 @@ pub struct KvPair { #[prost(uint64, tag = "3")] pub commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DuplicateDetectResponse { #[prost(message, optional, tag = "1")] @@ -437,7 +403,6 @@ pub struct DuplicateDetectResponse { #[prost(message, repeated, tag = "3")] pub pairs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KvMeta { /// The file name of the KV file. @@ -485,7 +450,6 @@ pub struct KvMeta { super::encryptionpb::FileEncryptionInfo, >, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ApplyRequest { /// The meta of the KV file. @@ -525,7 +489,6 @@ pub struct ApplyRequest { #[prost(message, repeated, tag = "14")] pub master_keys: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ApplyResponse { /// The actual key range (after rewrite) of the downloaded file. The range is @@ -535,21 +498,18 @@ pub struct ApplyResponse { #[prost(message, optional, tag = "2")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ClearRequest { /// clear files in import directory with given prefix. #[prost(string, tag = "1")] pub prefix: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClearResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AddPartitionRangeRequest { #[prost(message, optional, tag = "1")] pub range: ::core::option::Option, @@ -561,17 +521,14 @@ pub struct AddPartitionRangeRequest { #[prost(uint64, tag = "2")] pub ttl_seconds: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct AddPartitionRangeResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RemovePartitionRangeRequest { #[prost(message, optional, tag = "1")] pub range: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RemovePartitionRangeResponse {} #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -586,8 +543,8 @@ impl SwitchMode { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - SwitchMode::Normal => "Normal", - SwitchMode::Import => "Import", + Self::Normal => "Normal", + Self::Import => "Import", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -614,8 +571,8 @@ impl DownloadRequestType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - DownloadRequestType::Legacy => "Legacy", - DownloadRequestType::Keyspace => "Keyspace", + Self::Legacy => "Legacy", + Self::Keyspace => "Keyspace", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -629,7 +586,13 @@ impl DownloadRequestType { } /// Generated client implementations. pub mod import_sst_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// ImportSST provides a service to import a generated SST file to a region in TiKV. @@ -665,10 +628,10 @@ pub mod import_sst_client { } impl ImportSstClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -686,14 +649,14 @@ pub mod import_sst_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ImportSstClient::new(InterceptedService::new(inner, interceptor)) } @@ -740,12 +703,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/SwitchMode", ); @@ -766,12 +728,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/GetMode", ); @@ -789,12 +750,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/Upload", ); @@ -812,12 +772,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/Ingest", ); @@ -838,12 +797,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/Compact", ); @@ -863,12 +821,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/SetDownloadSpeedLimit", ); @@ -892,12 +849,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/Download", ); @@ -919,12 +875,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/BatchDownload", ); @@ -946,12 +901,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/BatchDownloadLatestMVCC", ); @@ -971,12 +925,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/Write", ); @@ -996,12 +949,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/RawWrite", ); @@ -1019,12 +971,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/MultiIngest", ); @@ -1045,12 +996,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/DuplicateDetect", ); @@ -1068,12 +1018,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/Apply", ); @@ -1091,12 +1040,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/ClearFiles", ); @@ -1117,12 +1065,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/SuspendImportRPC", ); @@ -1146,12 +1093,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/AddForcePartitionRange", ); @@ -1175,12 +1121,11 @@ pub mod import_sst_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/import_sstpb.ImportSST/RemoveForcePartitionRange", ); diff --git a/src/generated/keyspacepb.rs b/src/generated/keyspacepb.rs index 53e3bb00..bd31466b 100644 --- a/src/generated/keyspacepb.rs +++ b/src/generated/keyspacepb.rs @@ -1,5 +1,4 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyspaceMeta { #[prost(uint32, tag = "1")] @@ -18,23 +17,20 @@ pub struct KeyspaceMeta { ::prost::alloc::string::String, >, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LoadKeyspaceRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LoadKeyspaceByIdRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint32, tag = "2")] pub id: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LoadKeyspaceResponse { #[prost(message, optional, tag = "1")] @@ -42,13 +38,11 @@ pub struct LoadKeyspaceResponse { #[prost(message, optional, tag = "2")] pub keyspace: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WatchKeyspacesRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WatchKeyspacesResponse { #[prost(message, optional, tag = "1")] @@ -56,8 +50,7 @@ pub struct WatchKeyspacesResponse { #[prost(message, repeated, tag = "2")] pub keyspaces: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateKeyspaceStateRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -66,7 +59,6 @@ pub struct UpdateKeyspaceStateRequest { #[prost(enumeration = "KeyspaceState", tag = "3")] pub state: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateKeyspaceStateResponse { #[prost(message, optional, tag = "1")] @@ -74,8 +66,7 @@ pub struct UpdateKeyspaceStateResponse { #[prost(message, optional, tag = "2")] pub keyspace: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAllKeyspacesRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -84,7 +75,6 @@ pub struct GetAllKeyspacesRequest { #[prost(uint32, tag = "3")] pub limit: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAllKeyspacesResponse { #[prost(message, optional, tag = "1")] @@ -107,10 +97,10 @@ impl KeyspaceState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - KeyspaceState::Enabled => "ENABLED", - KeyspaceState::Disabled => "DISABLED", - KeyspaceState::Archived => "ARCHIVED", - KeyspaceState::Tombstone => "TOMBSTONE", + Self::Enabled => "ENABLED", + Self::Disabled => "DISABLED", + Self::Archived => "ARCHIVED", + Self::Tombstone => "TOMBSTONE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -126,7 +116,13 @@ impl KeyspaceState { } /// Generated client implementations. pub mod keyspace_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Keyspace provides services to manage keyspaces. @@ -147,10 +143,10 @@ pub mod keyspace_client { } impl KeyspaceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -168,14 +164,14 @@ pub mod keyspace_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { KeyspaceClient::new(InterceptedService::new(inner, interceptor)) } @@ -221,12 +217,11 @@ pub mod keyspace_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/keyspacepb.Keyspace/LoadKeyspace", ); @@ -246,12 +241,11 @@ pub mod keyspace_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/keyspacepb.Keyspace/LoadKeyspaceByID", ); @@ -273,12 +267,11 @@ pub mod keyspace_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/keyspacepb.Keyspace/WatchKeyspaces", ); @@ -298,12 +291,11 @@ pub mod keyspace_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/keyspacepb.Keyspace/UpdateKeyspaceState", ); @@ -323,12 +315,11 @@ pub mod keyspace_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/keyspacepb.Keyspace/GetAllKeyspaces", ); diff --git a/src/generated/kvrpcpb.rs b/src/generated/kvrpcpb.rs index 89f2d472..3fde6749 100644 --- a/src/generated/kvrpcpb.rs +++ b/src/generated/kvrpcpb.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// A transactional get command. Lookup a value for `key` in the transaction with /// starting timestamp = `version`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetRequest { #[prost(message, optional, tag = "1")] @@ -14,7 +13,6 @@ pub struct GetRequest { #[prost(bool, tag = "4")] pub need_commit_ts: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetResponse { /// A region error indicates that the request was sent to the wrong TiKV node @@ -40,7 +38,6 @@ pub struct GetResponse { } /// Scan fetches values for a range of keys; it is part of the transaction with /// starting timestamp = `version`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScanRequest { #[prost(message, optional, tag = "1")] @@ -66,7 +63,6 @@ pub struct ScanRequest { #[prost(uint32, tag = "8")] pub sample_step: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScanResponse { #[prost(message, optional, tag = "1")] @@ -83,7 +79,6 @@ pub struct ScanResponse { /// A prewrite is the first phase of writing to TiKV. It contains all data to be written in a transaction. /// TiKV will write the data in a preliminary state. Data cannot be read until it has been committed. /// The client should only commit a transaction once all prewrites succeed. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrewriteRequest { #[prost(message, optional, tag = "1")] @@ -148,8 +143,7 @@ pub struct PrewriteRequest { /// Nested message and enum types in `PrewriteRequest`. pub mod prewrite_request { /// for_update_ts constriants that should be checked when prewriting a pessimistic transaction. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ForUpdateTsConstraint { /// The index of key in the prewrite request that should be checked. #[prost(uint32, tag = "1")] @@ -189,9 +183,9 @@ pub mod prewrite_request { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PessimisticAction::SkipPessimisticCheck => "SKIP_PESSIMISTIC_CHECK", - PessimisticAction::DoPessimisticCheck => "DO_PESSIMISTIC_CHECK", - PessimisticAction::DoConstraintCheck => "DO_CONSTRAINT_CHECK", + Self::SkipPessimisticCheck => "SKIP_PESSIMISTIC_CHECK", + Self::DoPessimisticCheck => "DO_PESSIMISTIC_CHECK", + Self::DoConstraintCheck => "DO_CONSTRAINT_CHECK", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -205,7 +199,6 @@ pub mod prewrite_request { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrewriteResponse { #[prost(message, optional, tag = "1")] @@ -227,7 +220,6 @@ pub struct PrewriteResponse { pub exec_details_v2: ::core::option::Option, } /// Lock a set of keys to prepare to write to them. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PessimisticLockRequest { #[prost(message, optional, tag = "1")] @@ -282,8 +274,7 @@ pub struct PessimisticLockRequest { #[prost(enumeration = "PessimisticLockWakeUpMode", tag = "14")] pub wake_up_mode: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PessimisticLockKeyResult { #[prost(enumeration = "PessimisticLockKeyResultType", tag = "1")] pub r#type: i32, @@ -305,7 +296,6 @@ pub struct PessimisticLockKeyResult { #[prost(bool, tag = "11")] pub skip_resolving_lock: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PessimisticLockResponse { #[prost(message, optional, tag = "1")] @@ -338,7 +328,6 @@ pub struct PessimisticLockResponse { pub results: ::prost::alloc::vec::Vec, } /// Unlock keys locked using `PessimisticLockRequest`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PessimisticRollbackRequest { #[prost(message, optional, tag = "1")] @@ -350,7 +339,6 @@ pub struct PessimisticRollbackRequest { #[prost(bytes = "vec", repeated, tag = "4")] pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PessimisticRollbackResponse { #[prost(message, optional, tag = "1")] @@ -362,7 +350,6 @@ pub struct PessimisticRollbackResponse { pub exec_details_v2: ::core::option::Option, } /// Used to update the lock_ttl of a psessimistic and/or large transaction to prevent it from been killed. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxnHeartBeatRequest { #[prost(message, optional, tag = "1")] @@ -385,7 +372,6 @@ pub struct TxnHeartBeatRequest { #[prost(bool, tag = "100")] pub is_txn_file: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxnHeartBeatResponse { #[prost(message, optional, tag = "1")] @@ -404,7 +390,6 @@ pub struct TxnHeartBeatResponse { /// If the TTL of the transaction is exhausted, abort that transaction and inform the caller. /// Otherwise, returns the TTL information for the transaction. /// CheckTxnStatusRequest may also push forward the minCommitTS of a large transaction. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckTxnStatusRequest { #[prost(message, optional, tag = "1")] @@ -447,7 +432,6 @@ pub struct CheckTxnStatusRequest { #[prost(bool, tag = "100")] pub is_txn_file: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckTxnStatusResponse { #[prost(message, optional, tag = "1")] @@ -474,7 +458,6 @@ pub struct CheckTxnStatusResponse { /// Part of the async commit protocol, checks for locks on all supplied keys. If a lock is missing, /// does not have a successful status, or belongs to another transaction, TiKV will leave a rollback /// tombstone for that key. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckSecondaryLocksRequest { #[prost(message, optional, tag = "1")] @@ -485,7 +468,6 @@ pub struct CheckSecondaryLocksRequest { #[prost(uint64, tag = "3")] pub start_version: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckSecondaryLocksResponse { #[prost(message, optional, tag = "1")] @@ -507,7 +489,6 @@ pub struct CheckSecondaryLocksResponse { } /// The second phase of writing to TiKV. If there are no errors or conflicts, then this request /// commits a transaction so that its data can be read by other transactions. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitRequest { #[prost(message, optional, tag = "1")] @@ -536,7 +517,6 @@ pub struct CommitRequest { #[prost(bool, tag = "100")] pub is_txn_file: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitResponse { #[prost(message, optional, tag = "1")] @@ -551,7 +531,6 @@ pub struct CommitResponse { pub exec_details_v2: ::core::option::Option, } /// Not yet implemented. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ImportRequest { #[prost(message, repeated, tag = "1")] @@ -559,7 +538,6 @@ pub struct ImportRequest { #[prost(uint64, tag = "2")] pub commit_version: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ImportResponse { #[prost(message, optional, tag = "1")] @@ -569,7 +547,6 @@ pub struct ImportResponse { } /// Cleanup a key by possibly unlocking it. /// From 4.0 onwards, this message is no longer used. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CleanupRequest { #[prost(message, optional, tag = "1")] @@ -584,7 +561,6 @@ pub struct CleanupRequest { #[prost(uint64, tag = "4")] pub current_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CleanupResponse { #[prost(message, optional, tag = "1")] @@ -596,7 +572,6 @@ pub struct CleanupResponse { pub commit_version: u64, } /// Similar to a `Get` request. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchGetRequest { #[prost(message, optional, tag = "1")] @@ -609,7 +584,6 @@ pub struct BatchGetRequest { #[prost(bool, tag = "4")] pub need_commit_ts: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchGetResponse { #[prost(message, optional, tag = "1")] @@ -627,7 +601,6 @@ pub struct BatchGetResponse { } /// Rollback a prewritten transaction. This will remove the preliminary data from the database, /// unlock locks, and leave a rollback tombstone. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchRollbackRequest { #[prost(message, optional, tag = "1")] @@ -642,7 +615,6 @@ pub struct BatchRollbackRequest { #[prost(bool, tag = "100")] pub is_txn_file: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchRollbackResponse { #[prost(message, optional, tag = "1")] @@ -655,7 +627,6 @@ pub struct BatchRollbackResponse { } /// Scan the database for locks. Used at the start of the GC process to find all /// old locks. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScanLockRequest { #[prost(message, optional, tag = "1")] @@ -673,7 +644,6 @@ pub struct ScanLockRequest { #[prost(bytes = "vec", tag = "5")] pub end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScanLockResponse { #[prost(message, optional, tag = "1")] @@ -689,7 +659,6 @@ pub struct ScanLockResponse { } /// For all keys locked by the transaction identified by `start_version`, either /// commit or rollback the transaction and unlock the key. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResolveLockRequest { #[prost(message, optional, tag = "1")] @@ -712,7 +681,6 @@ pub struct ResolveLockRequest { #[prost(bool, tag = "100")] pub is_txn_file: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResolveLockResponse { #[prost(message, optional, tag = "1")] @@ -724,7 +692,6 @@ pub struct ResolveLockResponse { pub exec_details_v2: ::core::option::Option, } /// Request TiKV to garbage collect all non-current data older than `safe_point`. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GcRequest { #[prost(message, optional, tag = "1")] @@ -732,7 +699,6 @@ pub struct GcRequest { #[prost(uint64, tag = "2")] pub safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GcResponse { #[prost(message, optional, tag = "1")] @@ -741,7 +707,6 @@ pub struct GcResponse { pub error: ::core::option::Option, } /// Delete a range of data from TiKV. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteRangeRequest { #[prost(message, optional, tag = "1")] @@ -756,7 +721,6 @@ pub struct DeleteRangeRequest { #[prost(bool, tag = "4")] pub notify_only: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteRangeResponse { #[prost(message, optional, tag = "1")] @@ -767,7 +731,6 @@ pub struct DeleteRangeResponse { /// Preparing the flashback for a region/key range will "lock" the region /// so that there is no any read, write or schedule operation could be proposed before /// the actual flashback operation. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrepareFlashbackToVersionRequest { #[prost(message, optional, tag = "1")] @@ -784,7 +747,6 @@ pub struct PrepareFlashbackToVersionRequest { #[prost(uint64, tag = "5")] pub version: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrepareFlashbackToVersionResponse { #[prost(message, optional, tag = "1")] @@ -795,7 +757,6 @@ pub struct PrepareFlashbackToVersionResponse { /// Flashback the region to a specific point with the given `version`, please /// make sure the region is "locked" by `PrepareFlashbackToVersionRequest` first, /// otherwise this request will fail. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlashbackToVersionRequest { #[prost(message, optional, tag = "1")] @@ -814,7 +775,6 @@ pub struct FlashbackToVersionRequest { #[prost(uint64, tag = "6")] pub commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlashbackToVersionResponse { #[prost(message, optional, tag = "1")] @@ -822,7 +782,6 @@ pub struct FlashbackToVersionResponse { #[prost(string, tag = "2")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawGetRequest { #[prost(message, optional, tag = "1")] @@ -832,7 +791,6 @@ pub struct RawGetRequest { #[prost(string, tag = "3")] pub cf: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawGetResponse { #[prost(message, optional, tag = "1")] @@ -844,7 +802,6 @@ pub struct RawGetResponse { #[prost(bool, tag = "4")] pub not_found: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchGetRequest { #[prost(message, optional, tag = "1")] @@ -854,7 +811,6 @@ pub struct RawBatchGetRequest { #[prost(string, tag = "3")] pub cf: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchGetResponse { #[prost(message, optional, tag = "1")] @@ -862,7 +818,6 @@ pub struct RawBatchGetResponse { #[prost(message, repeated, tag = "2")] pub pairs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawPutRequest { #[prost(message, optional, tag = "1")] @@ -878,7 +833,6 @@ pub struct RawPutRequest { #[prost(bool, tag = "6")] pub for_cas: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawPutResponse { #[prost(message, optional, tag = "1")] @@ -886,7 +840,6 @@ pub struct RawPutResponse { #[prost(string, tag = "2")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchPutRequest { #[prost(message, optional, tag = "1")] @@ -906,7 +859,6 @@ pub struct RawBatchPutRequest { #[prost(uint64, repeated, tag = "6")] pub ttls: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchPutResponse { #[prost(message, optional, tag = "1")] @@ -914,7 +866,6 @@ pub struct RawBatchPutResponse { #[prost(string, tag = "2")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawDeleteRequest { #[prost(message, optional, tag = "1")] @@ -926,7 +877,6 @@ pub struct RawDeleteRequest { #[prost(bool, tag = "4")] pub for_cas: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawDeleteResponse { #[prost(message, optional, tag = "1")] @@ -934,7 +884,6 @@ pub struct RawDeleteResponse { #[prost(string, tag = "2")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchDeleteRequest { #[prost(message, optional, tag = "1")] @@ -946,7 +895,6 @@ pub struct RawBatchDeleteRequest { #[prost(bool, tag = "4")] pub for_cas: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchDeleteResponse { #[prost(message, optional, tag = "1")] @@ -954,7 +902,6 @@ pub struct RawBatchDeleteResponse { #[prost(string, tag = "2")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawScanRequest { #[prost(message, optional, tag = "1")] @@ -974,7 +921,6 @@ pub struct RawScanRequest { #[prost(bytes = "vec", tag = "7")] pub end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawScanResponse { #[prost(message, optional, tag = "1")] @@ -982,7 +928,6 @@ pub struct RawScanResponse { #[prost(message, repeated, tag = "2")] pub kvs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawDeleteRangeRequest { #[prost(message, optional, tag = "1")] @@ -994,7 +939,6 @@ pub struct RawDeleteRangeRequest { #[prost(string, tag = "4")] pub cf: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawDeleteRangeResponse { #[prost(message, optional, tag = "1")] @@ -1002,7 +946,6 @@ pub struct RawDeleteRangeResponse { #[prost(string, tag = "2")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchScanRequest { #[prost(message, optional, tag = "1")] @@ -1020,7 +963,6 @@ pub struct RawBatchScanRequest { #[prost(bool, tag = "6")] pub reverse: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawBatchScanResponse { #[prost(message, optional, tag = "1")] @@ -1028,7 +970,6 @@ pub struct RawBatchScanResponse { #[prost(message, repeated, tag = "2")] pub kvs: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnsafeDestroyRangeRequest { #[prost(message, optional, tag = "1")] @@ -1038,7 +979,6 @@ pub struct UnsafeDestroyRangeRequest { #[prost(bytes = "vec", tag = "3")] pub end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnsafeDestroyRangeResponse { #[prost(message, optional, tag = "1")] @@ -1046,7 +986,6 @@ pub struct UnsafeDestroyRangeResponse { #[prost(string, tag = "2")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegisterLockObserverRequest { #[prost(message, optional, tag = "1")] @@ -1054,13 +993,11 @@ pub struct RegisterLockObserverRequest { #[prost(uint64, tag = "2")] pub max_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegisterLockObserverResponse { #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckLockObserverRequest { #[prost(message, optional, tag = "1")] @@ -1068,7 +1005,6 @@ pub struct CheckLockObserverRequest { #[prost(uint64, tag = "2")] pub max_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckLockObserverResponse { #[prost(string, tag = "1")] @@ -1078,7 +1014,6 @@ pub struct CheckLockObserverResponse { #[prost(message, repeated, tag = "3")] pub locks: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RemoveLockObserverRequest { #[prost(message, optional, tag = "1")] @@ -1086,13 +1021,11 @@ pub struct RemoveLockObserverRequest { #[prost(uint64, tag = "2")] pub max_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RemoveLockObserverResponse { #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PhysicalScanLockRequest { #[prost(message, optional, tag = "1")] @@ -1104,7 +1037,6 @@ pub struct PhysicalScanLockRequest { #[prost(uint32, tag = "4")] pub limit: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PhysicalScanLockResponse { #[prost(string, tag = "1")] @@ -1113,7 +1045,6 @@ pub struct PhysicalScanLockResponse { pub locks: ::prost::alloc::vec::Vec, } /// Sent from PD to a TiKV node. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SplitRegionRequest { #[prost(message, optional, tag = "1")] @@ -1128,7 +1059,6 @@ pub struct SplitRegionRequest { #[prost(bool, tag = "4")] pub is_raw_kv: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SplitRegionResponse { #[prost(message, optional, tag = "1")] @@ -1149,7 +1079,6 @@ pub struct SplitRegionResponse { pub errors: ::prost::alloc::vec::Vec, } /// Sent from TiFlash to a TiKV node. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadIndexRequest { #[prost(message, optional, tag = "1")] @@ -1161,7 +1090,6 @@ pub struct ReadIndexRequest { #[prost(message, repeated, tag = "3")] pub ranges: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadIndexResponse { #[prost(message, optional, tag = "1")] @@ -1173,7 +1101,6 @@ pub struct ReadIndexResponse { #[prost(message, optional, tag = "3")] pub locked: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MvccGetByKeyRequest { #[prost(message, optional, tag = "1")] @@ -1181,7 +1108,6 @@ pub struct MvccGetByKeyRequest { #[prost(bytes = "vec", tag = "2")] pub key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MvccGetByKeyResponse { #[prost(message, optional, tag = "1")] @@ -1191,7 +1117,6 @@ pub struct MvccGetByKeyResponse { #[prost(message, optional, tag = "3")] pub info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MvccGetByStartTsRequest { #[prost(message, optional, tag = "1")] @@ -1199,7 +1124,6 @@ pub struct MvccGetByStartTsRequest { #[prost(uint64, tag = "2")] pub start_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MvccGetByStartTsResponse { #[prost(message, optional, tag = "1")] @@ -1212,7 +1136,6 @@ pub struct MvccGetByStartTsResponse { pub info: ::core::option::Option, } /// Miscellaneous metadata attached to most requests. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Context { #[prost(uint64, tag = "1")] @@ -1329,7 +1252,6 @@ pub struct Context { #[prost(uint64, tag = "37")] pub trace_control_flags: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResourceControlContext { /// It's used to identify which resource group the request belongs to. @@ -1344,8 +1266,7 @@ pub struct ResourceControlContext { #[prost(uint64, tag = "3")] pub override_priority: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SourceStmt { #[prost(uint64, tag = "1")] pub start_ts: u64, @@ -1357,7 +1278,6 @@ pub struct SourceStmt { #[prost(string, tag = "4")] pub session_alias: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LockInfo { #[prost(bytes = "vec", tag = "1")] @@ -1399,7 +1319,6 @@ pub struct LockInfo { #[prost(bool, tag = "100")] pub is_txn_file: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyError { /// Client should backoff or cleanup the lock then retry. @@ -1442,8 +1361,7 @@ pub struct KeyError { #[prost(message, optional, tag = "100")] pub debug_info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WriteConflict { #[prost(uint64, tag = "1")] pub start_ts: u64, @@ -1494,13 +1412,13 @@ pub mod write_conflict { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Reason::Unknown => "Unknown", - Reason::Optimistic => "Optimistic", - Reason::PessimisticRetry => "PessimisticRetry", - Reason::SelfRolledBack => "SelfRolledBack", - Reason::RcCheckTs => "RcCheckTs", - Reason::LazyUniquenessCheck => "LazyUniquenessCheck", - Reason::NotLockedKeyConflict => "NotLockedKeyConflict", + Self::Unknown => "Unknown", + Self::Optimistic => "Optimistic", + Self::PessimisticRetry => "PessimisticRetry", + Self::SelfRolledBack => "SelfRolledBack", + Self::RcCheckTs => "RcCheckTs", + Self::LazyUniquenessCheck => "LazyUniquenessCheck", + Self::NotLockedKeyConflict => "NotLockedKeyConflict", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1518,13 +1436,11 @@ pub mod write_conflict { } } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AlreadyExist { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deadlock { #[prost(uint64, tag = "1")] @@ -1540,8 +1456,7 @@ pub struct Deadlock { #[prost(bytes = "vec", tag = "5")] pub deadlock_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CommitTsExpired { #[prost(uint64, tag = "1")] pub start_ts: u64, @@ -1552,23 +1467,20 @@ pub struct CommitTsExpired { #[prost(uint64, tag = "4")] pub min_commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TxnNotFound { #[prost(uint64, tag = "1")] pub start_ts: u64, #[prost(bytes = "vec", tag = "2")] pub primary_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CommitTsTooLarge { /// The calculated commit TS. #[prost(uint64, tag = "1")] pub commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AssertionFailed { #[prost(uint64, tag = "1")] pub start_ts: u64, @@ -1581,19 +1493,16 @@ pub struct AssertionFailed { #[prost(uint64, tag = "5")] pub existing_commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrimaryMismatch { #[prost(message, optional, tag = "1")] pub lock_info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TxnLockNotFound { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MvccDebugInfo { #[prost(bytes = "vec", tag = "1")] @@ -1601,14 +1510,12 @@ pub struct MvccDebugInfo { #[prost(message, optional, tag = "2")] pub mvcc: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DebugInfo { #[prost(message, repeated, tag = "1")] pub mvcc_info: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TimeDetail { /// Off-cpu wall time elapsed in TiKV side. Usually this includes queue waiting time and /// other kind of waitings in series. (Wait time in the raftstore is not included.) @@ -1628,8 +1535,7 @@ pub struct TimeDetail { #[prost(uint64, tag = "4")] pub total_rpc_wall_time_ns: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TimeDetailV2 { /// Off-cpu wall time elapsed in TiKV side. Usually this includes queue waiting time and /// other kind of waitings in series. (Wait time in the raftstore is not included.) @@ -1658,8 +1564,7 @@ pub struct TimeDetailV2 { #[prost(uint64, tag = "7")] pub kv_grpc_wait_time_ns: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScanInfo { #[prost(int64, tag = "1")] pub total: i64, @@ -1669,8 +1574,7 @@ pub struct ScanInfo { pub read_bytes: i64, } /// Only reserved for compatibility. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScanDetail { #[prost(message, optional, tag = "1")] pub write: ::core::option::Option, @@ -1679,8 +1583,7 @@ pub struct ScanDetail { #[prost(message, optional, tag = "3")] pub data: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScanDetailV2 { /// Number of user keys scanned from the storage. /// It does not include deleted version or RocksDB tombstone keys. @@ -1755,8 +1658,7 @@ pub struct ScanDetailV2 { #[prost(uint64, tag = "18")] pub ia_remote_read_segment_nanos: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ExecDetails { /// Available when ctx.record_time_stat = true or meet slow query. #[prost(message, optional, tag = "1")] @@ -1765,8 +1667,7 @@ pub struct ExecDetails { #[prost(message, optional, tag = "2")] pub scan_detail: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ExecDetailsV2 { /// Available when ctx.record_time_stat = true or meet slow query. /// deprecated. Should use `time_detail_v2` instead. @@ -1785,8 +1686,7 @@ pub struct ExecDetailsV2 { #[prost(message, optional, tag = "5")] pub ru_v2: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Ruv2 { #[prost(uint64, tag = "1")] pub kv_engine_cache_miss: u64, @@ -1809,8 +1709,7 @@ pub struct Ruv2 { #[prost(uint64, tag = "9")] pub write_rpc_count: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ExecutorInputs { #[prost(uint64, tag = "1")] pub tikv_coprocessor_executor_work_total_batch_index_scan: u64, @@ -1827,8 +1726,7 @@ pub struct ExecutorInputs { #[prost(uint64, tag = "7")] pub tikv_coprocessor_executor_work_total_batch_fast_hash_aggr: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct WriteDetail { /// Wait duration in the store loop. #[prost(uint64, tag = "1")] @@ -1882,7 +1780,6 @@ pub struct WriteDetail { #[prost(uint64, tag = "17")] pub pessimistic_lock_wait_nanos: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KvPair { #[prost(message, optional, tag = "1")] @@ -1896,8 +1793,7 @@ pub struct KvPair { #[prost(uint64, tag = "4")] pub commit_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Mutation { #[prost(enumeration = "Op", tag = "1")] pub op: i32, @@ -1908,8 +1804,7 @@ pub struct Mutation { #[prost(enumeration = "Assertion", tag = "4")] pub assertion: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MvccWrite { #[prost(enumeration = "Op", tag = "1")] pub r#type: i32, @@ -1930,16 +1825,14 @@ pub struct MvccWrite { #[prost(uint64, tag = "9")] pub versions_to_last_change: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MvccValue { #[prost(uint64, tag = "1")] pub start_ts: u64, #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MvccLock { #[prost(enumeration = "Op", tag = "1")] pub r#type: i32, @@ -1966,7 +1859,6 @@ pub struct MvccLock { #[prost(uint64, tag = "12")] pub versions_to_last_change: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MvccInfo { #[prost(message, optional, tag = "1")] @@ -1976,8 +1868,7 @@ pub struct MvccInfo { #[prost(message, repeated, tag = "3")] pub values: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TxnInfo { #[prost(uint64, tag = "1")] pub txn: u64, @@ -1987,16 +1878,14 @@ pub struct TxnInfo { #[prost(bool, tag = "100")] pub is_txn_file: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyRange { #[prost(bytes = "vec", tag = "1")] pub start_key: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "2")] pub end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct LeaderInfo { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -2009,15 +1898,13 @@ pub struct LeaderInfo { #[prost(message, optional, tag = "5")] pub read_state: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReadState { #[prost(uint64, tag = "1")] pub applied_index: u64, #[prost(uint64, tag = "2")] pub safe_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CheckLeaderRequest { #[prost(message, repeated, tag = "1")] @@ -2025,29 +1912,25 @@ pub struct CheckLeaderRequest { #[prost(uint64, tag = "2")] pub ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CheckLeaderResponse { #[prost(uint64, repeated, tag = "1")] pub regions: ::prost::alloc::vec::Vec, #[prost(uint64, tag = "2")] pub ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreSafeTsRequest { /// Get the minimal `safe_ts` from regions that overlap with the key range \[`start_key`, `end_key`) /// An empty key range means all regions in the store #[prost(message, optional, tag = "1")] pub key_range: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreSafeTsResponse { #[prost(uint64, tag = "1")] pub safe_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawGetKeyTtlRequest { #[prost(message, optional, tag = "1")] @@ -2057,7 +1940,6 @@ pub struct RawGetKeyTtlRequest { #[prost(string, tag = "3")] pub cf: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawGetKeyTtlResponse { #[prost(message, optional, tag = "1")] @@ -2069,7 +1951,6 @@ pub struct RawGetKeyTtlResponse { #[prost(bool, tag = "4")] pub not_found: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawCasRequest { #[prost(message, optional, tag = "1")] @@ -2090,7 +1971,6 @@ pub struct RawCasRequest { #[prost(bool, tag = "8")] pub delete: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawCasResponse { #[prost(message, optional, tag = "1")] @@ -2105,7 +1985,6 @@ pub struct RawCasResponse { #[prost(bytes = "vec", tag = "5")] pub previous_value: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLockWaitInfoRequest { /// TODO: There may need some filter options to be used on conditional querying, e.g., finding @@ -2113,7 +1992,6 @@ pub struct GetLockWaitInfoRequest { #[prost(message, optional, tag = "1")] pub context: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLockWaitInfoResponse { #[prost(message, optional, tag = "1")] @@ -2123,7 +2001,6 @@ pub struct GetLockWaitInfoResponse { #[prost(message, repeated, tag = "3")] pub entries: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLockWaitHistoryRequest { /// TODO: There may need some filter options to be used on conditional querying, e.g., finding @@ -2131,7 +2008,6 @@ pub struct GetLockWaitHistoryRequest { #[prost(message, optional, tag = "1")] pub context: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLockWaitHistoryResponse { #[prost(message, optional, tag = "1")] @@ -2141,7 +2017,6 @@ pub struct GetLockWaitHistoryResponse { #[prost(message, repeated, tag = "3")] pub entries: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawCoprocessorRequest { #[prost(message, optional, tag = "1")] @@ -2156,7 +2031,6 @@ pub struct RawCoprocessorRequest { #[prost(bytes = "vec", tag = "5")] pub data: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawCoprocessorResponse { #[prost(message, optional, tag = "1")] @@ -2168,7 +2042,6 @@ pub struct RawCoprocessorResponse { #[prost(bytes = "vec", tag = "3")] pub data: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawChecksumRequest { #[prost(message, optional, tag = "1")] @@ -2178,7 +2051,6 @@ pub struct RawChecksumRequest { #[prost(message, repeated, tag = "3")] pub ranges: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RawChecksumResponse { #[prost(message, optional, tag = "1")] @@ -2192,16 +2064,14 @@ pub struct RawChecksumResponse { #[prost(uint64, tag = "5")] pub total_bytes: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactError { #[prost(oneof = "compact_error::Error", tags = "1, 2, 3, 4")] pub error: ::core::option::Option, } /// Nested message and enum types in `CompactError`. pub mod compact_error { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)] pub enum Error { #[prost(message, tag = "1")] ErrInvalidStartKey(super::CompactErrorInvalidStartKey), @@ -2213,20 +2083,15 @@ pub mod compact_error { ErrTooManyPendingTasks(super::CompactErrorTooManyPendingTasks), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactErrorInvalidStartKey {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactErrorPhysicalTableNotExist {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactErrorCompactInProgress {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactErrorTooManyPendingTasks {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactRequest { /// If specified, the compaction will start from this start key. /// If unspecified, the compaction will start from beginning. @@ -2255,8 +2120,7 @@ pub struct CompactRequest { #[prost(uint32, tag = "8")] pub keyspace_id: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, @@ -2269,21 +2133,18 @@ pub struct CompactResponse { #[prost(bytes = "vec", tag = "4")] pub compacted_end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TiFlashSystemTableRequest { #[prost(string, tag = "1")] pub sql: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TiFlashSystemTableResponse { #[prost(bytes = "vec", tag = "1")] pub data: ::prost::alloc::vec::Vec, } /// Flush is introduced from the pipelined DML protocol. /// A Flush request writes some keys and values to TiKV, storing in LOCK and DEFAULT CF, just like a Prewrite request. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlushRequest { #[prost(message, optional, tag = "1")] @@ -2304,7 +2165,6 @@ pub struct FlushRequest { #[prost(enumeration = "AssertionLevel", tag = "8")] pub assertion_level: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlushResponse { #[prost(message, optional, tag = "1")] @@ -2316,7 +2176,6 @@ pub struct FlushResponse { } /// BufferBatchGet is introduced from the pipelined DML protocol. /// It is similar to a BatchGet request, except that it can only read the data that has been flushed by itself. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BufferBatchGetRequest { #[prost(message, optional, tag = "1")] @@ -2326,7 +2185,6 @@ pub struct BufferBatchGetRequest { #[prost(uint64, tag = "3")] pub version: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BufferBatchGetResponse { #[prost(message, optional, tag = "1")] @@ -2343,13 +2201,11 @@ pub struct BufferBatchGetResponse { /// `BatchCommandsResponse` that contains this response. /// The health feedback information won't be replied in the response, but will be attached to `BatchCommandsResponse.health_feedback` field as usual. /// Only works when batch RPC is enabled. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetHealthFeedbackRequest { #[prost(message, optional, tag = "1")] pub context: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetHealthFeedbackResponse { /// The error field is added for keeping consistent. This request won't meet any region error as it's store level rather than region level. @@ -2358,8 +2214,7 @@ pub struct GetHealthFeedbackResponse { #[prost(message, optional, tag = "2")] pub health_feedback: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct HealthFeedback { #[prost(uint64, tag = "1")] pub store_id: u64, @@ -2376,7 +2231,6 @@ pub struct HealthFeedback { #[prost(int32, tag = "3")] pub slow_score: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BroadcastTxnStatusRequest { #[prost(message, optional, tag = "1")] @@ -2384,8 +2238,7 @@ pub struct BroadcastTxnStatusRequest { #[prost(message, repeated, tag = "2")] pub txn_status: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TxnStatus { #[prost(uint64, tag = "1")] pub start_ts: u64, @@ -2401,8 +2254,7 @@ pub struct TxnStatus { #[prost(bool, tag = "5")] pub is_completed: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct BroadcastTxnStatusResponse {} /// Used to specify the behavior when a pessimistic lock request is woken up after waiting for another /// lock. @@ -2426,8 +2278,8 @@ impl PessimisticLockWakeUpMode { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PessimisticLockWakeUpMode::WakeUpModeNormal => "WakeUpModeNormal", - PessimisticLockWakeUpMode::WakeUpModeForceLock => "WakeUpModeForceLock", + Self::WakeUpModeNormal => "WakeUpModeNormal", + Self::WakeUpModeForceLock => "WakeUpModeForceLock", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2453,11 +2305,9 @@ impl PessimisticLockKeyResultType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PessimisticLockKeyResultType::LockResultNormal => "LockResultNormal", - PessimisticLockKeyResultType::LockResultLockedWithConflict => { - "LockResultLockedWithConflict" - } - PessimisticLockKeyResultType::LockResultFailed => "LockResultFailed", + Self::LockResultNormal => "LockResultNormal", + Self::LockResultLockedWithConflict => "LockResultLockedWithConflict", + Self::LockResultFailed => "LockResultFailed", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2488,9 +2338,9 @@ impl CommitRole { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - CommitRole::Unknown => "Unknown", - CommitRole::Primary => "Primary", - CommitRole::Secondary => "Secondary", + Self::Unknown => "Unknown", + Self::Primary => "Primary", + Self::Secondary => "Secondary", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2516,8 +2366,8 @@ impl RequestOrigin { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - RequestOrigin::Unknown => "RequestOriginUnknown", - RequestOrigin::TiDb => "RequestOriginTiDB", + Self::Unknown => "RequestOriginUnknown", + Self::TiDb => "RequestOriginTiDB", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2574,11 +2424,9 @@ pub enum ApiVersion { /// /// ## Bit 1 is for deletion. If set, the entry is logical deleted. /// - /// |Meta flags| - /// |----------| - /// |0x02 (0b00000010)| + /// ## \| Meta flags | /// - /// --- + /// ## \| 0x02 (0b00000010) | /// /// V2 server accpets V2 requests and V1 transactional requests that statrts with TiDB key /// prefix (`m` and `t`). @@ -2591,9 +2439,9 @@ impl ApiVersion { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ApiVersion::V1 => "V1", - ApiVersion::V1ttl => "V1TTL", - ApiVersion::V2 => "V2", + Self::V1 => "V1", + Self::V1ttl => "V1TTL", + Self::V2 => "V2", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2621,9 +2469,9 @@ impl CommandPri { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - CommandPri::Normal => "Normal", - CommandPri::Low => "Low", - CommandPri::High => "High", + Self::Normal => "Normal", + Self::Low => "Low", + Self::High => "High", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2653,9 +2501,9 @@ impl IsolationLevel { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - IsolationLevel::Si => "SI", - IsolationLevel::Rc => "RC", - IsolationLevel::RcCheckTs => "RCCheckTS", + Self::Si => "SI", + Self::Rc => "RC", + Self::RcCheckTs => "RCCheckTS", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2686,9 +2534,9 @@ impl DiskFullOpt { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - DiskFullOpt::NotAllowedOnFull => "NotAllowedOnFull", - DiskFullOpt::AllowedOnAlmostFull => "AllowedOnAlmostFull", - DiskFullOpt::AllowedOnAlreadyFull => "AllowedOnAlreadyFull", + Self::NotAllowedOnFull => "NotAllowedOnFull", + Self::AllowedOnAlmostFull => "AllowedOnAlmostFull", + Self::AllowedOnAlreadyFull => "AllowedOnAlreadyFull", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2725,15 +2573,15 @@ impl Op { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Op::Put => "Put", - Op::Del => "Del", - Op::Lock => "Lock", - Op::Rollback => "Rollback", - Op::Insert => "Insert", - Op::PessimisticLock => "PessimisticLock", - Op::CheckNotExists => "CheckNotExists", - Op::SharedLock => "SharedLock", - Op::SharedPessimisticLock => "SharedPessimisticLock", + Self::Put => "Put", + Self::Del => "Del", + Self::Lock => "Lock", + Self::Rollback => "Rollback", + Self::Insert => "Insert", + Self::PessimisticLock => "PessimisticLock", + Self::CheckNotExists => "CheckNotExists", + Self::SharedLock => "SharedLock", + Self::SharedPessimisticLock => "SharedPessimisticLock", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2766,9 +2614,9 @@ impl Assertion { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Assertion::None => "None", - Assertion::Exist => "Exist", - Assertion::NotExist => "NotExist", + Self::None => "None", + Self::Exist => "Exist", + Self::NotExist => "NotExist", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2798,9 +2646,9 @@ impl AssertionLevel { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - AssertionLevel::Off => "Off", - AssertionLevel::Fast => "Fast", - AssertionLevel::Strict => "Strict", + Self::Off => "Off", + Self::Fast => "Fast", + Self::Strict => "Strict", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2830,12 +2678,12 @@ impl Action { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Action::NoAction => "NoAction", - Action::TtlExpireRollback => "TTLExpireRollback", - Action::LockNotExistRollback => "LockNotExistRollback", - Action::MinCommitTsPushed => "MinCommitTSPushed", - Action::TtlExpirePessimisticRollback => "TTLExpirePessimisticRollback", - Action::LockNotExistDoNothing => "LockNotExistDoNothing", + Self::NoAction => "NoAction", + Self::TtlExpireRollback => "TTLExpireRollback", + Self::LockNotExistRollback => "LockNotExistRollback", + Self::MinCommitTsPushed => "MinCommitTSPushed", + Self::TtlExpirePessimisticRollback => "TTLExpirePessimisticRollback", + Self::LockNotExistDoNothing => "LockNotExistDoNothing", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2865,8 +2713,8 @@ impl ExtraOp { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ExtraOp::Noop => "Noop", - ExtraOp::ReadOldValue => "ReadOldValue", + Self::Noop => "Noop", + Self::ReadOldValue => "ReadOldValue", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2890,7 +2738,7 @@ impl ChecksumAlgorithm { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ChecksumAlgorithm::Crc64Xor => "Crc64_Xor", + Self::Crc64Xor => "Crc64_Xor", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/logbackup.rs b/src/generated/logbackup.rs index ecc33476..cef00276 100644 --- a/src/generated/logbackup.rs +++ b/src/generated/logbackup.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// The minimal information for identify a region. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionIdentity { #[prost(uint64, tag = "1")] pub id: u64, @@ -10,7 +9,6 @@ pub struct RegionIdentity { pub epoch_version: u64, } /// The last flush ts with region information. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionCheckpoint { #[prost(message, optional, tag = "1")] @@ -20,32 +18,27 @@ pub struct RegionCheckpoint { #[prost(uint64, tag = "3")] pub checkpoint: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLastFlushTsOfRegionRequest { #[prost(message, repeated, tag = "1")] pub regions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLastFlushTsOfRegionResponse { #[prost(message, repeated, tag = "1")] pub checkpoints: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SubscribeFlushEventRequest { #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SubscribeFlushEventResponse { #[prost(message, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlushEvent { #[prost(bytes = "vec", tag = "1")] pub start_key: ::prost::alloc::vec::Vec, @@ -54,17 +47,14 @@ pub struct FlushEvent { #[prost(uint64, tag = "3")] pub checkpoint: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlushNowRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FlushNowResponse { #[prost(message, repeated, tag = "1")] pub results: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlushResult { #[prost(string, tag = "1")] pub task_name: ::prost::alloc::string::String, @@ -75,7 +65,13 @@ pub struct FlushResult { } /// Generated client implementations. pub mod log_backup_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// The log backup service. @@ -99,10 +95,10 @@ pub mod log_backup_client { } impl LogBackupClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -120,14 +116,14 @@ pub mod log_backup_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { LogBackupClient::new(InterceptedService::new(inner, interceptor)) } @@ -173,12 +169,11 @@ pub mod log_backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/logbackup.LogBackup/GetLastFlushTSOfRegion", ); @@ -200,12 +195,11 @@ pub mod log_backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/logbackup.LogBackup/SubscribeFlushEvent", ); @@ -225,12 +219,11 @@ pub mod log_backup_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/logbackup.LogBackup/FlushNow", ); diff --git a/src/generated/meta_storagepb.rs b/src/generated/meta_storagepb.rs index a0c67c24..cec3ce2a 100644 --- a/src/generated/meta_storagepb.rs +++ b/src/generated/meta_storagepb.rs @@ -1,14 +1,12 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(enumeration = "ErrorType", tag = "1")] pub r#type: i32, #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RequestHeader { /// cluster_id is the ID of the cluster which be sent to. #[prost(uint64, tag = "1")] @@ -17,8 +15,7 @@ pub struct RequestHeader { #[prost(string, tag = "2")] pub source: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResponseHeader { /// cluster_id is the ID of the cluster which sent the response. #[prost(uint64, tag = "1")] @@ -29,8 +26,7 @@ pub struct ResponseHeader { pub revision: i64, } /// copied part of -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WatchRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -44,7 +40,6 @@ pub struct WatchRequest { pub prev_kv: bool, } /// copied part of -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WatchResponse { #[prost(message, optional, tag = "1")] @@ -55,8 +50,7 @@ pub struct WatchResponse { pub events: ::prost::alloc::vec::Vec, } /// copied part of -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -70,7 +64,6 @@ pub struct GetRequest { pub revision: i64, } /// copied part of -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetResponse { #[prost(message, optional, tag = "1")] @@ -83,8 +76,7 @@ pub struct GetResponse { pub count: i64, } /// copied part of -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -98,8 +90,7 @@ pub struct PutRequest { pub prev_kv: bool, } /// copied part of -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -107,8 +98,7 @@ pub struct PutResponse { pub prev_kv: ::core::option::Option, } /// copied from etcd -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -126,7 +116,6 @@ pub struct DeleteRequest { #[prost(bool, tag = "4")] pub prev_kv: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeleteResponse { #[prost(message, optional, tag = "1")] @@ -138,8 +127,7 @@ pub struct DeleteResponse { pub prev_kvs: ::prost::alloc::vec::Vec, } /// copied from etcd -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyValue { /// key is the key in bytes. An empty key is not allowed. #[prost(bytes = "vec", tag = "1")] @@ -165,8 +153,7 @@ pub struct KeyValue { pub lease: i64, } /// copied from etcd -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Event { /// type is the kind of event. If type is a PUT, it indicates /// new data has been stored to the key. If type is a DELETE, @@ -209,8 +196,8 @@ pub mod event { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - EventType::Put => "PUT", - EventType::Delete => "DELETE", + Self::Put => "PUT", + Self::Delete => "DELETE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -238,9 +225,9 @@ impl ErrorType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ErrorType::Ok => "OK", - ErrorType::Unknown => "UNKNOWN", - ErrorType::DataCompacted => "DATA_COMPACTED", + Self::Ok => "OK", + Self::Unknown => "UNKNOWN", + Self::DataCompacted => "DATA_COMPACTED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -255,7 +242,13 @@ impl ErrorType { } /// Generated client implementations. pub mod meta_storage_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// MetaStorage is the meta storage service. @@ -276,10 +269,10 @@ pub mod meta_storage_client { } impl MetaStorageClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -297,14 +290,14 @@ pub mod meta_storage_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { MetaStorageClient::new(InterceptedService::new(inner, interceptor)) } @@ -350,12 +343,11 @@ pub mod meta_storage_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/meta_storagepb.MetaStorage/Watch", ); @@ -374,12 +366,11 @@ pub mod meta_storage_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/meta_storagepb.MetaStorage/Get", ); @@ -396,12 +387,11 @@ pub mod meta_storage_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/meta_storagepb.MetaStorage/Put", ); @@ -420,12 +410,11 @@ pub mod meta_storage_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/meta_storagepb.MetaStorage/Delete", ); diff --git a/src/generated/metapb.rs b/src/generated/metapb.rs index 7ee897eb..8fd19e1f 100644 --- a/src/generated/metapb.rs +++ b/src/generated/metapb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Cluster { #[prost(uint64, tag = "1")] pub id: u64, @@ -12,15 +11,13 @@ pub struct Cluster { pub max_peer_count: u32, } /// Case insensitive key/value for replica constraints. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreLabel { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Store { #[prost(uint64, tag = "1")] @@ -58,8 +55,7 @@ pub struct Store { #[prost(enumeration = "NodeState", tag = "13")] pub node_state: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionEpoch { /// Conf change version, auto increment when add or remove peer #[prost(uint64, tag = "1")] @@ -68,8 +64,7 @@ pub struct RegionEpoch { #[prost(uint64, tag = "2")] pub version: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct BucketStats { /// total read in bytes of each bucket #[prost(uint64, repeated, tag = "1")] @@ -90,8 +85,7 @@ pub struct BucketStats { #[prost(uint64, repeated, tag = "6")] pub write_keys: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Buckets { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -108,8 +102,7 @@ pub struct Buckets { #[prost(uint64, tag = "5")] pub period_in_ms: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct BucketMeta { /// A hint indicate if keys have changed. #[prost(uint64, tag = "1")] @@ -118,7 +111,6 @@ pub struct BucketMeta { #[prost(bytes = "vec", repeated, tag = "2")] pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Region { #[prost(uint64, tag = "1")] @@ -146,8 +138,7 @@ pub struct Region { #[prost(uint64, tag = "8")] pub flashback_start_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Peer { #[prost(uint64, tag = "1")] pub id: u64, @@ -172,9 +163,9 @@ impl StoreState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - StoreState::Up => "Up", - StoreState::Offline => "Offline", - StoreState::Tombstone => "Tombstone", + Self::Up => "Up", + Self::Offline => "Offline", + Self::Tombstone => "Tombstone", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -206,10 +197,10 @@ impl NodeState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - NodeState::Preparing => "Preparing", - NodeState::Serving => "Serving", - NodeState::Removing => "Removing", - NodeState::Removed => "Removed", + Self::Preparing => "Preparing", + Self::Serving => "Serving", + Self::Removing => "Removing", + Self::Removed => "Removed", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -247,10 +238,10 @@ impl PeerRole { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PeerRole::Voter => "Voter", - PeerRole::Learner => "Learner", - PeerRole::IncomingVoter => "IncomingVoter", - PeerRole::DemotingVoter => "DemotingVoter", + Self::Voter => "Voter", + Self::Learner => "Learner", + Self::IncomingVoter => "IncomingVoter", + Self::DemotingVoter => "DemotingVoter", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/mpp.rs b/src/generated/mpp.rs index 2ee84475..468551cb 100644 --- a/src/generated/mpp.rs +++ b/src/generated/mpp.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// TaskMeta contains meta of a mpp plan, including query's ts and task address. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TaskMeta { /// start ts of a query #[prost(uint64, tag = "1")] @@ -55,11 +54,9 @@ pub struct TaskMeta { #[prost(string, tag = "21")] pub plan_digest: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct IsAliveRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct IsAliveResponse { #[prost(bool, tag = "1")] pub available: bool, @@ -67,7 +64,6 @@ pub struct IsAliveResponse { pub mpp_version: i64, } /// Dipsatch the task request to different tiflash servers. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DispatchTaskRequest { #[prost(message, optional, tag = "1")] @@ -89,7 +85,6 @@ pub struct DispatchTaskRequest { pub table_shard_infos: ::prost::alloc::vec::Vec, } /// Get response of DispatchTaskRequest. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DispatchTaskResponse { #[prost(message, optional, tag = "1")] @@ -98,24 +93,21 @@ pub struct DispatchTaskResponse { pub retry_regions: ::prost::alloc::vec::Vec, } /// CancelTaskRequest closes the execution of a task. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CancelTaskRequest { #[prost(message, optional, tag = "1")] pub meta: ::core::option::Option, #[prost(message, optional, tag = "2")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CancelTaskResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } /// ReportTaskStatus reports the execution status of a task. /// when TiFlash reports status to TiDB, ReportTaskStatusRequest serialize tipb.TiFlashExecutionInfo into data; -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportTaskStatusRequest { #[prost(message, optional, tag = "1")] pub meta: ::core::option::Option, @@ -124,15 +116,13 @@ pub struct ReportTaskStatusRequest { #[prost(message, optional, tag = "3")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportTaskStatusResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } /// build connection between different tasks. Data is sent by the tasks that are closer to the data sources. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct EstablishMppConnectionRequest { /// node closer to the source #[prost(message, optional, tag = "1")] @@ -143,8 +133,7 @@ pub struct EstablishMppConnectionRequest { } /// when TiFlash sends data to TiDB, Data packets wrap tipb.SelectResponse, i.e., serialize tipb.SelectResponse into data; /// when TiFlash sends data to TiFlash, data blocks are serialized into chunks, and the execution_summaries in tipb.SelectResponse are serialized into data only for the last packet. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct MppDataPacket { #[prost(bytes = "vec", tag = "1")] pub data: ::prost::alloc::vec::Vec, @@ -158,8 +147,7 @@ pub struct MppDataPacket { #[prost(int64, tag = "5")] pub version: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(int32, tag = "1")] pub code: i32, diff --git a/src/generated/pdpb.rs b/src/generated/pdpb.rs index 77187056..71a8dfb0 100644 --- a/src/generated/pdpb.rs +++ b/src/generated/pdpb.rs @@ -1,13 +1,11 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WatchGlobalConfigRequest { #[prost(string, tag = "1")] pub config_path: ::prost::alloc::string::String, #[prost(int64, tag = "2")] pub revision: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WatchGlobalConfigResponse { #[prost(message, repeated, tag = "1")] @@ -17,7 +15,6 @@ pub struct WatchGlobalConfigResponse { #[prost(message, optional, tag = "3")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreGlobalConfigRequest { #[prost(message, repeated, tag = "1")] @@ -25,21 +22,18 @@ pub struct StoreGlobalConfigRequest { #[prost(string, tag = "2")] pub config_path: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreGlobalConfigResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct LoadGlobalConfigRequest { #[prost(string, repeated, tag = "1")] pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(string, tag = "2")] pub config_path: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LoadGlobalConfigResponse { #[prost(message, repeated, tag = "1")] @@ -47,8 +41,7 @@ pub struct LoadGlobalConfigResponse { #[prost(int64, tag = "2")] pub revision: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GlobalConfigItem { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, @@ -64,8 +57,7 @@ pub struct GlobalConfigItem { #[prost(bytes = "vec", tag = "5")] pub payload: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RequestHeader { /// cluster_id is the ID of the cluster which be sent to. #[prost(uint64, tag = "1")] @@ -83,8 +75,7 @@ pub struct RequestHeader { #[prost(string, tag = "4")] pub caller_component: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResponseHeader { /// cluster_id is the ID of the cluster which sent the response. #[prost(uint64, tag = "1")] @@ -92,16 +83,14 @@ pub struct ResponseHeader { #[prost(message, optional, tag = "2")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(enumeration = "ErrorType", tag = "1")] pub r#type: i32, #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TsoRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -110,8 +99,7 @@ pub struct TsoRequest { #[prost(string, tag = "3")] pub dc_location: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Timestamp { #[prost(int64, tag = "1")] pub physical: i64, @@ -122,8 +110,7 @@ pub struct Timestamp { #[prost(uint32, tag = "3")] pub suffix_bits: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TsoResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -132,7 +119,6 @@ pub struct TsoResponse { #[prost(message, optional, tag = "3")] pub timestamp: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BootstrapRequest { #[prost(message, optional, tag = "1")] @@ -142,8 +128,7 @@ pub struct BootstrapRequest { #[prost(message, optional, tag = "3")] pub region: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct BootstrapResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -152,30 +137,26 @@ pub struct BootstrapResponse { super::replication_modepb::ReplicationStatus, >, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct IsBootstrappedRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct IsBootstrappedResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(bool, tag = "2")] pub bootstrapped: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AllocIdRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint32, tag = "2")] pub count: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AllocIdResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -184,29 +165,25 @@ pub struct AllocIdResponse { #[prost(uint32, tag = "3")] pub count: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct IsSnapshotRecoveringRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct IsSnapshotRecoveringResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(bool, tag = "2")] pub marked: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetStoreRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub store_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetStoreResponse { #[prost(message, optional, tag = "1")] @@ -216,7 +193,6 @@ pub struct GetStoreResponse { #[prost(message, optional, tag = "3")] pub stats: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PutStoreRequest { #[prost(message, optional, tag = "1")] @@ -224,8 +200,7 @@ pub struct PutStoreRequest { #[prost(message, optional, tag = "2")] pub store: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutStoreResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -234,8 +209,7 @@ pub struct PutStoreResponse { super::replication_modepb::ReplicationStatus, >, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAllStoresRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -243,7 +217,6 @@ pub struct GetAllStoresRequest { #[prost(bool, tag = "2")] pub exclude_tombstone_stores: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAllStoresResponse { #[prost(message, optional, tag = "1")] @@ -251,8 +224,7 @@ pub struct GetAllStoresResponse { #[prost(message, repeated, tag = "2")] pub stores: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRegionRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -261,7 +233,6 @@ pub struct GetRegionRequest { #[prost(bool, tag = "3")] pub need_buckets: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetRegionResponse { #[prost(message, optional, tag = "1")] @@ -281,8 +252,7 @@ pub struct GetRegionResponse { #[prost(message, optional, tag = "7")] pub buckets: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRegionByIdRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -291,8 +261,7 @@ pub struct GetRegionByIdRequest { #[prost(bool, tag = "3")] pub need_buckets: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct QueryRegionRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -309,7 +278,6 @@ pub struct QueryRegionRequest { #[prost(bytes = "vec", repeated, tag = "5")] pub prev_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRegionResponse { #[prost(message, optional, tag = "1")] @@ -326,7 +294,6 @@ pub struct QueryRegionResponse { #[prost(map = "uint64, message", tag = "4")] pub regions_by_id: ::std::collections::HashMap, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionResponse { #[prost(message, optional, tag = "1")] @@ -342,8 +309,7 @@ pub struct RegionResponse { } /// Use GetRegionResponse as the response of GetRegionByIDRequest. /// Deprecated: use BatchScanRegionsRequest instead. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScanRegionsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -356,7 +322,6 @@ pub struct ScanRegionsRequest { #[prost(bytes = "vec", tag = "4")] pub end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Region { #[prost(message, optional, tag = "1")] @@ -374,7 +339,6 @@ pub struct Region { #[prost(message, optional, tag = "5")] pub buckets: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScanRegionsResponse { #[prost(message, optional, tag = "1")] @@ -388,8 +352,7 @@ pub struct ScanRegionsResponse { #[prost(message, repeated, tag = "4")] pub regions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyRange { #[prost(bytes = "vec", tag = "1")] pub start_key: ::prost::alloc::vec::Vec, @@ -397,7 +360,6 @@ pub struct KeyRange { #[prost(bytes = "vec", tag = "2")] pub end_key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchScanRegionsRequest { #[prost(message, optional, tag = "1")] @@ -417,7 +379,6 @@ pub struct BatchScanRegionsRequest { #[prost(bool, tag = "5")] pub contain_all_key_range: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchScanRegionsResponse { #[prost(message, optional, tag = "1")] @@ -426,36 +387,31 @@ pub struct BatchScanRegionsResponse { #[prost(message, repeated, tag = "2")] pub regions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetClusterConfigRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetClusterConfigResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(message, optional, tag = "2")] pub cluster: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutClusterConfigRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(message, optional, tag = "2")] pub cluster: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutClusterConfigResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Member { /// name is the name of the PD member. #[prost(string, tag = "1")] @@ -478,13 +434,11 @@ pub struct Member { #[prost(string, tag = "9")] pub dc_location: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMembersRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetMembersResponse { #[prost(message, optional, tag = "1")] @@ -501,14 +455,12 @@ pub struct GetMembersResponse { Member, >, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetClusterInfoRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetClusterInfoResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -519,15 +471,13 @@ pub struct GetClusterInfoResponse { #[prost(string, repeated, tag = "3")] pub tso_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PeerStats { #[prost(message, optional, tag = "1")] pub peer: ::core::option::Option, #[prost(uint64, tag = "2")] pub down_seconds: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionHeartbeatRequest { #[prost(message, optional, tag = "1")] @@ -595,22 +545,19 @@ pub struct RegionHeartbeatRequest { #[prost(message, optional, tag = "20")] pub bucket_meta: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ChangePeer { #[prost(message, optional, tag = "1")] pub peer: ::core::option::Option, #[prost(enumeration = "super::eraftpb::ConfChangeType", tag = "2")] pub change_type: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangePeerV2 { /// If changes is empty, it means that to exit joint state. #[prost(message, repeated, tag = "1")] pub changes: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransferLeader { #[prost(message, optional, tag = "1")] @@ -618,42 +565,36 @@ pub struct TransferLeader { #[prost(message, repeated, tag = "2")] pub peers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Merge { #[prost(message, optional, tag = "1")] pub target: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitRegion { #[prost(enumeration = "CheckPolicy", tag = "1")] pub policy: i32, #[prost(bytes = "vec", repeated, tag = "2")] pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SwitchWitness { #[prost(uint64, tag = "1")] pub peer_id: u64, #[prost(bool, tag = "2")] pub is_witness: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchSwitchWitness { #[prost(message, repeated, tag = "1")] pub switch_witnesses: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ChangeSplit { /// auto_split_enabled configures whether the corresponding Region is allowed to be auto split by size or load. #[prost(bool, tag = "1")] pub auto_split_enabled: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionHeartbeatResponse { #[prost(message, optional, tag = "1")] @@ -704,7 +645,6 @@ pub struct RegionHeartbeatResponse { #[prost(message, optional, tag = "11")] pub change_split: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AskSplitRequest { #[prost(message, optional, tag = "1")] @@ -712,8 +652,7 @@ pub struct AskSplitRequest { #[prost(message, optional, tag = "2")] pub region: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AskSplitResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -726,7 +665,6 @@ pub struct AskSplitResponse { #[prost(uint64, repeated, tag = "3")] pub new_peer_ids: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReportSplitRequest { #[prost(message, optional, tag = "1")] @@ -736,13 +674,11 @@ pub struct ReportSplitRequest { #[prost(message, optional, tag = "3")] pub right: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportSplitResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AskBatchSplitRequest { #[prost(message, optional, tag = "1")] @@ -754,15 +690,13 @@ pub struct AskBatchSplitRequest { #[prost(enumeration = "SplitReason", tag = "4")] pub reason: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitId { #[prost(uint64, tag = "1")] pub new_region_id: u64, #[prost(uint64, repeated, tag = "2")] pub new_peer_ids: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AskBatchSplitResponse { #[prost(message, optional, tag = "1")] @@ -770,7 +704,6 @@ pub struct AskBatchSplitResponse { #[prost(message, repeated, tag = "2")] pub ids: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReportBatchSplitRequest { #[prost(message, optional, tag = "1")] @@ -778,14 +711,12 @@ pub struct ReportBatchSplitRequest { #[prost(message, repeated, tag = "2")] pub regions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportBatchSplitResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TimeInterval { /// The unix timestamp in seconds of the start of this period. #[prost(uint64, tag = "1")] @@ -794,16 +725,14 @@ pub struct TimeInterval { #[prost(uint64, tag = "2")] pub end_timestamp: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RecordPair { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, #[prost(uint64, tag = "2")] pub value: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PeerStat { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -822,7 +751,6 @@ pub struct PeerStat { #[prost(message, optional, tag = "7")] pub cpu_stats: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreStats { #[prost(uint64, tag = "1")] @@ -921,8 +849,7 @@ pub struct StoreStats { #[prost(bool, tag = "32")] pub is_stopping: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DfsStatScope { /// When true, the statistic is not tied to any keyspace. #[prost(bool, tag = "1")] @@ -934,8 +861,7 @@ pub struct DfsStatScope { #[prost(string, tag = "3")] pub component: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DfsStatItem { #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, @@ -946,8 +872,7 @@ pub struct DfsStatItem { #[prost(uint64, tag = "3")] pub write_requests: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct SlowTrend { #[prost(double, tag = "1")] pub cause_value: f64, @@ -958,8 +883,7 @@ pub struct SlowTrend { #[prost(double, tag = "4")] pub result_rate: f64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SnapshotStat { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -978,7 +902,6 @@ pub struct SnapshotStat { #[prost(uint64, tag = "5")] pub transport_size: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PeerReport { #[prost(message, optional, tag = "1")] @@ -994,7 +917,6 @@ pub struct PeerReport { #[prost(uint64, tag = "5")] pub applied_index: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreReport { #[prost(message, repeated, tag = "1")] @@ -1002,7 +924,6 @@ pub struct StoreReport { #[prost(uint64, tag = "2")] pub step: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreHeartbeatRequest { #[prost(message, optional, tag = "1")] @@ -1017,7 +938,6 @@ pub struct StoreHeartbeatRequest { super::replication_modepb::StoreDrAutoSyncStatus, >, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DemoteFailedVoters { #[prost(uint64, tag = "1")] @@ -1025,8 +945,7 @@ pub struct DemoteFailedVoters { #[prost(message, repeated, tag = "2")] pub failed_voters: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ForceLeader { /// The store ids of the failed stores, TiKV uses it to decide if a peer is alive. #[prost(uint64, repeated, tag = "1")] @@ -1035,7 +954,6 @@ pub struct ForceLeader { #[prost(uint64, repeated, tag = "2")] pub enter_force_leaders: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RecoveryPlan { /// Create empty regions to fill the key range hole. @@ -1059,20 +977,17 @@ pub struct RecoveryPlan { #[prost(uint64, tag = "6")] pub step: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AwakenRegions { /// Awake all regions if abnormal_stores is empty. #[prost(uint64, repeated, tag = "1")] pub abnormal_stores: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ControlGrpc { #[prost(enumeration = "ControlGrpcEvent", tag = "1")] pub ctrl_event: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreHeartbeatResponse { #[prost(message, optional, tag = "1")] @@ -1103,7 +1018,6 @@ pub struct StoreHeartbeatResponse { #[prost(enumeration = "super::metapb::NodeState", tag = "8")] pub state: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScatterRegionRequest { #[prost(message, optional, tag = "1")] @@ -1129,8 +1043,7 @@ pub struct ScatterRegionRequest { #[prost(bool, tag = "8")] pub skip_store_limit: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScatterRegionResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1139,38 +1052,33 @@ pub struct ScatterRegionResponse { #[prost(uint64, repeated, tag = "3")] pub failed_regions_id: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetGcSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetGcSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateGcSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateGcSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub new_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateServiceGcSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1181,8 +1089,7 @@ pub struct UpdateServiceGcSafePointRequest { #[prost(uint64, tag = "4")] pub safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateServiceGcSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1193,24 +1100,21 @@ pub struct UpdateServiceGcSafePointResponse { #[prost(uint64, tag = "4")] pub min_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetGcSafePointV2Request { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint32, tag = "2")] pub keyspace_id: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetGcSafePointV2Response { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WatchGcSafePointV2Request { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1218,8 +1122,7 @@ pub struct WatchGcSafePointV2Request { pub revision: i64, } /// SafePointEvent is for the rpc WatchGCSafePointV2. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SafePointEvent { #[prost(uint32, tag = "1")] pub keyspace_id: u32, @@ -1228,7 +1131,6 @@ pub struct SafePointEvent { #[prost(enumeration = "EventType", tag = "3")] pub r#type: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WatchGcSafePointV2Response { #[prost(message, optional, tag = "1")] @@ -1238,8 +1140,7 @@ pub struct WatchGcSafePointV2Response { #[prost(int64, tag = "3")] pub revision: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateGcSafePointV2Request { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1248,16 +1149,14 @@ pub struct UpdateGcSafePointV2Request { #[prost(uint64, tag = "3")] pub safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateGcSafePointV2Response { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub new_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateServiceSafePointV2Request { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1275,8 +1174,7 @@ pub struct UpdateServiceSafePointV2Request { #[prost(int64, tag = "5")] pub ttl: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateServiceSafePointV2Response { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1287,21 +1185,18 @@ pub struct UpdateServiceSafePointV2Response { #[prost(uint64, tag = "4")] pub min_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAllGcSafePointV2Request { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GcSafePointV2 { #[prost(uint32, tag = "1")] pub keyspace_id: u32, #[prost(uint64, tag = "2")] pub gc_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAllGcSafePointV2Response { #[prost(message, optional, tag = "1")] @@ -1315,14 +1210,12 @@ pub struct GetAllGcSafePointV2Response { /// When a field is not specified in proto3, its value will be regarded as 0; however, keyspace_id = 0 is regarded as a valid keyspace (which /// is the "DEFAULT" keyspace). To distinguish unspecified keyspace (NullKeyspace, 0xffffffff) and the default keyspace in some APIs as well /// as preventing potential misuse, we wrap the keyspace_id into a message type which is nullable. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyspaceScope { #[prost(uint32, tag = "1")] pub keyspace_id: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AdvanceGcSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1331,8 +1224,7 @@ pub struct AdvanceGcSafePointRequest { #[prost(uint64, tag = "3")] pub target: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AdvanceGcSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1341,8 +1233,7 @@ pub struct AdvanceGcSafePointResponse { #[prost(uint64, tag = "3")] pub new_gc_safe_point: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AdvanceTxnSafePointRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1351,8 +1242,7 @@ pub struct AdvanceTxnSafePointRequest { #[prost(uint64, tag = "3")] pub target: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AdvanceTxnSafePointResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1363,8 +1253,7 @@ pub struct AdvanceTxnSafePointResponse { #[prost(string, tag = "4")] pub blocker_description: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetGcBarrierRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1377,8 +1266,7 @@ pub struct SetGcBarrierRequest { #[prost(int64, tag = "5")] pub ttl_seconds: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GcBarrierInfo { #[prost(string, tag = "1")] pub barrier_id: ::prost::alloc::string::String, @@ -1387,16 +1275,14 @@ pub struct GcBarrierInfo { #[prost(int64, tag = "3")] pub ttl_seconds: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetGcBarrierResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(message, optional, tag = "2")] pub new_barrier_info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteGcBarrierRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1405,16 +1291,14 @@ pub struct DeleteGcBarrierRequest { #[prost(string, tag = "3")] pub barrier_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteGcBarrierResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(message, optional, tag = "2")] pub deleted_barrier_info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetGlobalGcBarrierRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1425,32 +1309,28 @@ pub struct SetGlobalGcBarrierRequest { #[prost(int64, tag = "4")] pub ttl_seconds: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetGlobalGcBarrierResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(message, optional, tag = "2")] pub new_barrier_info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteGlobalGcBarrierRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(string, tag = "2")] pub barrier_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteGlobalGcBarrierResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(message, optional, tag = "2")] pub deleted_barrier_info: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GlobalGcBarrierInfo { #[prost(string, tag = "1")] pub barrier_id: ::prost::alloc::string::String, @@ -1459,8 +1339,7 @@ pub struct GlobalGcBarrierInfo { #[prost(int64, tag = "3")] pub ttl_seconds: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetGcStateRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1469,7 +1348,6 @@ pub struct GetGcStateRequest { #[prost(bool, tag = "3")] pub exclude_gc_barriers: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GcState { #[prost(message, optional, tag = "1")] @@ -1483,7 +1361,6 @@ pub struct GcState { #[prost(message, repeated, tag = "5")] pub gc_barriers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetGcStateResponse { #[prost(message, optional, tag = "1")] @@ -1491,8 +1368,7 @@ pub struct GetGcStateResponse { #[prost(message, optional, tag = "2")] pub gc_state: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAllKeyspacesGcStatesRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1501,7 +1377,6 @@ pub struct GetAllKeyspacesGcStatesRequest { #[prost(bool, tag = "3")] pub exclude_global_gc_barriers: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAllKeyspacesGcStatesResponse { #[prost(message, optional, tag = "1")] @@ -1511,8 +1386,7 @@ pub struct GetAllKeyspacesGcStatesResponse { #[prost(message, repeated, tag = "3")] pub global_gc_barriers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionStat { /// Bytes read/written during this period. #[prost(uint64, tag = "1")] @@ -1525,8 +1399,7 @@ pub struct RegionStat { #[prost(uint64, tag = "4")] pub keys_read: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SyncRegionRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1537,19 +1410,16 @@ pub struct SyncRegionRequest { #[prost(uint64, tag = "3")] pub start_index: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PeersStats { #[prost(message, repeated, tag = "1")] pub peers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Peers { #[prost(message, repeated, tag = "1")] pub peers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SyncRegionResponse { #[prost(message, optional, tag = "1")] @@ -1572,16 +1442,14 @@ pub struct SyncRegionResponse { #[prost(message, repeated, tag = "17")] pub pending_peers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetOperatorRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetOperatorResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1594,8 +1462,7 @@ pub struct GetOperatorResponse { #[prost(bytes = "vec", tag = "5")] pub kind: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SyncMaxTsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1605,8 +1472,7 @@ pub struct SyncMaxTsRequest { #[prost(bool, tag = "3")] pub skip_check: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SyncMaxTsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1615,8 +1481,7 @@ pub struct SyncMaxTsResponse { #[prost(string, repeated, tag = "3")] pub synced_dcs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitRegionsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1625,8 +1490,7 @@ pub struct SplitRegionsRequest { #[prost(uint64, tag = "3")] pub retry_limit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitRegionsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1635,8 +1499,7 @@ pub struct SplitRegionsResponse { #[prost(uint64, repeated, tag = "3")] pub regions_id: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitAndScatterRegionsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1647,8 +1510,7 @@ pub struct SplitAndScatterRegionsRequest { #[prost(uint64, tag = "4")] pub retry_limit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitAndScatterRegionsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1659,16 +1521,14 @@ pub struct SplitAndScatterRegionsResponse { #[prost(uint64, repeated, tag = "4")] pub regions_id: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetDcLocationInfoRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(string, tag = "2")] pub dc_location: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetDcLocationInfoResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1680,8 +1540,7 @@ pub struct GetDcLocationInfoResponse { #[prost(message, optional, tag = "3")] pub max_ts: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct QueryStats { #[prost(uint64, tag = "1")] pub gc: u64, @@ -1707,8 +1566,7 @@ pub struct QueryStats { pub rollback: u64, } /// CPU usage breakdown by kind. New kinds may be added in the future. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CpuStats { /// UnifiedRead is the CPU usage of the unified read pool. #[prost(uint64, tag = "1")] @@ -1717,8 +1575,7 @@ pub struct CpuStats { #[prost(uint64, tag = "2")] pub scheduler: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportBucketsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1727,14 +1584,12 @@ pub struct ReportBucketsRequest { #[prost(message, optional, tag = "3")] pub buckets: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportBucketsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportMinResolvedTsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1743,48 +1598,41 @@ pub struct ReportMinResolvedTsRequest { #[prost(uint64, tag = "3")] pub min_resolved_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReportMinResolvedTsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetExternalTimestampRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub timestamp: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SetExternalTimestampResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetExternalTimestampRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetExternalTimestampResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub timestamp: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMinTsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMinTsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -1804,8 +1652,8 @@ impl EventType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - EventType::Put => "PUT", - EventType::Delete => "DELETE", + Self::Put => "PUT", + Self::Delete => "DELETE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1842,21 +1690,19 @@ impl ErrorType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ErrorType::Ok => "OK", - ErrorType::Unknown => "UNKNOWN", - ErrorType::NotBootstrapped => "NOT_BOOTSTRAPPED", - ErrorType::StoreTombstone => "STORE_TOMBSTONE", - ErrorType::AlreadyBootstrapped => "ALREADY_BOOTSTRAPPED", - ErrorType::IncompatibleVersion => "INCOMPATIBLE_VERSION", - ErrorType::RegionNotFound => "REGION_NOT_FOUND", - ErrorType::GlobalConfigNotFound => "GLOBAL_CONFIG_NOT_FOUND", - ErrorType::DuplicatedEntry => "DUPLICATED_ENTRY", - ErrorType::EntryNotFound => "ENTRY_NOT_FOUND", - ErrorType::InvalidValue => "INVALID_VALUE", - ErrorType::DataCompacted => "DATA_COMPACTED", - ErrorType::RegionsNotContainAllKeyRange => { - "REGIONS_NOT_CONTAIN_ALL_KEY_RANGE" - } + Self::Ok => "OK", + Self::Unknown => "UNKNOWN", + Self::NotBootstrapped => "NOT_BOOTSTRAPPED", + Self::StoreTombstone => "STORE_TOMBSTONE", + Self::AlreadyBootstrapped => "ALREADY_BOOTSTRAPPED", + Self::IncompatibleVersion => "INCOMPATIBLE_VERSION", + Self::RegionNotFound => "REGION_NOT_FOUND", + Self::GlobalConfigNotFound => "GLOBAL_CONFIG_NOT_FOUND", + Self::DuplicatedEntry => "DUPLICATED_ENTRY", + Self::EntryNotFound => "ENTRY_NOT_FOUND", + Self::InvalidValue => "INVALID_VALUE", + Self::DataCompacted => "DATA_COMPACTED", + Self::RegionsNotContainAllKeyRange => "REGIONS_NOT_CONTAIN_ALL_KEY_RANGE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1895,9 +1741,9 @@ impl ServiceMode { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ServiceMode::UnknownSvcMode => "UNKNOWN_SVC_MODE", - ServiceMode::PdSvcMode => "PD_SVC_MODE", - ServiceMode::ApiSvcMode => "API_SVC_MODE", + Self::UnknownSvcMode => "UNKNOWN_SVC_MODE", + Self::PdSvcMode => "PD_SVC_MODE", + Self::ApiSvcMode => "API_SVC_MODE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1924,9 +1770,9 @@ impl CheckPolicy { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - CheckPolicy::Scan => "SCAN", - CheckPolicy::Approximate => "APPROXIMATE", - CheckPolicy::Usekey => "USEKEY", + Self::Scan => "SCAN", + Self::Approximate => "APPROXIMATE", + Self::Usekey => "USEKEY", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1953,9 +1799,9 @@ impl SplitReason { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - SplitReason::Admin => "ADMIN", - SplitReason::Size => "SIZE", - SplitReason::Load => "LOAD", + Self::Admin => "ADMIN", + Self::Size => "SIZE", + Self::Load => "LOAD", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1983,8 +1829,8 @@ impl ControlGrpcEvent { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ControlGrpcEvent::Pause => "PAUSE", - ControlGrpcEvent::Resume => "RESUME", + Self::Pause => "PAUSE", + Self::Resume => "RESUME", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2012,11 +1858,11 @@ impl OperatorStatus { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - OperatorStatus::Success => "SUCCESS", - OperatorStatus::Timeout => "TIMEOUT", - OperatorStatus::Cancel => "CANCEL", - OperatorStatus::Replace => "REPLACE", - OperatorStatus::Running => "RUNNING", + Self::Success => "SUCCESS", + Self::Timeout => "TIMEOUT", + Self::Cancel => "CANCEL", + Self::Replace => "REPLACE", + Self::Running => "RUNNING", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2054,18 +1900,18 @@ impl QueryKind { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - QueryKind::Others => "Others", - QueryKind::Gc => "GC", - QueryKind::Get => "Get", - QueryKind::Scan => "Scan", - QueryKind::Coprocessor => "Coprocessor", - QueryKind::Delete => "Delete", - QueryKind::DeleteRange => "DeleteRange", - QueryKind::Put => "Put", - QueryKind::Prewrite => "Prewrite", - QueryKind::AcquirePessimisticLock => "AcquirePessimisticLock", - QueryKind::Commit => "Commit", - QueryKind::Rollback => "Rollback", + Self::Others => "Others", + Self::Gc => "GC", + Self::Get => "Get", + Self::Scan => "Scan", + Self::Coprocessor => "Coprocessor", + Self::Delete => "Delete", + Self::DeleteRange => "DeleteRange", + Self::Put => "Put", + Self::Prewrite => "Prewrite", + Self::AcquirePessimisticLock => "AcquirePessimisticLock", + Self::Commit => "Commit", + Self::Rollback => "Rollback", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -2089,7 +1935,13 @@ impl QueryKind { } /// Generated client implementations. pub mod pd_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -2109,10 +1961,10 @@ pub mod pd_client { } impl PdClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -2130,14 +1982,14 @@ pub mod pd_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { PdClient::new(InterceptedService::new(inner, interceptor)) } @@ -2185,12 +2037,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetClusterInfo"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetClusterInfo")); @@ -2209,12 +2060,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetMembers"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetMembers")); @@ -2231,12 +2081,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/Tso"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "Tso")); @@ -2253,12 +2102,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/Bootstrap"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "Bootstrap")); @@ -2275,12 +2123,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/IsBootstrapped"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "IsBootstrapped")); @@ -2297,12 +2144,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/AllocID"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "AllocID")); @@ -2319,12 +2165,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/IsSnapshotRecovering", ); @@ -2344,12 +2189,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetStore"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetStore")); @@ -2366,12 +2210,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/PutStore"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "PutStore")); @@ -2388,12 +2231,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetAllStores"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetAllStores")); @@ -2410,12 +2252,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/StoreHeartbeat"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "StoreHeartbeat")); @@ -2434,12 +2275,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/RegionHeartbeat"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "RegionHeartbeat")); @@ -2456,12 +2296,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetRegion"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetRegion")); @@ -2478,12 +2317,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetPrevRegion"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetPrevRegion")); @@ -2500,12 +2338,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetRegionByID"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetRegionByID")); @@ -2524,12 +2361,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/QueryRegion"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "QueryRegion")); @@ -2547,12 +2383,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ScanRegions"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ScanRegions")); @@ -2569,17 +2404,17 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/BatchScanRegions"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "BatchScanRegions")); self.inner.unary(req, path, codec).await } + #[deprecated] pub async fn ask_split( &mut self, request: impl tonic::IntoRequest, @@ -2591,17 +2426,17 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/AskSplit"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "AskSplit")); self.inner.unary(req, path, codec).await } + #[deprecated] pub async fn report_split( &mut self, request: impl tonic::IntoRequest, @@ -2613,12 +2448,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ReportSplit"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ReportSplit")); @@ -2635,12 +2469,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/AskBatchSplit"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "AskBatchSplit")); @@ -2657,12 +2490,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ReportBatchSplit"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ReportBatchSplit")); @@ -2679,12 +2511,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetClusterConfig"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetClusterConfig")); @@ -2701,12 +2532,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/PutClusterConfig"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "PutClusterConfig")); @@ -2723,12 +2553,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ScatterRegion"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ScatterRegion")); @@ -2745,12 +2574,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetGCSafePoint"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetGCSafePoint")); @@ -2767,12 +2595,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/UpdateGCSafePoint", ); @@ -2791,12 +2618,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/UpdateServiceGCSafePoint", ); @@ -2816,12 +2642,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetGCSafePointV2"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetGCSafePointV2")); @@ -2838,12 +2663,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/WatchGCSafePointV2", ); @@ -2863,12 +2687,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/UpdateGCSafePointV2", ); @@ -2888,12 +2711,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/UpdateServiceSafePointV2", ); @@ -2913,12 +2735,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/GetAllGCSafePointV2", ); @@ -2938,12 +2759,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/AdvanceGCSafePoint", ); @@ -2963,12 +2783,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/AdvanceTxnSafePoint", ); @@ -2988,12 +2807,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/SetGCBarrier"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "SetGCBarrier")); @@ -3010,12 +2828,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/DeleteGCBarrier"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "DeleteGCBarrier")); @@ -3032,12 +2849,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/SetGlobalGCBarrier", ); @@ -3057,12 +2873,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/DeleteGlobalGCBarrier", ); @@ -3082,12 +2897,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetGCState"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetGCState")); @@ -3104,12 +2918,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/GetAllKeyspacesGCStates", ); @@ -3129,12 +2942,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/SyncRegions"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "SyncRegions")); @@ -3151,12 +2963,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetOperator"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetOperator")); @@ -3173,12 +2984,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/SyncMaxTS"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "SyncMaxTS")); @@ -3195,12 +3005,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/SplitRegions"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "SplitRegions")); @@ -3217,12 +3026,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/SplitAndScatterRegions", ); @@ -3242,12 +3050,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/GetDCLocationInfo", ); @@ -3266,12 +3073,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/StoreGlobalConfig", ); @@ -3290,12 +3096,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/LoadGlobalConfig"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "LoadGlobalConfig")); @@ -3312,12 +3117,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/WatchGlobalConfig", ); @@ -3338,12 +3142,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ReportBuckets"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ReportBuckets")); @@ -3360,12 +3163,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/ReportMinResolvedTS", ); @@ -3385,12 +3187,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/SetExternalTimestamp", ); @@ -3410,12 +3211,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/pdpb.PD/GetExternalTimestamp", ); @@ -3438,12 +3238,11 @@ pub mod pd_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetMinTS"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetMinTS")); diff --git a/src/generated/raft_cmdpb.rs b/src/generated/raft_cmdpb.rs index 1fc1e66f..1a679f29 100644 --- a/src/generated/raft_cmdpb.rs +++ b/src/generated/raft_cmdpb.rs @@ -1,20 +1,17 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetRequest { #[prost(string, tag = "1")] pub cf: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "2")] pub key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetResponse { #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutRequest { #[prost(string, tag = "1")] pub cf: ::prost::alloc::string::String, @@ -23,22 +20,18 @@ pub struct PutRequest { #[prost(bytes = "vec", tag = "3")] pub value: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteRequest { #[prost(string, tag = "1")] pub cf: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "2")] pub key: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteRangeRequest { #[prost(string, tag = "1")] pub cf: ::prost::alloc::string::String, @@ -49,20 +42,16 @@ pub struct DeleteRangeRequest { #[prost(bool, tag = "4")] pub notify_only: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteRangeResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SnapRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapResponse { #[prost(message, optional, tag = "1")] pub region: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PrewriteRequest { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, @@ -71,19 +60,15 @@ pub struct PrewriteRequest { #[prost(bytes = "vec", tag = "3")] pub lock: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PrewriteResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct IngestSstRequest { #[prost(message, optional, tag = "1")] pub sst: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct IngestSstResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadIndexRequest { /// In replica read, leader uses start_ts and key_ranges to check memory locks. @@ -92,7 +77,6 @@ pub struct ReadIndexRequest { #[prost(message, repeated, tag = "2")] pub key_ranges: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReadIndexResponse { #[prost(uint64, tag = "1")] @@ -101,7 +85,6 @@ pub struct ReadIndexResponse { #[prost(message, optional, tag = "2")] pub locked: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Request { #[prost(enumeration = "CmdType", tag = "1")] @@ -123,7 +106,6 @@ pub struct Request { #[prost(message, optional, tag = "10")] pub read_index: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Response { #[prost(enumeration = "CmdType", tag = "1")] @@ -145,8 +127,7 @@ pub struct Response { #[prost(message, optional, tag = "10")] pub read_index: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ChangePeerRequest { /// This can be only called in internal RaftStore now. #[prost(enumeration = "super::eraftpb::ConfChangeType", tag = "1")] @@ -154,26 +135,22 @@ pub struct ChangePeerRequest { #[prost(message, optional, tag = "2")] pub peer: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangePeerResponse { #[prost(message, optional, tag = "1")] pub region: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangePeerV2Request { #[prost(message, repeated, tag = "1")] pub changes: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChangePeerV2Response { #[prost(message, optional, tag = "1")] pub region: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitRequest { /// This can be only called in internal RaftStore now. /// The split_key must be in the been splitting region. @@ -200,7 +177,6 @@ pub struct SplitRequest { #[prost(bool, tag = "5")] pub share_source_region_size: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SplitResponse { #[prost(message, optional, tag = "1")] @@ -208,7 +184,6 @@ pub struct SplitResponse { #[prost(message, optional, tag = "2")] pub right: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchSplitRequest { #[prost(message, repeated, tag = "1")] @@ -224,14 +199,12 @@ pub struct BatchSplitRequest { #[prost(bool, tag = "3")] pub share_source_region_size: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchSplitResponse { #[prost(message, repeated, tag = "1")] pub regions: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactLogRequest { #[prost(uint64, tag = "1")] pub compact_index: u64, @@ -240,10 +213,8 @@ pub struct CompactLogRequest { #[prost(uint64, tag = "3")] pub voter_replicated_index: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CompactLogResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransferLeaderRequest { #[prost(message, optional, tag = "1")] @@ -251,17 +222,14 @@ pub struct TransferLeaderRequest { #[prost(message, repeated, tag = "2")] pub peers: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TransferLeaderResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ComputeHashRequest { #[prost(bytes = "vec", tag = "1")] pub context: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct VerifyHashRequest { #[prost(uint64, tag = "1")] pub index: u64, @@ -270,10 +238,8 @@ pub struct VerifyHashRequest { #[prost(bytes = "vec", tag = "3")] pub context: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct VerifyHashResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrepareMergeRequest { #[prost(uint64, tag = "1")] @@ -281,26 +247,20 @@ pub struct PrepareMergeRequest { #[prost(message, optional, tag = "2")] pub target: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PrepareMergeResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PrepareFlashbackRequest { /// The start_ts that the current flashback progress is using. #[prost(uint64, tag = "1")] pub start_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct PrepareFlashbackResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct FinishFlashbackRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct FinishFlashbackResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitMergeRequest { #[prost(message, optional, tag = "1")] @@ -315,42 +275,34 @@ pub struct CommitMergeRequest { #[prost(bytes = "vec", tag = "100")] pub source_meta: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CommitMergeResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RollbackMergeRequest { #[prost(uint64, tag = "1")] pub commit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RollbackMergeResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SwitchWitnessRequest { #[prost(uint64, tag = "1")] pub peer_id: u64, #[prost(bool, tag = "2")] pub is_witness: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchSwitchWitnessRequest { #[prost(message, repeated, tag = "1")] pub switch_witnesses: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct BatchSwitchWitnessResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UpdateGcPeerRequest { #[prost(uint64, repeated, tag = "1")] pub peer_id: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AdminRequest { #[prost(enumeration = "AdminCmdType", tag = "1")] @@ -387,7 +339,6 @@ pub struct AdminRequest { #[prost(message, optional, tag = "16")] pub update_gc_peers: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AdminResponse { #[prost(enumeration = "AdminCmdType", tag = "1")] @@ -422,11 +373,9 @@ pub struct AdminResponse { pub switch_witnesses: ::core::option::Option, } /// For get the leader of the region. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionLeaderRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionLeaderResponse { #[prost(message, optional, tag = "1")] pub leader: ::core::option::Option, @@ -440,10 +389,8 @@ pub struct RegionLeaderResponse { /// E,g, for ChangePeer, if we add Peer10 into region1 and find region1 has already had /// Peer10, we can think this ChangePeer is finished, and can pop this job from job list /// directly. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionDetailRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionDetailResponse { #[prost(message, optional, tag = "1")] @@ -451,8 +398,7 @@ pub struct RegionDetailResponse { #[prost(message, optional, tag = "2")] pub leader: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StatusRequest { #[prost(enumeration = "StatusCmdType", tag = "1")] pub cmd_type: i32, @@ -461,7 +407,6 @@ pub struct StatusRequest { #[prost(message, optional, tag = "3")] pub region_detail: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StatusResponse { #[prost(enumeration = "StatusCmdType", tag = "1")] @@ -471,8 +416,7 @@ pub struct StatusResponse { #[prost(message, optional, tag = "3")] pub region_detail: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RaftRequestHeader { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -505,7 +449,6 @@ pub struct RaftRequestHeader { #[prost(string, tag = "13")] pub resource_group_name: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RaftResponseHeader { #[prost(message, optional, tag = "1")] @@ -515,13 +458,11 @@ pub struct RaftResponseHeader { #[prost(uint64, tag = "3")] pub current_term: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CustomRequest { #[prost(bytes = "vec", tag = "1")] pub data: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RaftCmdRequest { #[prost(message, optional, tag = "1")] @@ -537,7 +478,6 @@ pub struct RaftCmdRequest { #[prost(message, optional, tag = "5")] pub custom_request: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RaftCmdResponse { #[prost(message, optional, tag = "1")] @@ -569,15 +509,15 @@ impl CmdType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - CmdType::Invalid => "Invalid", - CmdType::Get => "Get", - CmdType::Put => "Put", - CmdType::Delete => "Delete", - CmdType::Snap => "Snap", - CmdType::Prewrite => "Prewrite", - CmdType::DeleteRange => "DeleteRange", - CmdType::IngestSst => "IngestSST", - CmdType::ReadIndex => "ReadIndex", + Self::Invalid => "Invalid", + Self::Get => "Get", + Self::Put => "Put", + Self::Delete => "Delete", + Self::Snap => "Snap", + Self::Prewrite => "Prewrite", + Self::DeleteRange => "DeleteRange", + Self::IngestSst => "IngestSST", + Self::ReadIndex => "ReadIndex", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -602,6 +542,7 @@ pub enum AdminCmdType { InvalidAdmin = 0, ChangePeer = 1, /// Use `BatchSplit` instead. + #[deprecated] Split = 2, CompactLog = 3, TransferLeader = 4, @@ -625,22 +566,23 @@ impl AdminCmdType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - AdminCmdType::InvalidAdmin => "InvalidAdmin", - AdminCmdType::ChangePeer => "ChangePeer", - AdminCmdType::Split => "Split", - AdminCmdType::CompactLog => "CompactLog", - AdminCmdType::TransferLeader => "TransferLeader", - AdminCmdType::ComputeHash => "ComputeHash", - AdminCmdType::VerifyHash => "VerifyHash", - AdminCmdType::PrepareMerge => "PrepareMerge", - AdminCmdType::CommitMerge => "CommitMerge", - AdminCmdType::RollbackMerge => "RollbackMerge", - AdminCmdType::BatchSplit => "BatchSplit", - AdminCmdType::ChangePeerV2 => "ChangePeerV2", - AdminCmdType::PrepareFlashback => "PrepareFlashback", - AdminCmdType::FinishFlashback => "FinishFlashback", - AdminCmdType::BatchSwitchWitness => "BatchSwitchWitness", - AdminCmdType::UpdateGcPeer => "UpdateGcPeer", + Self::InvalidAdmin => "InvalidAdmin", + Self::ChangePeer => "ChangePeer", + #[allow(deprecated)] + Self::Split => "Split", + Self::CompactLog => "CompactLog", + Self::TransferLeader => "TransferLeader", + Self::ComputeHash => "ComputeHash", + Self::VerifyHash => "VerifyHash", + Self::PrepareMerge => "PrepareMerge", + Self::CommitMerge => "CommitMerge", + Self::RollbackMerge => "RollbackMerge", + Self::BatchSplit => "BatchSplit", + Self::ChangePeerV2 => "ChangePeerV2", + Self::PrepareFlashback => "PrepareFlashback", + Self::FinishFlashback => "FinishFlashback", + Self::BatchSwitchWitness => "BatchSwitchWitness", + Self::UpdateGcPeer => "UpdateGcPeer", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -648,7 +590,7 @@ impl AdminCmdType { match value { "InvalidAdmin" => Some(Self::InvalidAdmin), "ChangePeer" => Some(Self::ChangePeer), - "Split" => Some(Self::Split), + "Split" => Some(#[allow(deprecated)] Self::Split), "CompactLog" => Some(Self::CompactLog), "TransferLeader" => Some(Self::TransferLeader), "ComputeHash" => Some(Self::ComputeHash), @@ -680,9 +622,9 @@ impl StatusCmdType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - StatusCmdType::InvalidStatus => "InvalidStatus", - StatusCmdType::RegionLeader => "RegionLeader", - StatusCmdType::RegionDetail => "RegionDetail", + Self::InvalidStatus => "InvalidStatus", + Self::RegionLeader => "RegionLeader", + Self::RegionDetail => "RegionDetail", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/raft_serverpb.rs b/src/generated/raft_serverpb.rs index c215bcc4..9b78e19f 100644 --- a/src/generated/raft_serverpb.rs +++ b/src/generated/raft_serverpb.rs @@ -1,5 +1,4 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RaftMessage { #[prost(uint64, tag = "1")] @@ -30,16 +29,14 @@ pub struct RaftMessage { #[prost(enumeration = "super::disk_usage::DiskUsage", tag = "12")] pub disk_usage: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RaftTruncatedState { #[prost(uint64, tag = "1")] pub index: u64, #[prost(uint64, tag = "2")] pub term: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SnapshotCfFile { #[prost(string, tag = "1")] pub cf: ::prost::alloc::string::String, @@ -48,7 +45,6 @@ pub struct SnapshotCfFile { #[prost(uint32, tag = "3")] pub checksum: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotMeta { #[prost(message, repeated, tag = "1")] @@ -75,7 +71,6 @@ pub struct SnapshotMeta { #[prost(uint64, tag = "7")] pub commit_index_hint: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotChunk { #[prost(message, optional, tag = "1")] @@ -83,11 +78,9 @@ pub struct SnapshotChunk { #[prost(bytes = "vec", tag = "2")] pub data: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct Done {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TabletSnapshotFileMeta { #[prost(uint64, tag = "1")] pub file_size: u64, @@ -104,7 +97,6 @@ pub struct TabletSnapshotFileMeta { /// Server should send back an `AcceptedSnapshotFile` to let client /// keep sending specified files. Only SST files can be skipped, all /// other files should always be sent. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TabletSnapshotPreview { #[prost(message, repeated, tag = "1")] @@ -114,8 +106,7 @@ pub struct TabletSnapshotPreview { #[prost(bool, tag = "2")] pub end: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TabletSnapshotFileChunk { #[prost(uint64, tag = "1")] pub file_size: u64, @@ -130,7 +121,6 @@ pub struct TabletSnapshotFileChunk { #[prost(message, optional, tag = "5")] pub key: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TabletSnapshotHead { #[prost(message, optional, tag = "1")] @@ -138,15 +128,13 @@ pub struct TabletSnapshotHead { #[prost(bool, tag = "2")] pub use_cache: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TabletSnapshotEnd { /// Checksum of all data sent in `TabletSnapshotFileChunk.data` and /// `TabletSnapshotFileChunk.file_name`. #[prost(uint64, tag = "1")] pub checksum: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TabletSnapshotRequest { #[prost(oneof = "tablet_snapshot_request::Payload", tags = "1, 2, 3, 4")] @@ -154,7 +142,6 @@ pub struct TabletSnapshotRequest { } /// Nested message and enum types in `TabletSnapshotRequest`. pub mod tablet_snapshot_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Payload { #[prost(message, tag = "1")] @@ -167,27 +154,23 @@ pub mod tablet_snapshot_request { End(super::TabletSnapshotEnd), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AcceptedSnapshotFiles { #[prost(string, repeated, tag = "1")] pub file_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TabletSnapshotResponse { #[prost(message, optional, tag = "1")] pub files: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyValue { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RaftSnapshotData { #[prost(message, optional, tag = "1")] @@ -205,8 +188,7 @@ pub struct RaftSnapshotData { #[prost(message, repeated, tag = "7")] pub merged_records: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreIdent { #[prost(uint64, tag = "1")] pub cluster_id: u64, @@ -215,8 +197,7 @@ pub struct StoreIdent { #[prost(enumeration = "super::kvrpcpb::ApiVersion", tag = "3")] pub api_version: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreRecoverState { /// Used for TiKV start recovery when WAL of KVDB was disabled. /// TiKV may read all relations between seqno and raft log index, and replay @@ -226,16 +207,14 @@ pub struct StoreRecoverState { #[prost(uint64, tag = "1")] pub seqno: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RaftLocalState { #[prost(message, optional, tag = "1")] pub hard_state: ::core::option::Option, #[prost(uint64, tag = "2")] pub last_index: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RaftApplyState { #[prost(uint64, tag = "1")] pub applied_index: u64, @@ -248,7 +227,6 @@ pub struct RaftApplyState { #[prost(message, optional, tag = "2")] pub truncated_state: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MergeState { #[prost(uint64, tag = "1")] @@ -258,7 +236,6 @@ pub struct MergeState { #[prost(uint64, tag = "3")] pub commit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MergedRecord { #[prost(uint64, tag = "1")] @@ -284,7 +261,6 @@ pub struct MergedRecord { #[prost(uint64, tag = "8")] pub source_index: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionLocalState { #[prost(enumeration = "PeerState", tag = "1")] @@ -307,7 +283,6 @@ pub struct RegionLocalState { #[prost(message, repeated, tag = "6")] pub merged_records: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionSequenceNumberRelation { #[prost(uint64, tag = "1")] @@ -319,8 +294,7 @@ pub struct RegionSequenceNumberRelation { #[prost(message, optional, tag = "4")] pub region_state: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct AvailabilityContext { #[prost(uint64, tag = "1")] pub from_region_id: u64, @@ -331,14 +305,12 @@ pub struct AvailabilityContext { #[prost(bool, tag = "4")] pub trimmed: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct FlushMemtable { #[prost(uint64, tag = "1")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RefreshBuckets { #[prost(uint64, tag = "1")] pub version: u64, @@ -347,8 +319,7 @@ pub struct RefreshBuckets { #[prost(uint64, repeated, tag = "3")] pub sizes: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CheckGcPeer { /// The region ID who triggers the check and wait for report. It should be /// the ID of RaftMessage.from. @@ -364,7 +335,6 @@ pub struct CheckGcPeer { #[prost(message, optional, tag = "4")] pub check_peer: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExtraMessage { #[prost(enumeration = "ExtraMessageType", tag = "1")] @@ -417,11 +387,11 @@ impl PeerState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - PeerState::Normal => "Normal", - PeerState::Applying => "Applying", - PeerState::Tombstone => "Tombstone", - PeerState::Merging => "Merging", - PeerState::Unavailable => "Unavailable", + Self::Normal => "Normal", + Self::Applying => "Applying", + Self::Tombstone => "Tombstone", + Self::Merging => "Merging", + Self::Unavailable => "Unavailable", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -474,31 +444,27 @@ impl ExtraMessageType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ExtraMessageType::MsgRegionWakeUp => "MsgRegionWakeUp", - ExtraMessageType::MsgWantRollbackMerge => "MsgWantRollbackMerge", - ExtraMessageType::MsgCheckStalePeer => "MsgCheckStalePeer", - ExtraMessageType::MsgCheckStalePeerResponse => "MsgCheckStalePeerResponse", - ExtraMessageType::MsgHibernateRequest => "MsgHibernateRequest", - ExtraMessageType::MsgHibernateResponse => "MsgHibernateResponse", - ExtraMessageType::MsgRejectRaftLogCausedByMemoryUsage => { + Self::MsgRegionWakeUp => "MsgRegionWakeUp", + Self::MsgWantRollbackMerge => "MsgWantRollbackMerge", + Self::MsgCheckStalePeer => "MsgCheckStalePeer", + Self::MsgCheckStalePeerResponse => "MsgCheckStalePeerResponse", + Self::MsgHibernateRequest => "MsgHibernateRequest", + Self::MsgHibernateResponse => "MsgHibernateResponse", + Self::MsgRejectRaftLogCausedByMemoryUsage => { "MsgRejectRaftLogCausedByMemoryUsage" } - ExtraMessageType::MsgAvailabilityRequest => "MsgAvailabilityRequest", - ExtraMessageType::MsgAvailabilityResponse => "MsgAvailabilityResponse", - ExtraMessageType::MsgVoterReplicatedIndexRequest => { - "MsgVoterReplicatedIndexRequest" - } - ExtraMessageType::MsgVoterReplicatedIndexResponse => { - "MsgVoterReplicatedIndexResponse" - } - ExtraMessageType::MsgGcPeerRequest => "MsgGcPeerRequest", - ExtraMessageType::MsgGcPeerResponse => "MsgGcPeerResponse", - ExtraMessageType::MsgFlushMemtable => "MsgFlushMemtable", - ExtraMessageType::MsgRefreshBuckets => "MsgRefreshBuckets", - ExtraMessageType::MsgSnapGenPrecheckRequest => "MsgSnapGenPrecheckRequest", - ExtraMessageType::MsgSnapGenPrecheckResponse => "MsgSnapGenPrecheckResponse", - ExtraMessageType::MsgPreLoadRegionRequest => "MsgPreLoadRegionRequest", - ExtraMessageType::MsgPreLoadRegionResponse => "MsgPreLoadRegionResponse", + Self::MsgAvailabilityRequest => "MsgAvailabilityRequest", + Self::MsgAvailabilityResponse => "MsgAvailabilityResponse", + Self::MsgVoterReplicatedIndexRequest => "MsgVoterReplicatedIndexRequest", + Self::MsgVoterReplicatedIndexResponse => "MsgVoterReplicatedIndexResponse", + Self::MsgGcPeerRequest => "MsgGcPeerRequest", + Self::MsgGcPeerResponse => "MsgGcPeerResponse", + Self::MsgFlushMemtable => "MsgFlushMemtable", + Self::MsgRefreshBuckets => "MsgRefreshBuckets", + Self::MsgSnapGenPrecheckRequest => "MsgSnapGenPrecheckRequest", + Self::MsgSnapGenPrecheckResponse => "MsgSnapGenPrecheckResponse", + Self::MsgPreLoadRegionRequest => "MsgPreLoadRegionRequest", + Self::MsgPreLoadRegionResponse => "MsgPreLoadRegionResponse", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/recover_data.rs b/src/generated/recover_data.rs index 3b7adb0f..178413b2 100644 --- a/src/generated/recover_data.rs +++ b/src/generated/recover_data.rs @@ -1,19 +1,16 @@ // This file is @generated by prost-build. /// request to read region meata from a store -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReadRegionMetaRequest { #[prost(uint64, tag = "1")] pub store_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(string, tag = "1")] pub msg: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionMeta { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -36,8 +33,7 @@ pub struct RegionMeta { pub end_key: ::prost::alloc::vec::Vec, } /// command to store for recover region -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RecoverRegionRequest { #[prost(uint64, tag = "1")] pub region_id: u64, @@ -48,8 +44,7 @@ pub struct RecoverRegionRequest { #[prost(bool, tag = "3")] pub tombstone: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RecoverRegionResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, @@ -57,27 +52,23 @@ pub struct RecoverRegionResponse { pub store_id: u64, } /// wait apply to last index -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct WaitApplyRequest { #[prost(uint64, tag = "1")] pub store_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct WaitApplyResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, } /// resolve data by resolved_ts -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResolveKvDataRequest { #[prost(uint64, tag = "1")] pub resolved_ts: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResolveKvDataResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, @@ -93,7 +84,13 @@ pub struct ResolveKvDataResponse { } /// Generated client implementations. pub mod recover_data_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// a recovery workflow likes @@ -119,10 +116,10 @@ pub mod recover_data_client { } impl RecoverDataClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -140,14 +137,14 @@ pub mod recover_data_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { RecoverDataClient::new(InterceptedService::new(inner, interceptor)) } @@ -194,12 +191,11 @@ pub mod recover_data_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/recover_data.RecoverData/ReadRegionMeta", ); @@ -222,12 +218,11 @@ pub mod recover_data_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/recover_data.RecoverData/RecoverRegion", ); @@ -248,12 +243,11 @@ pub mod recover_data_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/recover_data.RecoverData/WaitApply", ); @@ -274,12 +268,11 @@ pub mod recover_data_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/recover_data.RecoverData/ResolveKvData", ); diff --git a/src/generated/replication_modepb.rs b/src/generated/replication_modepb.rs index 3140fab5..5f451998 100644 --- a/src/generated/replication_modepb.rs +++ b/src/generated/replication_modepb.rs @@ -1,7 +1,6 @@ // This file is @generated by prost-build. /// The replication status sync from PD to TiKV. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReplicationStatus { #[prost(enumeration = "ReplicationMode", tag = "1")] pub mode: i32, @@ -9,8 +8,7 @@ pub struct ReplicationStatus { pub dr_auto_sync: ::core::option::Option, } /// The status of dr-autosync mode. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DrAutoSync { /// The key of the label that used for distinguish different DC. #[prost(string, tag = "1")] @@ -31,8 +29,7 @@ pub struct DrAutoSync { pub pause_region_split: bool, } /// The replication status sync from TiKV to PD. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionReplicationStatus { #[prost(enumeration = "RegionReplicationState", tag = "1")] pub state: i32, @@ -40,8 +37,7 @@ pub struct RegionReplicationStatus { #[prost(uint64, tag = "2")] pub state_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreDrAutoSyncStatus { #[prost(enumeration = "DrAutoSyncState", tag = "1")] pub state: i32, @@ -63,8 +59,8 @@ impl ReplicationMode { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ReplicationMode::Majority => "MAJORITY", - ReplicationMode::DrAutoSync => "DR_AUTO_SYNC", + Self::Majority => "MAJORITY", + Self::DrAutoSync => "DR_AUTO_SYNC", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -95,10 +91,10 @@ impl DrAutoSyncState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - DrAutoSyncState::Sync => "SYNC", - DrAutoSyncState::AsyncWait => "ASYNC_WAIT", - DrAutoSyncState::Async => "ASYNC", - DrAutoSyncState::SyncRecover => "SYNC_RECOVER", + Self::Sync => "SYNC", + Self::AsyncWait => "ASYNC_WAIT", + Self::Async => "ASYNC", + Self::SyncRecover => "SYNC_RECOVER", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -129,9 +125,9 @@ impl RegionReplicationState { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - RegionReplicationState::Unknown => "UNKNOWN", - RegionReplicationState::SimpleMajority => "SIMPLE_MAJORITY", - RegionReplicationState::IntegrityOverLabel => "INTEGRITY_OVER_LABEL", + Self::Unknown => "UNKNOWN", + Self::SimpleMajority => "SIMPLE_MAJORITY", + Self::IntegrityOverLabel => "INTEGRITY_OVER_LABEL", } } /// Creates an enum from field names used in the ProtoBuf definition. diff --git a/src/generated/resource_manager.rs b/src/generated/resource_manager.rs index e093c6f0..5ae301a9 100644 --- a/src/generated/resource_manager.rs +++ b/src/generated/resource_manager.rs @@ -1,14 +1,12 @@ // This file is @generated by prost-build. /// KeyspaceIDValue is a wrapper for the value of keyspace ID. /// Because the 0 value is a valid keyspace ID, we need to use a wrapper to distinguish it from the null keyspace ID. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyspaceIdValue { #[prost(uint32, tag = "1")] pub value: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListResourceGroupsRequest { #[prost(bool, tag = "1")] pub with_ru_stats: bool, @@ -21,7 +19,6 @@ pub struct ListResourceGroupsRequest { #[prost(message, optional, tag = "2")] pub keyspace_id: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListResourceGroupsResponse { #[prost(message, optional, tag = "1")] @@ -29,8 +26,7 @@ pub struct ListResourceGroupsResponse { #[prost(message, repeated, tag = "2")] pub groups: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetResourceGroupRequest { #[prost(string, tag = "1")] pub resource_group_name: ::prost::alloc::string::String, @@ -45,7 +41,6 @@ pub struct GetResourceGroupRequest { #[prost(message, optional, tag = "3")] pub keyspace_id: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetResourceGroupResponse { #[prost(message, optional, tag = "1")] @@ -53,8 +48,7 @@ pub struct GetResourceGroupResponse { #[prost(message, optional, tag = "2")] pub group: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteResourceGroupRequest { #[prost(string, tag = "1")] pub resource_group_name: ::prost::alloc::string::String, @@ -67,29 +61,25 @@ pub struct DeleteResourceGroupRequest { #[prost(message, optional, tag = "2")] pub keyspace_id: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct DeleteResourceGroupResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, #[prost(string, tag = "2")] pub body: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PutResourceGroupRequest { #[prost(message, optional, tag = "1")] pub group: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PutResourceGroupResponse { #[prost(message, optional, tag = "1")] pub error: ::core::option::Option, #[prost(string, tag = "2")] pub body: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenBucketsRequest { #[prost(message, repeated, tag = "1")] @@ -99,7 +89,6 @@ pub struct TokenBucketsRequest { #[prost(uint64, tag = "3")] pub client_unique_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenBucketRequest { #[prost(string, tag = "1")] @@ -125,19 +114,16 @@ pub struct TokenBucketRequest { } /// Nested message and enum types in `TokenBucketRequest`. pub mod token_bucket_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestRu { #[prost(message, repeated, tag = "1")] pub request_r_u: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestRawResource { #[prost(message, repeated, tag = "1")] pub request_raw_resource: ::prost::alloc::vec::Vec, } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Request { /// RU mode, group settings with WRU/RRU etc resource abstract unit. @@ -148,7 +134,6 @@ pub mod token_bucket_request { RawResourceItems(RequestRawResource), } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenBucketsResponse { #[prost(message, optional, tag = "1")] @@ -156,7 +141,6 @@ pub struct TokenBucketsResponse { #[prost(message, repeated, tag = "2")] pub responses: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenBucketResponse { #[prost(string, tag = "1")] @@ -176,8 +160,7 @@ pub struct TokenBucketResponse { #[prost(message, optional, tag = "4")] pub keyspace_id: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GrantedRuTokenBucket { #[prost(enumeration = "RequestUnitType", tag = "1")] pub r#type: i32, @@ -186,8 +169,7 @@ pub struct GrantedRuTokenBucket { #[prost(int64, tag = "3")] pub trickle_time_ms: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GrantedRawResourceTokenBucket { #[prost(enumeration = "RawResourceType", tag = "1")] pub r#type: i32, @@ -196,8 +178,7 @@ pub struct GrantedRawResourceTokenBucket { #[prost(int64, tag = "3")] pub trickle_time_ms: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Consumption { #[prost(double, tag = "1")] pub r_r_u: f64, @@ -229,16 +210,14 @@ pub struct Consumption { #[prost(double, tag = "13")] pub tiflash_r_u_v2: f64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct RequestUnitItem { #[prost(enumeration = "RequestUnitType", tag = "1")] pub r#type: i32, #[prost(double, tag = "2")] pub value: f64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct RawResourceItem { #[prost(enumeration = "RawResourceType", tag = "1")] pub r#type: i32, @@ -246,7 +225,6 @@ pub struct RawResourceItem { pub value: f64, } /// ResourceGroup the settings definitions. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResourceGroup { #[prost(string, tag = "1")] @@ -280,14 +258,12 @@ pub struct ResourceGroup { #[prost(message, optional, tag = "9")] pub keyspace_id: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GroupRequestUnitSettings { #[prost(message, optional, tag = "1")] pub r_u: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GroupRawResourceSettings { #[prost(message, optional, tag = "1")] pub cpu: ::core::option::Option, @@ -296,8 +272,7 @@ pub struct GroupRawResourceSettings { #[prost(message, optional, tag = "3")] pub io_write: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TokenBucket { #[prost(message, optional, tag = "1")] pub settings: ::core::option::Option, @@ -305,8 +280,7 @@ pub struct TokenBucket { #[prost(double, tag = "2")] pub tokens: f64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TokenLimitSettings { #[prost(uint64, tag = "1")] pub fill_rate: u64, @@ -315,14 +289,12 @@ pub struct TokenLimitSettings { #[prost(double, tag = "3")] pub max_tokens: f64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RunawayRule { #[prost(uint64, tag = "1")] pub exec_elapsed_time_ms: u64, @@ -331,8 +303,7 @@ pub struct RunawayRule { #[prost(int64, tag = "3")] pub request_unit: i64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RunawayWatch { /// how long would the watch last #[prost(int64, tag = "1")] @@ -340,8 +311,7 @@ pub struct RunawayWatch { #[prost(enumeration = "RunawayWatchType", tag = "2")] pub r#type: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RunawaySettings { #[prost(message, optional, tag = "1")] pub rule: ::core::option::Option, @@ -354,8 +324,7 @@ pub struct RunawaySettings { #[prost(string, tag = "4")] pub switch_group_name: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct BackgroundSettings { /// background task types. #[prost(string, repeated, tag = "1")] @@ -364,8 +333,7 @@ pub struct BackgroundSettings { #[prost(uint64, tag = "2")] pub utilization_limit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Participant { /// name is the unique name of the resource manager participant. #[prost(string, tag = "1")] @@ -390,7 +358,7 @@ impl RequestUnitType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - RequestUnitType::Ru => "RU", + Self::Ru => "RU", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -415,9 +383,9 @@ impl RawResourceType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - RawResourceType::Cpu => "CPU", - RawResourceType::IoReadFlow => "IOReadFlow", - RawResourceType::IoWriteFlow => "IOWriteFlow", + Self::Cpu => "CPU", + Self::IoReadFlow => "IOReadFlow", + Self::IoWriteFlow => "IOWriteFlow", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -444,9 +412,9 @@ impl GroupMode { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - GroupMode::Unknown => "Unknown", - GroupMode::RuMode => "RUMode", - GroupMode::RawMode => "RawMode", + Self::Unknown => "Unknown", + Self::RuMode => "RUMode", + Self::RawMode => "RawMode", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -479,11 +447,11 @@ impl RunawayAction { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - RunawayAction::NoneAction => "NoneAction", - RunawayAction::DryRun => "DryRun", - RunawayAction::CoolDown => "CoolDown", - RunawayAction::Kill => "Kill", - RunawayAction::SwitchGroup => "SwitchGroup", + Self::NoneAction => "NoneAction", + Self::DryRun => "DryRun", + Self::CoolDown => "CoolDown", + Self::Kill => "Kill", + Self::SwitchGroup => "SwitchGroup", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -513,10 +481,10 @@ impl RunawayWatchType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - RunawayWatchType::NoneWatch => "NoneWatch", - RunawayWatchType::Exact => "Exact", - RunawayWatchType::Similar => "Similar", - RunawayWatchType::Plan => "Plan", + Self::NoneWatch => "NoneWatch", + Self::Exact => "Exact", + Self::Similar => "Similar", + Self::Plan => "Plan", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -532,7 +500,13 @@ impl RunawayWatchType { } /// Generated client implementations. pub mod resource_manager_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -552,10 +526,10 @@ pub mod resource_manager_client { } impl ResourceManagerClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -573,14 +547,14 @@ pub mod resource_manager_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ResourceManagerClient::new(InterceptedService::new(inner, interceptor)) } @@ -626,12 +600,11 @@ pub mod resource_manager_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_manager.ResourceManager/ListResourceGroups", ); @@ -656,12 +629,11 @@ pub mod resource_manager_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_manager.ResourceManager/GetResourceGroup", ); @@ -686,12 +658,11 @@ pub mod resource_manager_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_manager.ResourceManager/AddResourceGroup", ); @@ -716,12 +687,11 @@ pub mod resource_manager_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_manager.ResourceManager/ModifyResourceGroup", ); @@ -746,12 +716,11 @@ pub mod resource_manager_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_manager.ResourceManager/DeleteResourceGroup", ); @@ -778,12 +747,11 @@ pub mod resource_manager_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_manager.ResourceManager/AcquireTokenBuckets", ); diff --git a/src/generated/resource_usage_agent.rs b/src/generated/resource_usage_agent.rs index 26f04ac6..353ee014 100644 --- a/src/generated/resource_usage_agent.rs +++ b/src/generated/resource_usage_agent.rs @@ -1,11 +1,8 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResourceMeteringRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct EmptyResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResourceUsageRecord { #[prost(oneof = "resource_usage_record::RecordOneof", tags = "1, 2")] @@ -13,7 +10,6 @@ pub struct ResourceUsageRecord { } /// Nested message and enum types in `ResourceUsageRecord`. pub mod resource_usage_record { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum RecordOneof { #[prost(message, tag = "1")] @@ -23,7 +19,6 @@ pub mod resource_usage_record { } } /// GroupTagRecord is a set of resource usage data grouped by resource_group_tag. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GroupTagRecord { #[prost(bytes = "vec", tag = "1")] @@ -31,8 +26,7 @@ pub struct GroupTagRecord { #[prost(message, repeated, tag = "2")] pub items: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GroupTagRecordItem { #[prost(uint64, tag = "1")] pub timestamp_sec: u64, @@ -52,7 +46,6 @@ pub struct GroupTagRecordItem { pub logical_write_bytes: u64, } /// RegionRecord is a set of resource usage data grouped by region. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionRecord { #[prost(uint64, tag = "1")] @@ -62,7 +55,13 @@ pub struct RegionRecord { } /// Generated client implementations. pub mod resource_usage_agent_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// ResourceUsageAgent is the service for storing resource usage records. @@ -83,10 +82,10 @@ pub mod resource_usage_agent_client { } impl ResourceUsageAgentClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -104,14 +103,14 @@ pub mod resource_usage_agent_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ResourceUsageAgentClient::new(InterceptedService::new(inner, interceptor)) } @@ -158,12 +157,11 @@ pub mod resource_usage_agent_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_usage_agent.ResourceUsageAgent/Report", ); @@ -178,7 +176,13 @@ pub mod resource_usage_agent_client { } /// Generated client implementations. pub mod resource_metering_pub_sub_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// TiKV implements ResourceMeteringPubSub service for clients to subscribe to resource metering records. @@ -199,10 +203,10 @@ pub mod resource_metering_pub_sub_client { } impl ResourceMeteringPubSubClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -220,14 +224,14 @@ pub mod resource_metering_pub_sub_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { ResourceMeteringPubSubClient::new( InterceptedService::new(inner, interceptor), @@ -277,12 +281,11 @@ pub mod resource_metering_pub_sub_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/resource_usage_agent.ResourceMeteringPubSub/Subscribe", ); diff --git a/src/generated/schedulingpb.rs b/src/generated/schedulingpb.rs index e4efe144..6ee5f742 100644 --- a/src/generated/schedulingpb.rs +++ b/src/generated/schedulingpb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RequestHeader { /// cluster_id is the ID of the cluster which be sent to. #[prost(uint64, tag = "1")] @@ -9,8 +8,7 @@ pub struct RequestHeader { #[prost(uint64, tag = "2")] pub sender_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResponseHeader { /// cluster_id is the ID of the cluster which sent the response. #[prost(uint64, tag = "1")] @@ -18,16 +16,14 @@ pub struct ResponseHeader { #[prost(message, optional, tag = "2")] pub error: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(enumeration = "ErrorType", tag = "1")] pub r#type: i32, #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Participant { /// name is the unique name of the scheduling participant. #[prost(string, tag = "1")] @@ -40,7 +36,6 @@ pub struct Participant { #[prost(string, repeated, tag = "3")] pub listen_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreHeartbeatRequest { #[prost(message, optional, tag = "1")] @@ -48,15 +43,13 @@ pub struct StoreHeartbeatRequest { #[prost(message, optional, tag = "2")] pub stats: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct StoreHeartbeatResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(string, tag = "2")] pub cluster_version: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionHeartbeatRequest { #[prost(message, optional, tag = "1")] @@ -102,7 +95,6 @@ pub struct RegionHeartbeatRequest { #[prost(message, optional, tag = "15")] pub bucket_meta: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RegionHeartbeatResponse { #[prost(message, optional, tag = "1")] @@ -153,8 +145,7 @@ pub struct RegionHeartbeatResponse { #[prost(message, optional, tag = "11")] pub change_split: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScatterRegionsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -170,8 +161,7 @@ pub struct ScatterRegionsRequest { #[prost(bool, tag = "5")] pub skip_store_limit: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ScatterRegionsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -180,8 +170,7 @@ pub struct ScatterRegionsResponse { #[prost(uint64, repeated, tag = "3")] pub failed_regions_id: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitRegionsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -190,8 +179,7 @@ pub struct SplitRegionsRequest { #[prost(uint64, tag = "3")] pub retry_limit: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitRegionsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -200,16 +188,14 @@ pub struct SplitRegionsResponse { #[prost(uint64, repeated, tag = "3")] pub regions_id: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetOperatorRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(uint64, tag = "2")] pub region_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetOperatorResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -222,7 +208,6 @@ pub struct GetOperatorResponse { #[prost(bytes = "vec", tag = "5")] pub kind: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AskBatchSplitRequest { #[prost(message, optional, tag = "1")] @@ -234,7 +219,6 @@ pub struct AskBatchSplitRequest { #[prost(enumeration = "super::pdpb::SplitReason", tag = "4")] pub reason: i32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AskBatchSplitResponse { #[prost(message, optional, tag = "1")] @@ -242,8 +226,7 @@ pub struct AskBatchSplitResponse { #[prost(message, repeated, tag = "2")] pub ids: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionBucketsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -252,8 +235,7 @@ pub struct RegionBucketsRequest { #[prost(message, optional, tag = "3")] pub buckets: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RegionBucketsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -275,12 +257,12 @@ impl ErrorType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ErrorType::Ok => "OK", - ErrorType::Unknown => "UNKNOWN", - ErrorType::NotBootstrapped => "NOT_BOOTSTRAPPED", - ErrorType::AlreadyBootstrapped => "ALREADY_BOOTSTRAPPED", - ErrorType::InvalidValue => "INVALID_VALUE", - ErrorType::ClusterMismatched => "CLUSTER_MISMATCHED", + Self::Ok => "OK", + Self::Unknown => "UNKNOWN", + Self::NotBootstrapped => "NOT_BOOTSTRAPPED", + Self::AlreadyBootstrapped => "ALREADY_BOOTSTRAPPED", + Self::InvalidValue => "INVALID_VALUE", + Self::ClusterMismatched => "CLUSTER_MISMATCHED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -298,7 +280,13 @@ impl ErrorType { } /// Generated client implementations. pub mod scheduling_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -318,10 +306,10 @@ pub mod scheduling_client { } impl SchedulingClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -339,14 +327,14 @@ pub mod scheduling_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { SchedulingClient::new(InterceptedService::new(inner, interceptor)) } @@ -392,12 +380,11 @@ pub mod scheduling_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/schedulingpb.Scheduling/StoreHeartbeat", ); @@ -419,12 +406,11 @@ pub mod scheduling_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/schedulingpb.Scheduling/RegionHeartbeat", ); @@ -444,12 +430,11 @@ pub mod scheduling_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/schedulingpb.Scheduling/SplitRegions", ); @@ -469,12 +454,11 @@ pub mod scheduling_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/schedulingpb.Scheduling/ScatterRegions", ); @@ -494,12 +478,11 @@ pub mod scheduling_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/schedulingpb.Scheduling/GetOperator", ); @@ -519,12 +502,11 @@ pub mod scheduling_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/schedulingpb.Scheduling/AskBatchSplit", ); @@ -546,12 +528,11 @@ pub mod scheduling_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/schedulingpb.Scheduling/RegionBuckets", ); diff --git a/src/generated/tikvpb.rs b/src/generated/tikvpb.rs index f85e37d4..0229afee 100644 --- a/src/generated/tikvpb.rs +++ b/src/generated/tikvpb.rs @@ -1,5 +1,4 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchCommandsRequest { #[prost(message, repeated, tag = "1")] @@ -13,7 +12,6 @@ pub struct BatchCommandsRequest { } /// Nested message and enum types in `BatchCommandsRequest`. pub mod batch_commands_request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Request { #[prost( @@ -24,7 +22,6 @@ pub mod batch_commands_request { } /// Nested message and enum types in `Request`. pub mod request { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Cmd { #[prost(message, tag = "1")] @@ -107,7 +104,6 @@ pub mod batch_commands_request { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchCommandsResponse { #[prost(message, repeated, tag = "1")] @@ -126,7 +122,6 @@ pub struct BatchCommandsResponse { } /// Nested message and enum types in `BatchCommandsResponse`. pub mod batch_commands_response { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Response { #[prost( @@ -137,7 +132,6 @@ pub mod batch_commands_response { } /// Nested message and enum types in `Response`. pub mod response { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Cmd { #[prost(message, tag = "1")] @@ -220,7 +214,6 @@ pub mod batch_commands_response { } } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchRaftMessage { #[prost(message, repeated, tag = "1")] @@ -229,8 +222,7 @@ pub struct BatchRaftMessage { #[prost(uint64, tag = "13")] pub last_observed_time: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct BatchCommandsEmptyRequest { /// ID of the test request. #[prost(uint64, tag = "1")] @@ -239,8 +231,7 @@ pub struct BatchCommandsEmptyRequest { #[prost(uint64, tag = "2")] pub delay_time: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct BatchCommandsEmptyResponse { /// ID of the test request. #[prost(uint64, tag = "1")] @@ -248,7 +239,13 @@ pub struct BatchCommandsEmptyResponse { } /// Generated client implementations. pub mod tikv_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Key/value store API for TiKV. @@ -269,10 +266,10 @@ pub mod tikv_client { } impl TikvClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -290,14 +287,14 @@ pub mod tikv_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { TikvClient::new(InterceptedService::new(inner, interceptor)) } @@ -344,12 +341,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvGet"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvGet")); @@ -366,12 +362,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvScan"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvScan")); @@ -388,12 +383,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvPrewrite"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvPrewrite")); @@ -412,12 +406,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvPessimisticLock", ); @@ -439,12 +432,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KVPessimisticRollback", ); @@ -464,12 +456,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvTxnHeartBeat", ); @@ -491,12 +482,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvCheckTxnStatus", ); @@ -518,12 +508,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvCheckSecondaryLocks", ); @@ -543,12 +532,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvCommit"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvCommit")); @@ -565,12 +553,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvImport"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvImport")); @@ -587,12 +574,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvCleanup"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvCleanup")); @@ -609,12 +595,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvBatchGet"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvBatchGet")); @@ -631,12 +616,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvBatchRollback", ); @@ -656,12 +640,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvScanLock"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvScanLock")); @@ -678,12 +661,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvResolveLock", ); @@ -702,12 +684,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvGC"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvGC")); @@ -724,12 +705,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvDeleteRange", ); @@ -750,12 +730,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvPrepareFlashbackToVersion", ); @@ -777,12 +756,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvFlashbackToVersion", ); @@ -802,12 +780,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/KvFlush"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "KvFlush")); @@ -826,12 +803,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/KvBufferBatchGet", ); @@ -852,12 +828,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawGet"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawGet")); @@ -874,12 +849,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawBatchGet"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawBatchGet")); @@ -896,12 +870,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawPut"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawPut")); @@ -918,12 +891,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawBatchPut"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawBatchPut")); @@ -940,12 +912,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawDelete"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawDelete")); @@ -964,12 +935,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/RawBatchDelete", ); @@ -989,12 +959,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawScan"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawScan")); @@ -1013,12 +982,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/RawDeleteRange", ); @@ -1038,12 +1006,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawBatchScan"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawBatchScan")); @@ -1061,12 +1028,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawGetKeyTTL"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawGetKeyTTL")); @@ -1084,12 +1050,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/RawCompareAndSwap", ); @@ -1109,12 +1074,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/RawChecksum"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "RawChecksum")); @@ -1134,12 +1098,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/UnsafeDestroyRange", ); @@ -1161,12 +1124,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/RegisterLockObserver", ); @@ -1188,12 +1150,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/CheckLockObserver", ); @@ -1215,12 +1176,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/RemoveLockObserver", ); @@ -1242,12 +1202,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/PhysicalScanLock", ); @@ -1269,12 +1228,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/Coprocessor"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "Coprocessor")); @@ -1293,12 +1251,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/CoprocessorStream", ); @@ -1320,12 +1277,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/BatchCoprocessor", ); @@ -1346,12 +1302,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/DelegateCoprocessor", ); @@ -1374,12 +1329,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/RawCoprocessor", ); @@ -1402,12 +1356,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/Raft"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "Raft")); @@ -1424,12 +1377,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/BatchRaft"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "BatchRaft")); @@ -1448,12 +1400,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/Snapshot"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "Snapshot")); @@ -1476,12 +1427,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/TabletSnapshot", ); @@ -1502,12 +1452,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/SplitRegion"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "SplitRegion")); @@ -1525,12 +1474,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/ReadIndex"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "ReadIndex")); @@ -1548,12 +1496,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/MvccGetByKey"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "MvccGetByKey")); @@ -1572,12 +1519,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/MvccGetByStartTs", ); @@ -1600,12 +1546,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/BatchCommands", ); @@ -1625,12 +1570,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/DispatchMPPTask", ); @@ -1650,12 +1594,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/CancelMPPTask", ); @@ -1676,12 +1619,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/EstablishMPPConnection", ); @@ -1701,12 +1643,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/IsAlive"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "IsAlive")); @@ -1723,12 +1664,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/ReportMPPTaskStatus", ); @@ -1753,12 +1693,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/CheckLeader"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "CheckLeader")); @@ -1776,12 +1715,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/GetStoreSafeTS", ); @@ -1804,12 +1742,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/GetLockWaitInfo", ); @@ -1833,12 +1770,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/Compact"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "Compact")); @@ -1858,12 +1794,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/GetLockWaitHistory", ); @@ -1886,12 +1821,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/GetTiFlashSystemTable", ); @@ -1914,12 +1848,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/GetEstimateTiCICount", ); @@ -1943,12 +1876,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tikvpb.Tikv/tryAddLock"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tikvpb.Tikv", "tryAddLock")); @@ -1968,12 +1900,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/tryMarkDelete", ); @@ -1995,12 +1926,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/EstablishDisaggTask", ); @@ -2023,12 +1953,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/CancelDisaggTask", ); @@ -2053,12 +1982,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/FetchDisaggPages", ); @@ -2081,12 +2009,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/GetDisaggConfig", ); @@ -2109,12 +2036,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/GetHealthFeedback", ); @@ -2137,12 +2063,11 @@ pub mod tikv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.Tikv/BroadcastTxnStatus", ); @@ -2155,7 +2080,13 @@ pub mod tikv_client { } /// Generated client implementations. pub mod versioned_kv_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// VersionedKv provides versioned coprocessor APIs for TiCI lookup. @@ -2181,10 +2112,10 @@ pub mod versioned_kv_client { } impl VersionedKvClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -2202,14 +2133,14 @@ pub mod versioned_kv_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { VersionedKvClient::new(InterceptedService::new(inner, interceptor)) } @@ -2255,12 +2186,11 @@ pub mod versioned_kv_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tikvpb.VersionedKv/VersionedCoprocessor", ); diff --git a/src/generated/tracepb.rs b/src/generated/tracepb.rs index 51a01547..ee9ccd90 100644 --- a/src/generated/tracepb.rs +++ b/src/generated/tracepb.rs @@ -1,8 +1,6 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct TraceRecordRequest {} -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TraceRecord { #[prost(oneof = "trace_record::RecordOneof", tags = "1, 2")] @@ -10,7 +8,6 @@ pub struct TraceRecord { } /// Nested message and enum types in `TraceRecord`. pub mod trace_record { - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum RecordOneof { #[prost(message, tag = "1")] @@ -19,8 +16,7 @@ pub mod trace_record { NotifyCollect(super::NotifyCollect), } } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct RemoteParentSpan { /// A unique id to identify the request. It's usually a UUID. #[prost(uint64, tag = "1")] @@ -30,7 +26,6 @@ pub struct RemoteParentSpan { pub span_id: u64, } /// The context of the request to be traced. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TraceContext { #[prost(message, repeated, tag = "1")] @@ -40,7 +35,6 @@ pub struct TraceContext { pub duration_threshold_ms: u32, } /// Report the spans collected when handling a request on a service. -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Report { #[prost(message, repeated, tag = "1")] @@ -49,13 +43,11 @@ pub struct Report { pub spans: ::prost::alloc::vec::Vec, } /// Notify the subscriber to persis the spans of the trace. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct NotifyCollect { #[prost(uint64, tag = "1")] pub trace_id: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Span { /// The unique span id within the spans with the same `trace_id`. @@ -73,8 +65,7 @@ pub struct Span { #[prost(message, repeated, tag = "6")] pub properties: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Property { #[prost(string, tag = "1")] pub key: ::prost::alloc::string::String, @@ -83,7 +74,13 @@ pub struct Property { } /// Generated client implementations. pub mod trace_record_pub_sub_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -103,10 +100,10 @@ pub mod trace_record_pub_sub_client { } impl TraceRecordPubSubClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -124,14 +121,14 @@ pub mod trace_record_pub_sub_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { TraceRecordPubSubClient::new(InterceptedService::new(inner, interceptor)) } @@ -179,12 +176,11 @@ pub mod trace_record_pub_sub_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tracepb.TraceRecordPubSub/Subscribe", ); diff --git a/src/generated/tsopb.rs b/src/generated/tsopb.rs index fd84ab11..594b43d4 100644 --- a/src/generated/tsopb.rs +++ b/src/generated/tsopb.rs @@ -1,6 +1,5 @@ // This file is @generated by prost-build. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct RequestHeader { /// cluster_id is the ID of the cluster which be sent to. #[prost(uint64, tag = "1")] @@ -21,8 +20,7 @@ pub struct RequestHeader { #[prost(string, tag = "5")] pub callee_id: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ResponseHeader { /// cluster_id is the ID of the cluster which sent the response. #[prost(uint64, tag = "1")] @@ -36,16 +34,14 @@ pub struct ResponseHeader { #[prost(uint32, tag = "4")] pub keyspace_group_id: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Error { #[prost(enumeration = "ErrorType", tag = "1")] pub r#type: i32, #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TsoRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -54,8 +50,7 @@ pub struct TsoRequest { #[prost(string, tag = "3")] pub dc_location: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct TsoResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -64,8 +59,7 @@ pub struct TsoResponse { #[prost(message, optional, tag = "3")] pub timestamp: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct Participant { /// name is the unique name of the TSO participant. #[prost(string, tag = "1")] @@ -78,21 +72,18 @@ pub struct Participant { #[prost(string, repeated, tag = "3")] pub listen_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct KeyspaceGroupMember { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(bool, tag = "2")] pub is_primary: bool, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SplitState { #[prost(uint32, tag = "1")] pub split_source: u32, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyspaceGroup { #[prost(uint32, tag = "1")] @@ -104,8 +95,7 @@ pub struct KeyspaceGroup { #[prost(message, repeated, tag = "4")] pub members: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct FindGroupByKeyspaceIdRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -114,7 +104,6 @@ pub struct FindGroupByKeyspaceIdRequest { #[prost(uint64, tag = "3")] pub mod_revision: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FindGroupByKeyspaceIdResponse { #[prost(message, optional, tag = "1")] @@ -124,16 +113,14 @@ pub struct FindGroupByKeyspaceIdResponse { #[prost(uint64, tag = "3")] pub mod_revision: u64, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMinTsRequest { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, #[prost(string, tag = "2")] pub dc_location: ::prost::alloc::string::String, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetMinTsResponse { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option, @@ -163,12 +150,12 @@ impl ErrorType { /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - ErrorType::Ok => "OK", - ErrorType::Unknown => "UNKNOWN", - ErrorType::NotBootstrapped => "NOT_BOOTSTRAPPED", - ErrorType::AlreadyBootstrapped => "ALREADY_BOOTSTRAPPED", - ErrorType::InvalidValue => "INVALID_VALUE", - ErrorType::ClusterMismatched => "CLUSTER_MISMATCHED", + Self::Ok => "OK", + Self::Unknown => "UNKNOWN", + Self::NotBootstrapped => "NOT_BOOTSTRAPPED", + Self::AlreadyBootstrapped => "ALREADY_BOOTSTRAPPED", + Self::InvalidValue => "INVALID_VALUE", + Self::ClusterMismatched => "CLUSTER_MISMATCHED", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -186,7 +173,13 @@ impl ErrorType { } /// Generated client implementations. pub mod tso_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + #![allow( + unused_variables, + dead_code, + missing_docs, + clippy::wildcard_imports, + clippy::let_unit_value, + )] use tonic::codegen::*; use tonic::codegen::http::Uri; #[derive(Debug, Clone)] @@ -206,10 +199,10 @@ pub mod tso_client { } impl TsoClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, + T::ResponseBody: Body + std::marker::Send + 'static, + ::Error: Into + std::marker::Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -227,14 +220,14 @@ pub mod tso_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, , - >>::Error: Into + Send + Sync, + http::Request, + >>::Error: Into + std::marker::Send + std::marker::Sync, { TsoClient::new(InterceptedService::new(inner, interceptor)) } @@ -280,12 +273,11 @@ pub mod tso_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tsopb.TSO/Tso"); let mut req = request.into_streaming_request(); req.extensions_mut().insert(GrpcMethod::new("tsopb.TSO", "Tso")); @@ -303,12 +295,11 @@ pub mod tso_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( "/tsopb.TSO/FindGroupByKeyspaceID", ); @@ -332,12 +323,11 @@ pub mod tso_client { .ready() .await .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, + tonic::Status::unknown( format!("Service was not ready: {}", e.into()), ) })?; - let codec = tonic::codec::ProstCodec::default(); + let codec = tonic_prost::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/tsopb.TSO/GetMinTS"); let mut req = request.into_request(); req.extensions_mut().insert(GrpcMethod::new("tsopb.TSO", "GetMinTS")); diff --git a/src/request/plan.rs b/src/request/plan.rs index f832f608..fdd4a568 100644 --- a/src/request/plan.rs +++ b/src/request/plan.rs @@ -528,12 +528,7 @@ pub(crate) async fn on_region_epoch_not_match( let region_epoch = r.region_epoch.unwrap(); let returned_conf_ver = region_epoch.conf_ver; let returned_version = region_epoch.version; - let current_region_epoch = region_store - .region_with_leader - .region - .region_epoch - .clone() - .unwrap(); + let current_region_epoch = region_store.region_with_leader.region.region_epoch.unwrap(); let current_conf_ver = current_region_epoch.conf_ver; let current_version = current_region_epoch.version; @@ -780,7 +775,7 @@ impl Clone for ResolveLock { fn clone(&self) -> Self { ResolveLock { inner: self.inner.clone(), - timestamp: self.timestamp.clone(), + timestamp: self.timestamp, pd_client: self.pd_client.clone(), backoff: self.backoff.clone(), keyspace: self.keyspace, @@ -809,13 +804,8 @@ where } let pd_client = self.pd_client.clone(); - let live_locks = resolve_locks( - locks, - self.timestamp.clone(), - pd_client.clone(), - self.keyspace, - ) - .await?; + let live_locks = + resolve_locks(locks, self.timestamp, pd_client.clone(), self.keyspace).await?; if live_locks.is_empty() { result = self.inner.execute().await?; } else { diff --git a/src/transaction/client.rs b/src/transaction/client.rs index 62f24859..7ba95812 100644 --- a/src/transaction/client.rs +++ b/src/transaction/client.rs @@ -345,7 +345,7 @@ impl Client { loop { let resolved_locks = resolve_locks( live_locks.encode_keyspace(self.keyspace, KeyMode::Txn), - timestamp.clone(), + timestamp, self.pd.clone(), self.keyspace, ) diff --git a/src/transaction/transaction.rs b/src/transaction/transaction.rs index 7f57146a..d5be79f7 100644 --- a/src/transaction/transaction.rs +++ b/src/transaction/transaction.rs @@ -143,7 +143,7 @@ impl Transaction { pub async fn get(&mut self, key: impl Into) -> Result> { trace!("invoking transactional get request"); self.check_allow_operation().await?; - let timestamp = self.timestamp.clone(); + let timestamp = self.timestamp; let rpc = self.rpc.clone(); let key = key.into().encode_keyspace(self.keyspace, KeyMode::Txn); let retry_options = self.options.retry_options.clone(); @@ -151,7 +151,7 @@ impl Transaction { self.buffer .get_or_else(key, |key| async move { - let request = new_get_request(key, timestamp.clone()); + let request = new_get_request(key, timestamp); let plan = PlanBuilder::new(rpc, keyspace, request) .resolve_lock(timestamp, retry_options.lock_backoff, keyspace) .retry_multi_region(DEFAULT_REGION_BACKOFF) @@ -276,7 +276,7 @@ impl Transaction { ) -> Result> { debug!("invoking transactional batch_get request"); self.check_allow_operation().await?; - let timestamp = self.timestamp.clone(); + let timestamp = self.timestamp; let rpc = self.rpc.clone(); let keyspace = self.keyspace; let keys = keys @@ -286,7 +286,7 @@ impl Transaction { self.buffer .batch_get_or_else(keys, move |keys| async move { - let request = new_batch_get_request(keys, timestamp.clone()); + let request = new_batch_get_request(keys, timestamp); let plan = PlanBuilder::new(rpc, keyspace, request) .resolve_lock(timestamp, retry_options.lock_backoff, keyspace) .retry_multi_region(retry_options.region_backoff) @@ -683,7 +683,7 @@ impl Transaction { let res = Committer::new( primary_key, mutations, - self.timestamp.clone(), + self.timestamp, self.rpc.clone(), self.options.clone(), self.keyspace, @@ -752,7 +752,7 @@ impl Transaction { let res = Committer::new( primary_key, mutations, - self.timestamp.clone(), + self.timestamp, self.rpc.clone(), self.options.clone(), self.keyspace, @@ -774,7 +774,7 @@ impl Transaction { /// Get the start timestamp of this transaction. pub fn start_timestamp(&self) -> Timestamp { - self.timestamp.clone() + self.timestamp } /// Send a heart beat message to keep the transaction alive on the server and update its TTL. @@ -789,13 +789,13 @@ impl Transaction { None => return Err(Error::NoPrimaryKey), }; let request = new_heart_beat_request( - self.timestamp.clone(), + self.timestamp, primary_key, self.start_instant.elapsed().as_millis() as u64 + MAX_TTL, ); let plan = PlanBuilder::new(self.rpc.clone(), self.keyspace, request) .resolve_lock( - self.timestamp.clone(), + self.timestamp, self.options.retry_options.lock_backoff.clone(), self.keyspace, ) @@ -815,7 +815,7 @@ impl Transaction { reverse: bool, ) -> Result> { self.check_allow_operation().await?; - let timestamp = self.timestamp.clone(); + let timestamp = self.timestamp; let rpc = self.rpc.clone(); let retry_options = self.options.retry_options.clone(); let keyspace = self.keyspace; @@ -828,13 +828,8 @@ impl Transaction { !key_only, reverse, move |new_range, new_limit| async move { - let request = new_scan_request( - new_range, - timestamp.clone(), - new_limit, - key_only, - reverse, - ); + let request = + new_scan_request(new_range, timestamp, new_limit, key_only, reverse); let plan = PlanBuilder::new(rpc, keyspace, request) .resolve_lock(timestamp, retry_options.lock_backoff, keyspace) .retry_multi_region(retry_options.region_backoff) @@ -885,18 +880,18 @@ impl Transaction { .get_primary_key() .unwrap_or_else(|| first_key.clone()); let for_update_ts = self.rpc.clone().get_timestamp().await?; - self.options.push_for_update_ts(for_update_ts.clone()); + self.options.push_for_update_ts(for_update_ts); let request = new_pessimistic_lock_request( keys.clone().into_iter(), primary_lock, - self.timestamp.clone(), + self.timestamp, MAX_TTL, - for_update_ts.clone(), + for_update_ts, need_value, ); let plan = PlanBuilder::new(self.rpc.clone(), self.keyspace, request) .resolve_lock( - self.timestamp.clone(), + self.timestamp, self.options.retry_options.lock_backoff.clone(), self.keyspace, ) @@ -919,7 +914,7 @@ impl Transaction { for_update_ts.version(), ); let keys = success_keys.into_iter().map(Key::from); - self.pessimistic_lock_rollback(keys, self.timestamp.clone(), for_update_ts) + self.pessimistic_lock_rollback(keys, self.timestamp, for_update_ts) .await?; Err(*inner) } @@ -959,7 +954,7 @@ impl Transaction { let req = new_pessimistic_rollback_request( keys.clone().into_iter(), - start_version.clone(), + start_version, for_update_ts, ); let plan = PlanBuilder::new(self.rpc.clone(), self.keyspace, req) @@ -1006,7 +1001,7 @@ impl Transaction { .buffer .get_primary_key() .expect("Primary key should exist"); - let start_ts = self.timestamp.clone(); + let start_ts = self.timestamp; let region_backoff = self.options.retry_options.region_backoff.clone(); let rpc = self.rpc.clone(); let heartbeat_interval = match self.options.heartbeat_option { @@ -1036,7 +1031,7 @@ impl Transaction { } } let request = new_heart_beat_request( - start_ts.clone(), + start_ts, primary_key.clone(), start_instant.elapsed().as_millis() as u64 + MAX_TTL, ); @@ -1398,7 +1393,7 @@ impl Committer { } } }; - tokio::spawn(self.commit_secondary(commit_ts.clone()).map(|res| { + tokio::spawn(self.commit_secondary(commit_ts).map(|res| { if let Err(e) = res { log::warn!("Failed to commit secondary keys: {}", e); } @@ -1419,15 +1414,15 @@ impl Committer { TransactionKind::Optimistic => new_prewrite_request( self.mutations.clone(), primary_lock, - self.start_version.clone(), + self.start_version, lock_ttl + elapsed, ), TransactionKind::Pessimistic(for_update_ts) => new_pessimistic_prewrite_request( self.mutations.clone(), primary_lock, - self.start_version.clone(), + self.start_version, lock_ttl + elapsed, - for_update_ts.clone(), + *for_update_ts, ), }; @@ -1442,7 +1437,7 @@ impl Committer { // FIXME set max_commit_ts and min_commit_ts let builder = PlanBuilder::new(self.rpc.clone(), self.keyspace, request).resolve_lock( - self.start_version.clone(), + self.start_version, self.options.retry_options.lock_backoff.clone(), self.keyspace, ); @@ -1490,14 +1485,10 @@ impl Committer { ); let primary_key = self.primary_key.clone().into_iter(); let commit_version = self.rpc.clone().get_timestamp().await?; - let req = new_commit_request( - primary_key, - self.start_version.clone(), - commit_version.clone(), - ); + let req = new_commit_request(primary_key, self.start_version, commit_version); let plan = PlanBuilder::new(self.rpc.clone(), self.keyspace, req) .resolve_lock( - self.start_version.clone(), + self.start_version, self.options.retry_options.lock_backoff.clone(), self.keyspace, ) @@ -1589,7 +1580,7 @@ impl Committer { self.start_version.version(), self.mutations.len() ); - let start_version = self.start_version.clone(); + let start_version = self.start_version; let mutations_len = self.mutations.len(); let primary_only = mutations_len == 1; #[cfg(not(feature = "integration-tests"))] @@ -1624,7 +1615,7 @@ impl Committer { let req = if self.options.async_commit { let keys = mutations.map(|m| m.key.into()); - new_commit_request(keys, start_version.clone(), commit_version) + new_commit_request(keys, start_version, commit_version) } else if primary_only { return Ok(()); } else { @@ -1632,7 +1623,7 @@ impl Committer { let keys = mutations .map(|m| m.key.into()) .filter(|key| &primary_key != key); - new_commit_request(keys, start_version.clone(), commit_version) + new_commit_request(keys, start_version, commit_version) }; let plan = PlanBuilder::new(self.rpc, self.keyspace, req) .resolve_lock( @@ -1677,15 +1668,14 @@ impl Committer { .mutations .into_iter() .map(|mutation| mutation.key.into()); - let start_version = self.start_version.clone(); + let start_version = self.start_version; let lock_backoff = self.options.retry_options.lock_backoff.clone(); let region_backoff = self.options.retry_options.region_backoff.clone(); let rpc = self.rpc; let keyspace = self.keyspace; match self.options.kind { TransactionKind::Pessimistic(for_update_ts) if !prewritten => { - let req = - new_pessimistic_rollback_request(keys, start_version.clone(), for_update_ts); + let req = new_pessimistic_rollback_request(keys, start_version, for_update_ts); let plan = PlanBuilder::new(rpc, keyspace, req) .resolve_lock(start_version, lock_backoff, keyspace) .retry_multi_region(region_backoff) @@ -1696,7 +1686,7 @@ impl Committer { // Optimistic, or pessimistic after prewrite: BatchRollback clears // both pessimistic and 2PC locks by start_ts. _ => { - let req = new_batch_rollback_request(keys, start_version.clone()); + let req = new_batch_rollback_request(keys, start_version); let plan = PlanBuilder::new(rpc, keyspace, req) .resolve_lock(start_version, lock_backoff, keyspace) .retry_multi_region(region_backoff) diff --git a/src/transaction/transaction/scanner.rs b/src/transaction/transaction/scanner.rs index 67959f30..60e52918 100644 --- a/src/transaction/transaction/scanner.rs +++ b/src/transaction/transaction/scanner.rs @@ -263,7 +263,7 @@ impl RemoteScanner { status: txn.status.clone(), pd_client: txn.rpc.clone(), keyspace: txn.keyspace, - timestamp: txn.timestamp.clone(), + timestamp: txn.timestamp, retry_options: txn.options.retry_options.clone(), end, next_start: start, @@ -371,20 +371,14 @@ impl RemoteScanner { } }; - let request = new_scan_request( - span, - self.timestamp.clone(), - SCANNER_BATCH_SIZE, - false, - false, - ); + let request = new_scan_request(span, self.timestamp, SCANNER_BATCH_SIZE, false, false); let plan = match PlanBuilder::new(self.pd_client.clone(), keyspace, request) .single_region_with_store(region_store.clone()) .await { Ok(builder) => builder .resolve_lock( - self.timestamp.clone(), + self.timestamp, self.retry_options.lock_backoff.clone(), keyspace, )