// This file is @generated by prost-build.
/// DownloadTaskRequest represents request of DownloadTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskRequest {
    /// Download information.
    #[prost(message, optional, tag = "1")]
    pub download: ::core::option::Option<super::super::common::v2::Download>,
}
/// DownloadTaskStartedResponse represents task download started response of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskStartedResponse {
    /// Task content length.
    #[prost(uint64, tag = "1")]
    pub content_length: u64,
    /// Range is url range of request. If protocol is http, range
    /// is parsed from http header. If other protocol, range comes
    /// from download range field.
    #[prost(message, optional, tag = "2")]
    pub range: ::core::option::Option<super::super::common::v2::Range>,
    /// Task response headers.
    #[prost(map = "string, string", tag = "3")]
    pub response_header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Need to download pieces.
    #[prost(message, repeated, tag = "4")]
    pub pieces: ::prost::alloc::vec::Vec<super::super::common::v2::Piece>,
    /// is_finished indicates whether the download task is finished.
    #[prost(bool, tag = "5")]
    pub is_finished: bool,
}
/// DownloadPieceFinishedResponse represents piece download finished response of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPieceFinishedResponse {
    /// Finished piece of task.
    #[prost(message, optional, tag = "1")]
    pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
/// DownloadTaskResponse represents response of DownloadTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskResponse {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Peer id.
    #[prost(string, tag = "3")]
    pub peer_id: ::prost::alloc::string::String,
    #[prost(oneof = "download_task_response::Response", tags = "4, 5")]
    pub response: ::core::option::Option<download_task_response::Response>,
}
/// Nested message and enum types in `DownloadTaskResponse`.
pub mod download_task_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "4")]
        DownloadTaskStartedResponse(super::DownloadTaskStartedResponse),
        #[prost(message, tag = "5")]
        DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
    }
}
/// SyncPiecesRequest represents request of SyncPieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPiecesRequest {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Interested piece numbers.
    #[prost(uint32, repeated, tag = "3")]
    pub interested_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
/// SyncPiecesResponse represents response of SyncPieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPiecesResponse {
    /// Exist piece number.
    #[prost(uint32, tag = "1")]
    pub number: u32,
    /// Piece offset.
    #[prost(uint64, tag = "2")]
    pub offset: u64,
    /// Piece length.
    #[prost(uint64, tag = "3")]
    pub length: u64,
    /// IP is used to indicate the IP address of the peer. If protocol is rdma,
    /// the IP is used to exchange the queue pair endpoint of IBVerbs.
    #[prost(string, tag = "4")]
    pub ip: ::prost::alloc::string::String,
    /// TCP port is used to indicate the tcp server port of the peer.
    #[prost(int32, optional, tag = "5")]
    pub tcp_port: ::core::option::Option<i32>,
    /// QUIC port is used to indicate the quic server port of the peer.
    #[prost(int32, optional, tag = "6")]
    pub quic_port: ::core::option::Option<i32>,
}
/// StatTaskRequest represents request of StatTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the stat request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatLocalTaskRequest represents request of StatLocalTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the stat request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatLocalTaskResponse represents response of StatLocalTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatLocalTaskResponse {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Task piece length.
    #[prost(uint64, optional, tag = "2")]
    pub piece_length: ::core::option::Option<u64>,
    /// Task content length.
    #[prost(uint64, optional, tag = "3")]
    pub content_length: ::core::option::Option<u64>,
    /// Task response headers.
    #[prost(map = "string, string", tag = "4")]
    pub response_header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Uploading count is the count of the task being uploaded by other peers.
    #[prost(uint64, tag = "5")]
    pub uploading_count: u64,
    /// Uploaded count is the count of the task has been uploaded by other peers.
    #[prost(uint64, tag = "6")]
    pub uploaded_count: u64,
    /// Task create time.
    #[prost(message, optional, tag = "7")]
    pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task update time.
    #[prost(message, optional, tag = "8")]
    pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task prefetch time.
    #[prost(message, optional, tag = "9")]
    pub prefetched_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task fail time.
    #[prost(message, optional, tag = "10")]
    pub failed_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task finish time.
    #[prost(message, optional, tag = "11")]
    pub finished_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// ListLocalTasksRequest represents request of ListLocalTasks.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListLocalTasksRequest {
    /// Remote IP represents the IP address of the client initiating the list request.
    #[prost(string, optional, tag = "1")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// ListLocalTasksResponse represents response of ListLocalTasks.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocalTasksResponse {
    /// Task ids of the local tasks.
    #[prost(message, repeated, tag = "1")]
    pub tasks: ::prost::alloc::vec::Vec<StatLocalTaskResponse>,
}
/// ListTaskEntriesRequest represents request of ListTaskEntries.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTaskEntriesRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// URL to be listed the entries.
    #[prost(string, tag = "2")]
    pub url: ::prost::alloc::string::String,
    /// HTTP header to be sent with the request.
    #[prost(map = "string, string", tag = "3")]
    pub request_header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// List timeout.
    #[prost(message, optional, tag = "4")]
    pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
    /// certificate_chain is the client certs with DER format for the backend client to list the entries.
    #[prost(bytes = "vec", repeated, tag = "5")]
    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
    /// Object storage protocol information.
    #[prost(message, optional, tag = "6")]
    pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
    /// HDFS protocol information.
    #[prost(message, optional, tag = "7")]
    pub hdfs: ::core::option::Option<super::super::common::v2::Hdfs>,
    /// Remote IP represents the IP address of the client initiating the list request.
    #[prost(string, optional, tag = "8")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
    /// HuggingFace protocol information.
    #[prost(message, optional, tag = "9")]
    pub hugging_face: ::core::option::Option<super::super::common::v2::HuggingFace>,
    /// ModelScope protocol information.
    #[prost(message, optional, tag = "10")]
    pub model_scope: ::core::option::Option<super::super::common::v2::ModelScope>,
}
/// ListTaskEntriesResponse represents response of ListTaskEntries.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTaskEntriesResponse {
    /// Content length is the content length of the response
    #[prost(uint64, tag = "1")]
    pub content_length: u64,
    /// HTTP header to be sent with the request.
    #[prost(map = "string, string", tag = "2")]
    pub response_header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Backend HTTP status code.
    #[prost(int32, optional, tag = "3")]
    pub status_code: ::core::option::Option<i32>,
    /// / Entries is the information of the entries in the directory.
    #[prost(message, repeated, tag = "4")]
    pub entries: ::prost::alloc::vec::Vec<Entry>,
}
/// Entry represents an entry in a directory.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Entry {
    /// URL of the entry.
    #[prost(string, tag = "1")]
    pub url: ::prost::alloc::string::String,
    /// Size of the entry.
    #[prost(uint64, tag = "2")]
    pub content_length: u64,
    /// Is directory or not.
    #[prost(bool, tag = "3")]
    pub is_dir: bool,
}
/// DeleteTaskRequest represents request of DeleteTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the delete request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// DeleteLocalTaskRequest represents request of DeleteLocalTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteLocalTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the delete request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// DownloadCacheTaskRequest represents request of DownloadCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadCacheTaskRequest {
    /// Download url.
    #[prost(string, tag = "1")]
    pub url: ::prost::alloc::string::String,
    /// Digest of the task digest, for example :xxx or sha256:yyy.
    #[prost(string, optional, tag = "2")]
    pub digest: ::core::option::Option<::prost::alloc::string::String>,
    /// Range is url range of request. If protocol is http, range
    /// will set in request header. If protocol is others, range
    /// will set in range field.
    #[prost(message, optional, tag = "3")]
    pub range: ::core::option::Option<super::super::common::v2::Range>,
    /// Task type.
    #[prost(enumeration = "super::super::common::v2::TaskType", tag = "4")]
    pub r#type: i32,
    /// URL tag identifies different task for same url.
    #[prost(string, optional, tag = "5")]
    pub tag: ::core::option::Option<::prost::alloc::string::String>,
    /// Application of task.
    #[prost(string, optional, tag = "6")]
    pub application: ::core::option::Option<::prost::alloc::string::String>,
    /// Peer priority.
    #[prost(enumeration = "super::super::common::v2::Priority", tag = "7")]
    pub priority: i32,
    /// Filtered query params to generate the task id.
    /// When filter is \["Signature", "Expires", "ns"\], for example:
    /// <http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io> and <http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io>
    /// will generate the same task id.
    /// Default value includes the filtered query params of s3, gcs, oss, obs, cos.
    #[prost(string, repeated, tag = "8")]
    pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Task request headers.
    #[prost(map = "string, string", tag = "9")]
    pub request_header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Task piece length.
    #[prost(uint64, optional, tag = "10")]
    pub piece_length: ::core::option::Option<u64>,
    /// File path to be downloaded. If output_path is set, the downloaded file will be saved to the specified path.
    /// Dfdaemon will try to create hard link to the output path before starting the download. If hard link creation fails,
    /// it will copy the file to the output path after the download is completed.
    /// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
    #[prost(string, optional, tag = "11")]
    pub output_path: ::core::option::Option<::prost::alloc::string::String>,
    /// Download timeout.
    #[prost(message, optional, tag = "12")]
    pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
    /// Dfdaemon cannot download the task from the source if disable_back_to_source is true.
    #[prost(bool, tag = "13")]
    pub disable_back_to_source: bool,
    /// Scheduler needs to schedule the task downloads from the source if need_back_to_source is true.
    #[prost(bool, tag = "14")]
    pub need_back_to_source: bool,
    /// certificate_chain is the client certs with DER format for the backend client to download back-to-source.
    #[prost(bytes = "vec", repeated, tag = "15")]
    pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
    /// Prefetch pre-downloads all pieces of the task when the download task request is a range request.
    #[prost(bool, tag = "16")]
    pub prefetch: bool,
    /// Object storage protocol information.
    #[prost(message, optional, tag = "17")]
    pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
    /// HDFS protocol information.
    #[prost(message, optional, tag = "18")]
    pub hdfs: ::core::option::Option<super::super::common::v2::Hdfs>,
    /// is_prefetch is the flag to indicate whether the request is a prefetch request.
    #[prost(bool, tag = "19")]
    pub is_prefetch: bool,
    /// need_piece_content is the flag to indicate whether the response needs to return piece content.
    #[prost(bool, tag = "20")]
    pub need_piece_content: bool,
    /// content_for_calculating_task_id is the content used to calculate the task id.
    /// If content_for_calculating_task_id is set, use its value to calculate the task ID.
    /// Otherwise, calculate the task ID based on url, piece_length, tag, application, and filtered_query_params.
    #[prost(string, optional, tag = "21")]
    pub content_for_calculating_task_id: ::core::option::Option<
        ::prost::alloc::string::String,
    >,
    /// remote_ip represents the IP address of the client initiating the download request.
    /// For proxy requests, it is set to the IP address of the request source.
    /// For dfget requests, it is set to the IP address of the dfget.
    #[prost(string, optional, tag = "22")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
    /// Overwrite indicates whether to overwrite the existing file at output path.
    #[prost(bool, tag = "23")]
    pub overwrite: bool,
}
/// DownloadCacheTaskStartedResponse represents cache task download started response of DownloadCacheTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadCacheTaskStartedResponse {
    /// Task content length.
    #[prost(uint64, tag = "1")]
    pub content_length: u64,
    /// Range is url range of request. If protocol is http, range
    /// is parsed from http header. If other protocol, range comes
    /// from download range field.
    #[prost(message, optional, tag = "2")]
    pub range: ::core::option::Option<super::super::common::v2::Range>,
    /// Task response headers.
    #[prost(map = "string, string", tag = "3")]
    pub response_header: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Need to download pieces.
    #[prost(message, repeated, tag = "4")]
    pub pieces: ::prost::alloc::vec::Vec<super::super::common::v2::Piece>,
    /// is_finished indicates whether the download task is finished.
    #[prost(bool, tag = "5")]
    pub is_finished: bool,
}
/// DownloadCacheTaskResponse represents response of DownloadCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadCacheTaskResponse {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Peer id.
    #[prost(string, tag = "3")]
    pub peer_id: ::prost::alloc::string::String,
    #[prost(oneof = "download_cache_task_response::Response", tags = "4, 5")]
    pub response: ::core::option::Option<download_cache_task_response::Response>,
}
/// Nested message and enum types in `DownloadCacheTaskResponse`.
pub mod download_cache_task_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "4")]
        DownloadCacheTaskStartedResponse(super::DownloadCacheTaskStartedResponse),
        #[prost(message, tag = "5")]
        DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
    }
}
/// SyncCachePiecesRequest represents request of SyncCachePieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncCachePiecesRequest {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Interested piece numbers.
    #[prost(uint32, repeated, tag = "3")]
    pub interested_cache_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
/// SyncCachePiecesResponse represents response of SyncCachePieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncCachePiecesResponse {
    /// Exist piece number.
    #[prost(uint32, tag = "1")]
    pub number: u32,
    /// Piece offset.
    #[prost(uint64, tag = "2")]
    pub offset: u64,
    /// Piece length.
    #[prost(uint64, tag = "3")]
    pub length: u64,
}
/// DownloadCachePieceRequest represents request of DownloadCachePiece.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePieceRequest {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Piece number.
    #[prost(uint32, tag = "3")]
    pub piece_number: u32,
}
/// DownloadCachePieceResponse represents response of DownloadCachePieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePieceResponse {
    /// Piece information.
    #[prost(message, optional, tag = "1")]
    pub piece: ::core::option::Option<super::super::common::v2::Piece>,
    /// Piece metadata digest, it is used to verify the integrity of the piece metadata.
    #[prost(string, optional, tag = "2")]
    pub digest: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatCacheTaskRequest represents request of StatCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the stat request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// DeleteCacheTaskRequest represents request of DeleteCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the delete request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// DownloadPersistentTaskRequest represents request of DownloadPersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentTaskRequest {
    /// This is the url of the object storage protocal where the persistent task will be stored,
    /// for example: `s3://<bucket>/path`, `gcs://<bucket>/path`. The combination of url,
    /// object_storage.endpoint and object_storage.region must be unique, because
    /// the persistent task cannot be overwritten once it is uploaded.
    #[prost(string, tag = "1")]
    pub url: ::prost::alloc::string::String,
    /// Object storage protocol information.
    #[prost(message, optional, tag = "2")]
    pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
    /// Persistent represents whether the persistent task is persistent.
    /// If the persistent task is persistent, the persistent peer will
    /// not be deleted when dfdaemon runs garbage collection.
    #[prost(bool, tag = "3")]
    pub persistent: bool,
    /// File path to be exported. If output_path is set, the exported file will be saved to the specified path.
    /// Dfdaemon will try to create hard link to the output path before starting the export. If hard link creation fails,
    /// it will copy the file to the output path after the export is completed.
    /// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
    #[prost(string, optional, tag = "4")]
    pub output_path: ::core::option::Option<::prost::alloc::string::String>,
    /// Download timeout.
    #[prost(message, optional, tag = "5")]
    pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
    /// need_piece_content is the flag to indicate whether the response needs to return piece content.
    #[prost(bool, tag = "6")]
    pub need_piece_content: bool,
    /// force_hard_link is the flag to indicate whether the exported file must be hard linked to the output path.
    /// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
    #[prost(bool, tag = "7")]
    pub force_hard_link: bool,
    /// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
    /// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
    /// Returns an error if the computed digest mismatches the expected value.
    ///
    /// Performance
    /// Digest calculation increases processing time. Enable only when data integrity verification is critical.
    #[prost(string, optional, tag = "8")]
    pub digest: ::core::option::Option<::prost::alloc::string::String>,
    /// Remote IP represents the IP address of the client initiating the download request.
    #[prost(string, optional, tag = "9")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
    /// Overwrite indicates whether to overwrite the existing file at output path.
    #[prost(bool, tag = "10")]
    pub overwrite: bool,
}
/// DownloadPersistentTaskStartedResponse represents task download started response of DownloadPersistentTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentTaskStartedResponse {
    /// Task content length.
    #[prost(uint64, tag = "1")]
    pub content_length: u64,
}
/// DownloadPersistentTaskResponse represents response of DownloadPersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentTaskResponse {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Peer id.
    #[prost(string, tag = "3")]
    pub peer_id: ::prost::alloc::string::String,
    #[prost(oneof = "download_persistent_task_response::Response", tags = "4, 5")]
    pub response: ::core::option::Option<download_persistent_task_response::Response>,
}
/// Nested message and enum types in `DownloadPersistentTaskResponse`.
pub mod download_persistent_task_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "4")]
        DownloadPersistentTaskStartedResponse(
            super::DownloadPersistentTaskStartedResponse,
        ),
        #[prost(message, tag = "5")]
        DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
    }
}
/// UploadPersistentTaskRequest represents request of UploadPersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentTaskRequest {
    /// This is the url of the object storage protocal where the persistent task will be stored,
    /// for example: `s3://<bucket>/path`, `gcs://<bucket>/path`. The combination of url,
    /// object_storage.endpoint and object_storage.region must be unique, because
    /// the persistent task cannot be overwritten once it is uploaded.
    #[prost(string, tag = "1")]
    pub url: ::prost::alloc::string::String,
    /// Object storage protocol information.
    #[prost(message, optional, tag = "2")]
    pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
    /// Source file path of the persistent task.
    #[prost(string, tag = "3")]
    pub path: ::prost::alloc::string::String,
    /// Replica count of the persistent persistent task.
    #[prost(uint64, tag = "4")]
    pub persistent_replica_count: u64,
    /// TTL of the persistent task.
    #[prost(message, optional, tag = "5")]
    pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
    /// Download timeout.
    #[prost(message, optional, tag = "6")]
    pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
    /// Remote IP represents the IP address of the client initiating the upload request.
    #[prost(string, optional, tag = "7")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// UpdatePersistentTaskRequest represents request of UpdatePersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdatePersistentTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Persistent represents whether the persistent peer is persistent.
    /// If the persistent peer is persistent, the persistent peer will
    /// not be deleted when dfdaemon runs garbage collection. It only be deleted
    /// when the task is deleted by the user.
    #[prost(bool, tag = "2")]
    pub persistent: bool,
    /// Remote IP represents the IP address of the client initiating the list request.
    #[prost(string, optional, tag = "3")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatPersistentTaskRequest represents request of StatPersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the stat request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatLocalPersistentTaskRequest represents request of StatLocalPersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the stat request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatLocalPersistentTaskResponse represents response of StatLocalPersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentTaskResponse {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Persistent represents whether the persistent task is persistent.
    /// If the persistent task is persistent, the persistent peer will
    /// not be deleted when dfdamon runs garbage collection.
    #[prost(bool, tag = "2")]
    pub persistent: bool,
    /// TTL of the persistent task.
    #[prost(message, optional, tag = "3")]
    pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
    /// Task piece length.
    #[prost(uint64, optional, tag = "4")]
    pub piece_length: ::core::option::Option<u64>,
    /// Task content length.
    #[prost(uint64, optional, tag = "5")]
    pub content_length: ::core::option::Option<u64>,
    /// Uploading count is the count of the persistent task being uploaded by other peers.
    #[prost(uint64, tag = "6")]
    pub uploading_count: u64,
    /// Uploaded count is the count of the persistent task has been uploaded by other peers.
    #[prost(uint64, tag = "7")]
    pub uploaded_count: u64,
    /// Task create time.
    #[prost(message, optional, tag = "8")]
    pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task update time.
    #[prost(message, optional, tag = "9")]
    pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task fail time.
    #[prost(message, optional, tag = "10")]
    pub failed_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task finish time.
    #[prost(message, optional, tag = "11")]
    pub finished_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// ListLocalPersistentTasksRequest represents request of ListLocalPersistentTasks.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListLocalPersistentTasksRequest {
    /// Remote IP represents the IP address of the client initiating the list request.
    #[prost(string, optional, tag = "1")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// ListLocalPersistentTasksResponse represents response of ListLocalPersistentTasks.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocalPersistentTasksResponse {
    /// Task ids of the local tasks.
    #[prost(message, repeated, tag = "1")]
    pub tasks: ::prost::alloc::vec::Vec<StatLocalPersistentTaskResponse>,
}
/// DeletePersistentTaskRequest represents request of DeletePersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the delete request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// SyncPersistentPiecesRequest represents request of SyncPersistentPieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentPiecesRequest {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Interested piece numbers.
    #[prost(uint32, repeated, tag = "3")]
    pub interested_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
/// SyncPersistentPiecesResponse represents response of SyncPersistentPieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentPiecesResponse {
    /// Exist piece number.
    #[prost(uint32, tag = "1")]
    pub number: u32,
    /// Piece offset.
    #[prost(uint64, tag = "2")]
    pub offset: u64,
    /// Piece length.
    #[prost(uint64, tag = "3")]
    pub length: u64,
    /// IP is used to indicate the IP address of the peer. If protocol is rdma,
    /// the IP is used to exchange the queue pair endpoint of IBVerbs.
    #[prost(string, tag = "4")]
    pub ip: ::prost::alloc::string::String,
    /// TCP port is used to indicate the tcp server port of the peer.
    #[prost(int32, optional, tag = "5")]
    pub tcp_port: ::core::option::Option<i32>,
    /// QUIC port is used to indicate the quic server port of the peer.
    #[prost(int32, optional, tag = "6")]
    pub quic_port: ::core::option::Option<i32>,
}
/// DownloadPersistentCacheTaskRequest represents request of DownloadPersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Persistent represents whether the persistent cache task is persistent.
    /// If the persistent cache task is persistent, the persistent cache peer will
    /// not be deleted when dfdaemon runs garbage collection.
    #[prost(bool, tag = "2")]
    pub persistent: bool,
    /// Tag is used to distinguish different persistent cache tasks.
    #[prost(string, optional, tag = "3")]
    pub tag: ::core::option::Option<::prost::alloc::string::String>,
    /// Application of task.
    #[prost(string, optional, tag = "4")]
    pub application: ::core::option::Option<::prost::alloc::string::String>,
    /// File path to be exported. If output_path is set, the exported file will be saved to the specified path.
    /// Dfdaemon will try to create hard link to the output path before starting the export. If hard link creation fails,
    /// it will copy the file to the output path after the export is completed.
    /// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
    #[prost(string, optional, tag = "5")]
    pub output_path: ::core::option::Option<::prost::alloc::string::String>,
    /// Download timeout.
    #[prost(message, optional, tag = "6")]
    pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
    /// need_piece_content is the flag to indicate whether the response needs to return piece content.
    #[prost(bool, tag = "7")]
    pub need_piece_content: bool,
    /// force_hard_link is the flag to indicate whether the exported file must be hard linked to the output path.
    /// For more details refer to <https://github.com/dragonflyoss/design/blob/main/systems-analysis/file-download-workflow-with-hard-link/README.md.>
    #[prost(bool, tag = "8")]
    pub force_hard_link: bool,
    /// Verifies task data integrity after download using a digest. Supports CRC32, SHA256, and SHA512 algorithms.
    /// Format: `<algorithm>:<hash>`, e.g., `crc32:xxx`, `sha256:yyy`, `sha512:zzz`.
    /// Returns an error if the computed digest mismatches the expected value.
    ///
    /// Performance
    /// Digest calculation increases processing time. Enable only when data integrity verification is critical.
    #[prost(string, optional, tag = "9")]
    pub digest: ::core::option::Option<::prost::alloc::string::String>,
    /// Remote IP represents the IP address of the client initiating the download request.
    #[prost(string, optional, tag = "10")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
    /// Overwrite indicates whether to overwrite the existing file at output path.
    #[prost(bool, tag = "11")]
    pub overwrite: bool,
}
/// DownloadPersistentCacheTaskStartedResponse represents task download started response of DownloadPersistentCacheTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCacheTaskStartedResponse {
    /// Task content length.
    #[prost(uint64, tag = "1")]
    pub content_length: u64,
}
/// DownloadPersistentCacheTaskResponse represents response of DownloadPersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCacheTaskResponse {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Peer id.
    #[prost(string, tag = "3")]
    pub peer_id: ::prost::alloc::string::String,
    #[prost(oneof = "download_persistent_cache_task_response::Response", tags = "4, 5")]
    pub response: ::core::option::Option<
        download_persistent_cache_task_response::Response,
    >,
}
/// Nested message and enum types in `DownloadPersistentCacheTaskResponse`.
pub mod download_persistent_cache_task_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "4")]
        DownloadPersistentCacheTaskStartedResponse(
            super::DownloadPersistentCacheTaskStartedResponse,
        ),
        #[prost(message, tag = "5")]
        DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
    }
}
/// UploadPersistentCacheTaskRequest represents request of UploadPersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentCacheTaskRequest {
    /// content_for_calculating_task_id is the content used to calculate the task id.
    /// If content_for_calculating_task_id is set, use its value to calculate the task ID.
    /// Otherwise, calculate the task ID based on the file content, tag and application by blake3 algorithm\`.
    #[prost(string, optional, tag = "1")]
    pub content_for_calculating_task_id: ::core::option::Option<
        ::prost::alloc::string::String,
    >,
    /// Upload file path of persistent cache task.
    #[prost(string, tag = "2")]
    pub path: ::prost::alloc::string::String,
    /// Replica count of the persistent persistent cache task.
    #[prost(uint64, tag = "3")]
    pub persistent_replica_count: u64,
    /// Tag is used to distinguish different persistent cache tasks.
    #[prost(string, optional, tag = "4")]
    pub tag: ::core::option::Option<::prost::alloc::string::String>,
    /// Application of the persistent cache task.
    #[prost(string, optional, tag = "5")]
    pub application: ::core::option::Option<::prost::alloc::string::String>,
    /// Piece length of the persistent cache task, the value needs to be greater than or equal to 4194304(4MiB).
    #[prost(uint64, optional, tag = "6")]
    pub piece_length: ::core::option::Option<u64>,
    /// TTL of the persistent cache task.
    #[prost(message, optional, tag = "7")]
    pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
    /// Download timeout.
    #[prost(message, optional, tag = "8")]
    pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
    /// Remote IP represents the IP address of the client initiating the upload request.
    #[prost(string, optional, tag = "9")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// UpdatePersistentCacheTaskRequest represents request of UpdatePersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdatePersistentCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Persistent represents whether the persistent cache peer is persistent.
    /// If the persistent cache peer is persistent, the persistent cache peer will
    /// not be deleted when dfdaemon runs garbage collection. It only be deleted
    /// when the task is deleted by the user.
    #[prost(bool, tag = "2")]
    pub persistent: bool,
    /// Remote IP represents the IP address of the client initiating the list request.
    #[prost(string, optional, tag = "3")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the stat request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatLocalPersistentCacheTaskRequest represents request of StatLocalPersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the stat request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// StatLocalPersistentTaskResponse represents response of StatLocalPersistentTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentCacheTaskResponse {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Persistent represents whether the persistent cache task is persistent.
    /// If the persistent cache task is persistent, the persistent cache peer will
    /// not be deleted when dfdamon runs garbage collection.
    #[prost(bool, tag = "2")]
    pub persistent: bool,
    /// TTL of the persistent task.
    #[prost(message, optional, tag = "3")]
    pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
    /// Task piece length.
    #[prost(uint64, optional, tag = "4")]
    pub piece_length: ::core::option::Option<u64>,
    /// Task content length.
    #[prost(uint64, optional, tag = "5")]
    pub content_length: ::core::option::Option<u64>,
    /// Uploading count is the count of the persistent cache task being uploaded by other peers.
    #[prost(uint64, tag = "6")]
    pub uploading_count: u64,
    /// Uploaded count is the count of the persistent cache task has been uploaded by other peers.
    #[prost(uint64, tag = "7")]
    pub uploaded_count: u64,
    /// Task create time.
    #[prost(message, optional, tag = "8")]
    pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task update time.
    #[prost(message, optional, tag = "9")]
    pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task fail time.
    #[prost(message, optional, tag = "10")]
    pub failed_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
    /// Task finish time.
    #[prost(message, optional, tag = "11")]
    pub finished_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
/// ListLocalPersistentCacheTasksRequest represents request of ListLocalPersistentCacheTasks.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListLocalPersistentCacheTasksRequest {
    /// Remote IP represents the IP address of the client initiating the list request.
    #[prost(string, optional, tag = "1")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// ListLocalPersistentTasksResponse represents response of ListLocalPersistentTasks.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocalPersistentCacheTasksResponse {
    /// Task ids of the local tasks.
    #[prost(message, repeated, tag = "1")]
    pub tasks: ::prost::alloc::vec::Vec<StatLocalPersistentCacheTaskResponse>,
}
/// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
    /// Remote IP represents the IP address of the client initiating the delete request.
    #[prost(string, optional, tag = "2")]
    pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
/// SyncPersistentCachePiecesRequest represents request of SyncPersistentCachePieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentCachePiecesRequest {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Task id.
    #[prost(string, tag = "2")]
    pub task_id: ::prost::alloc::string::String,
    /// Interested piece numbers.
    #[prost(uint32, repeated, tag = "3")]
    pub interested_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
/// SyncPersistentCachePiecesResponse represents response of SyncPersistentCachePieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentCachePiecesResponse {
    /// Exist piece number.
    #[prost(uint32, tag = "1")]
    pub number: u32,
    /// Piece offset.
    #[prost(uint64, tag = "2")]
    pub offset: u64,
    /// Piece length.
    #[prost(uint64, tag = "3")]
    pub length: u64,
    /// IP is used to indicate the IP address of the peer. If protocol is rdma,
    /// the IP is used to exchange the queue pair endpoint of IBVerbs.
    #[prost(string, tag = "4")]
    pub ip: ::prost::alloc::string::String,
    /// TCP port is used to indicate the tcp server port of the peer.
    #[prost(int32, optional, tag = "5")]
    pub tcp_port: ::core::option::Option<i32>,
    /// QUIC port is used to indicate the quic server port of the peer.
    #[prost(int32, optional, tag = "6")]
    pub quic_port: ::core::option::Option<i32>,
}
/// SyncHostRequest represents request of SyncHost.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncHostRequest {
    /// Host id.
    #[prost(string, tag = "1")]
    pub host_id: ::prost::alloc::string::String,
    /// Peer id.
    #[prost(string, tag = "2")]
    pub peer_id: ::prost::alloc::string::String,
}
/// IBVerbsQueuePairEndpoint represents queue pair endpoint of IBVerbs.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IbVerbsQueuePairEndpoint {
    /// Number of the queue pair.
    #[prost(uint32, tag = "1")]
    pub num: u32,
    /// Local identifier of the context.
    #[prost(uint32, tag = "2")]
    pub lid: u32,
    /// Global identifier of the context.
    #[prost(bytes = "vec", tag = "3")]
    pub gid: ::prost::alloc::vec::Vec<u8>,
}
/// Generated client implementations.
pub mod dfdaemon_upload_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// DfdaemonUpload represents upload service of dfdaemon.
    #[derive(Debug, Clone)]
    pub struct DfdaemonUploadClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl DfdaemonUploadClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> DfdaemonUploadClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> DfdaemonUploadClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            DfdaemonUploadClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// DownloadTask downloads task from p2p network.
        pub async fn download_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::DownloadTaskResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DownloadTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DownloadTask"));
            self.inner.server_streaming(req, path, codec).await
        }
        /// StatTask stats task information.
        pub async fn stat_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::Task>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/StatTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatTask"));
            self.inner.unary(req, path, codec).await
        }
        /// StatLocalTask stats local task information from peer.
        pub async fn stat_local_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatLocalTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalTaskResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/StatLocalTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatLocalTask"));
            self.inner.unary(req, path, codec).await
        }
        /// ListTaskEntries lists task entries for downloading directory.
        pub async fn list_task_entries(
            &mut self,
            request: impl tonic::IntoRequest<super::ListTaskEntriesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListTaskEntriesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/ListTaskEntries",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "ListTaskEntries"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DeleteTask deletes task from p2p network.
        pub async fn delete_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DeleteTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DeleteTask"));
            self.inner.unary(req, path, codec).await
        }
        /// SyncPieces syncs piece metadatas from remote peer.
        pub async fn sync_pieces(
            &mut self,
            request: impl tonic::IntoRequest<super::SyncPiecesRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::SyncPiecesResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/SyncPieces",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncPieces"));
            self.inner.server_streaming(req, path, codec).await
        }
        /// DownloadCacheTask downloads cache task from p2p network.
        pub async fn download_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::DownloadCacheTaskResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DownloadCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DownloadCacheTask"),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// StatCacheTask stats cache task information.
        pub async fn stat_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::CacheTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/StatCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatCacheTask"));
            self.inner.unary(req, path, codec).await
        }
        /// DeleteCacheTask deletes cache task from p2p network.
        pub async fn delete_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DeleteCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DeleteCacheTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// SyncCachePieces syncs cache piece metadatas from remote peer.
        pub async fn sync_cache_pieces(
            &mut self,
            request: impl tonic::IntoRequest<super::SyncCachePiecesRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::SyncCachePiecesResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/SyncCachePieces",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncCachePieces"),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// DownloadCachePiece downloads cache piece from the remote peer.
        pub async fn download_cache_piece(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadCachePieceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DownloadCachePieceResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DownloadCachePiece",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DownloadCachePiece"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DownloadPersistentTask downloads persistent task from p2p network.
        pub async fn download_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<
                tonic::codec::Streaming<super::DownloadPersistentTaskResponse>,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "DownloadPersistentTask",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// SyncPersistentPieces syncs persistent pieces from remote peer.
        pub async fn sync_persistent_pieces(
            &mut self,
            request: impl tonic::IntoRequest<super::SyncPersistentPiecesRequest>,
        ) -> std::result::Result<
            tonic::Response<
                tonic::codec::Streaming<super::SyncPersistentPiecesResponse>,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/SyncPersistentPieces",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncPersistentPieces"),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// UpdatePersistentTask updates metadate of thr persistent task in p2p network.
        pub async fn update_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdatePersistentTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/UpdatePersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "UpdatePersistentTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// StatPersistentTask stats persistent task information.
        pub async fn stat_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/StatPersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatPersistentTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DeletePersistentTask deletes persistent task from p2p network.
        pub async fn delete_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DeletePersistentTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DeletePersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DeletePersistentTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
        pub async fn download_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<
                tonic::codec::Streaming<super::DownloadPersistentCacheTaskResponse>,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "DownloadPersistentCacheTask",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
        pub async fn update_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdatePersistentCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/UpdatePersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "UpdatePersistentCacheTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// StatPersistentCacheTask stats persistent cache task information.
        pub async fn stat_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/StatPersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "StatPersistentCacheTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DeletePersistentCacheTask deletes persistent cache task from p2p network.
        pub async fn delete_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DeletePersistentCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DeletePersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "DeletePersistentCacheTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
        pub async fn sync_persistent_cache_pieces(
            &mut self,
            request: impl tonic::IntoRequest<super::SyncPersistentCachePiecesRequest>,
        ) -> std::result::Result<
            tonic::Response<
                tonic::codec::Streaming<super::SyncPersistentCachePiecesResponse>,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/SyncPersistentCachePieces",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "SyncPersistentCachePieces",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// SyncHost sync host info from parents.
        pub async fn sync_host(
            &mut self,
            request: impl tonic::IntoRequest<super::SyncHostRequest>,
        ) -> std::result::Result<
            tonic::Response<
                tonic::codec::Streaming<super::super::super::common::v2::Host>,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/SyncHost",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncHost"));
            self.inner.server_streaming(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod dfdaemon_upload_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with DfdaemonUploadServer.
    #[async_trait]
    pub trait DfdaemonUpload: std::marker::Send + std::marker::Sync + 'static {
        /// Server streaming response type for the DownloadTask method.
        type DownloadTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::DownloadTaskResponse, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        /// DownloadTask downloads task from p2p network.
        async fn download_task(
            &self,
            request: tonic::Request<super::DownloadTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadTaskStream>,
            tonic::Status,
        >;
        /// StatTask stats task information.
        async fn stat_task(
            &self,
            request: tonic::Request<super::StatTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::Task>,
            tonic::Status,
        >;
        /// StatLocalTask stats local task information from peer.
        async fn stat_local_task(
            &self,
            request: tonic::Request<super::StatLocalTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalTaskResponse>,
            tonic::Status,
        >;
        /// ListTaskEntries lists task entries for downloading directory.
        async fn list_task_entries(
            &self,
            request: tonic::Request<super::ListTaskEntriesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListTaskEntriesResponse>,
            tonic::Status,
        >;
        /// DeleteTask deletes task from p2p network.
        async fn delete_task(
            &self,
            request: tonic::Request<super::DeleteTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// Server streaming response type for the SyncPieces method.
        type SyncPiecesStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::SyncPiecesResponse, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        /// SyncPieces syncs piece metadatas from remote peer.
        async fn sync_pieces(
            &self,
            request: tonic::Request<super::SyncPiecesRequest>,
        ) -> std::result::Result<tonic::Response<Self::SyncPiecesStream>, tonic::Status>;
        /// Server streaming response type for the DownloadCacheTask method.
        type DownloadCacheTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::DownloadCacheTaskResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// DownloadCacheTask downloads cache task from p2p network.
        async fn download_cache_task(
            &self,
            request: tonic::Request<super::DownloadCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadCacheTaskStream>,
            tonic::Status,
        >;
        /// StatCacheTask stats cache task information.
        async fn stat_cache_task(
            &self,
            request: tonic::Request<super::StatCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::CacheTask>,
            tonic::Status,
        >;
        /// DeleteCacheTask deletes cache task from p2p network.
        async fn delete_cache_task(
            &self,
            request: tonic::Request<super::DeleteCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// Server streaming response type for the SyncCachePieces method.
        type SyncCachePiecesStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::SyncCachePiecesResponse, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        /// SyncCachePieces syncs cache piece metadatas from remote peer.
        async fn sync_cache_pieces(
            &self,
            request: tonic::Request<super::SyncCachePiecesRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::SyncCachePiecesStream>,
            tonic::Status,
        >;
        /// DownloadCachePiece downloads cache piece from the remote peer.
        async fn download_cache_piece(
            &self,
            request: tonic::Request<super::DownloadCachePieceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DownloadCachePieceResponse>,
            tonic::Status,
        >;
        /// Server streaming response type for the DownloadPersistentTask method.
        type DownloadPersistentTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::DownloadPersistentTaskResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// DownloadPersistentTask downloads persistent task from p2p network.
        async fn download_persistent_task(
            &self,
            request: tonic::Request<super::DownloadPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadPersistentTaskStream>,
            tonic::Status,
        >;
        /// Server streaming response type for the SyncPersistentPieces method.
        type SyncPersistentPiecesStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::SyncPersistentPiecesResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// SyncPersistentPieces syncs persistent pieces from remote peer.
        async fn sync_persistent_pieces(
            &self,
            request: tonic::Request<super::SyncPersistentPiecesRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::SyncPersistentPiecesStream>,
            tonic::Status,
        >;
        /// UpdatePersistentTask updates metadate of thr persistent task in p2p network.
        async fn update_persistent_task(
            &self,
            request: tonic::Request<super::UpdatePersistentTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// StatPersistentTask stats persistent task information.
        async fn stat_persistent_task(
            &self,
            request: tonic::Request<super::StatPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentTask>,
            tonic::Status,
        >;
        /// DeletePersistentTask deletes persistent task from p2p network.
        async fn delete_persistent_task(
            &self,
            request: tonic::Request<super::DeletePersistentTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// Server streaming response type for the DownloadPersistentCacheTask method.
        type DownloadPersistentCacheTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::DownloadPersistentCacheTaskResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
        async fn download_persistent_cache_task(
            &self,
            request: tonic::Request<super::DownloadPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadPersistentCacheTaskStream>,
            tonic::Status,
        >;
        /// UpdatePersistentCacheTask updates metadate of thr persistent cache task in p2p network.
        async fn update_persistent_cache_task(
            &self,
            request: tonic::Request<super::UpdatePersistentCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// StatPersistentCacheTask stats persistent cache task information.
        async fn stat_persistent_cache_task(
            &self,
            request: tonic::Request<super::StatPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
            tonic::Status,
        >;
        /// DeletePersistentCacheTask deletes persistent cache task from p2p network.
        async fn delete_persistent_cache_task(
            &self,
            request: tonic::Request<super::DeletePersistentCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// Server streaming response type for the SyncPersistentCachePieces method.
        type SyncPersistentCachePiecesStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::SyncPersistentCachePiecesResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// SyncPersistentCachePieces syncs persistent cache pieces from remote peer.
        async fn sync_persistent_cache_pieces(
            &self,
            request: tonic::Request<super::SyncPersistentCachePiecesRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::SyncPersistentCachePiecesStream>,
            tonic::Status,
        >;
        /// Server streaming response type for the SyncHost method.
        type SyncHostStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::super::super::common::v2::Host,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// SyncHost sync host info from parents.
        async fn sync_host(
            &self,
            request: tonic::Request<super::SyncHostRequest>,
        ) -> std::result::Result<tonic::Response<Self::SyncHostStream>, tonic::Status>;
    }
    /// DfdaemonUpload represents upload service of dfdaemon.
    #[derive(Debug)]
    pub struct DfdaemonUploadServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> DfdaemonUploadServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for DfdaemonUploadServer<T>
    where
        T: DfdaemonUpload,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/dfdaemon.v2.DfdaemonUpload/DownloadTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<super::DownloadTaskRequest>
                    for DownloadTaskSvc<T> {
                        type Response = super::DownloadTaskResponse;
                        type ResponseStream = T::DownloadTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::download_task(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/StatTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::StatTaskRequest>
                    for StatTaskSvc<T> {
                        type Response = super::super::super::common::v2::Task;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::stat_task(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/StatLocalTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatLocalTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::StatLocalTaskRequest>
                    for StatLocalTaskSvc<T> {
                        type Response = super::StatLocalTaskResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatLocalTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::stat_local_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatLocalTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/ListTaskEntries" => {
                    #[allow(non_camel_case_types)]
                    struct ListTaskEntriesSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::ListTaskEntriesRequest>
                    for ListTaskEntriesSvc<T> {
                        type Response = super::ListTaskEntriesResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ListTaskEntriesRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::list_task_entries(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ListTaskEntriesSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DeleteTask" => {
                    #[allow(non_camel_case_types)]
                    struct DeleteTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::DeleteTaskRequest>
                    for DeleteTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DeleteTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::delete_task(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeleteTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/SyncPieces" => {
                    #[allow(non_camel_case_types)]
                    struct SyncPiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<super::SyncPiecesRequest>
                    for SyncPiecesSvc<T> {
                        type Response = super::SyncPiecesResponse;
                        type ResponseStream = T::SyncPiecesStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SyncPiecesRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::sync_pieces(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = SyncPiecesSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DownloadCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<
                        super::DownloadCacheTaskRequest,
                    > for DownloadCacheTaskSvc<T> {
                        type Response = super::DownloadCacheTaskResponse;
                        type ResponseStream = T::DownloadCacheTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadCacheTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::download_cache_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/StatCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::StatCacheTaskRequest>
                    for StatCacheTaskSvc<T> {
                        type Response = super::super::super::common::v2::CacheTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatCacheTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::stat_cache_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DeleteCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct DeleteCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::DeleteCacheTaskRequest>
                    for DeleteCacheTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DeleteCacheTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::delete_cache_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeleteCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/SyncCachePieces" => {
                    #[allow(non_camel_case_types)]
                    struct SyncCachePiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<
                        super::SyncCachePiecesRequest,
                    > for SyncCachePiecesSvc<T> {
                        type Response = super::SyncCachePiecesResponse;
                        type ResponseStream = T::SyncCachePiecesStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SyncCachePiecesRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::sync_cache_pieces(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = SyncCachePiecesSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DownloadCachePiece" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadCachePieceSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::DownloadCachePieceRequest>
                    for DownloadCachePieceSvc<T> {
                        type Response = super::DownloadCachePieceResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadCachePieceRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::download_cache_piece(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadCachePieceSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadPersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<
                        super::DownloadPersistentTaskRequest,
                    > for DownloadPersistentTaskSvc<T> {
                        type Response = super::DownloadPersistentTaskResponse;
                        type ResponseStream = T::DownloadPersistentTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadPersistentTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::download_persistent_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadPersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/SyncPersistentPieces" => {
                    #[allow(non_camel_case_types)]
                    struct SyncPersistentPiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<
                        super::SyncPersistentPiecesRequest,
                    > for SyncPersistentPiecesSvc<T> {
                        type Response = super::SyncPersistentPiecesResponse;
                        type ResponseStream = T::SyncPersistentPiecesStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SyncPersistentPiecesRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::sync_persistent_pieces(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = SyncPersistentPiecesSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/UpdatePersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct UpdatePersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::UpdatePersistentTaskRequest>
                    for UpdatePersistentTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::UpdatePersistentTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::update_persistent_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = UpdatePersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/StatPersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatPersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::StatPersistentTaskRequest>
                    for StatPersistentTaskSvc<T> {
                        type Response = super::super::super::common::v2::PersistentTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatPersistentTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::stat_persistent_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatPersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DeletePersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct DeletePersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::DeletePersistentTaskRequest>
                    for DeletePersistentTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DeletePersistentTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::delete_persistent_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeletePersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadPersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<
                        super::DownloadPersistentCacheTaskRequest,
                    > for DownloadPersistentCacheTaskSvc<T> {
                        type Response = super::DownloadPersistentCacheTaskResponse;
                        type ResponseStream = T::DownloadPersistentCacheTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::DownloadPersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::download_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadPersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/UpdatePersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct UpdatePersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<
                        super::UpdatePersistentCacheTaskRequest,
                    > for UpdatePersistentCacheTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::UpdatePersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::update_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = UpdatePersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/StatPersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatPersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::StatPersistentCacheTaskRequest>
                    for StatPersistentCacheTaskSvc<T> {
                        type Response = super::super::super::common::v2::PersistentCacheTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::StatPersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::stat_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatPersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/DeletePersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct DeletePersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<
                        super::DeletePersistentCacheTaskRequest,
                    > for DeletePersistentCacheTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::DeletePersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::delete_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeletePersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/SyncPersistentCachePieces" => {
                    #[allow(non_camel_case_types)]
                    struct SyncPersistentCachePiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<
                        super::SyncPersistentCachePiecesRequest,
                    > for SyncPersistentCachePiecesSvc<T> {
                        type Response = super::SyncPersistentCachePiecesResponse;
                        type ResponseStream = T::SyncPersistentCachePiecesStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::SyncPersistentCachePiecesRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::sync_persistent_cache_pieces(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = SyncPersistentCachePiecesSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonUpload/SyncHost" => {
                    #[allow(non_camel_case_types)]
                    struct SyncHostSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::ServerStreamingService<super::SyncHostRequest>
                    for SyncHostSvc<T> {
                        type Response = super::super::super::common::v2::Host;
                        type ResponseStream = T::SyncHostStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::SyncHostRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::sync_host(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = SyncHostSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for DfdaemonUploadServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "dfdaemon.v2.DfdaemonUpload";
    impl<T> tonic::server::NamedService for DfdaemonUploadServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
/// Generated client implementations.
pub mod dfdaemon_download_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// DfdaemonDownload represents download service of dfdaemon.
    #[derive(Debug, Clone)]
    pub struct DfdaemonDownloadClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl DfdaemonDownloadClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> DfdaemonDownloadClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> DfdaemonDownloadClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            DfdaemonDownloadClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// DownloadTask downloads task from p2p network.
        pub async fn download_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::DownloadTaskResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DownloadTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DownloadTask"));
            self.inner.server_streaming(req, path, codec).await
        }
        /// StatTask stats task information.
        pub async fn stat_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::Task>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/StatTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatTask"));
            self.inner.unary(req, path, codec).await
        }
        /// StatLocalTask stats local task information from peer.
        pub async fn stat_local_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatLocalTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalTaskResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/StatLocalTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatLocalTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// ListLocalTasks lists local tasks from peer.
        pub async fn list_local_tasks(
            &mut self,
            request: impl tonic::IntoRequest<super::ListLocalTasksRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListLocalTasksResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/ListLocalTasks",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "ListLocalTasks"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// ListTaskEntries lists task entries for downloading directory.
        pub async fn list_task_entries(
            &mut self,
            request: impl tonic::IntoRequest<super::ListTaskEntriesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListTaskEntriesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/ListTaskEntries",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "ListTaskEntries"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DeleteTask deletes task from p2p network.
        pub async fn delete_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DeleteTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteTask"));
            self.inner.unary(req, path, codec).await
        }
        /// DeleteLocalTask deletes local task from peer.
        pub async fn delete_local_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteLocalTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DeleteLocalTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteLocalTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DeleteHost releases host in scheduler.
        pub async fn delete_host(
            &mut self,
            request: impl tonic::IntoRequest<()>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DeleteHost",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteHost"));
            self.inner.unary(req, path, codec).await
        }
        /// DownloadCacheTask downloads cache task from p2p network.
        pub async fn download_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::DownloadCacheTaskResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DownloadCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DownloadCacheTask"),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// StatCacheTask stats cache task information.
        pub async fn stat_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::CacheTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/StatCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatCacheTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DeleteCacheTask deletes cache task from p2p network.
        pub async fn delete_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DeleteCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteCacheTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DownloadPersistentTask downloads persistent task from p2p network.
        pub async fn download_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<
                tonic::codec::Streaming<super::DownloadPersistentTaskResponse>,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DownloadPersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "DownloadPersistentTask",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// UploadPersistentTask uploads persistent task to p2p network.
        pub async fn upload_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::UploadPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/UploadPersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "UploadPersistentTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// StatPersistentTask stats persistent task information.
        pub async fn stat_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/StatPersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatPersistentTask"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// StatLocalPersistentTask stats local persistent task information from peer.
        pub async fn stat_local_persistent_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatLocalPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalPersistentTaskResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "StatLocalPersistentTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// ListLocalPersistentTasks lists local persistent tasks from peer.
        pub async fn list_local_persistent_tasks(
            &mut self,
            request: impl tonic::IntoRequest<super::ListLocalPersistentTasksRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListLocalPersistentTasksResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentTasks",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "ListLocalPersistentTasks",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
        pub async fn download_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<
                tonic::codec::Streaming<super::DownloadPersistentCacheTaskResponse>,
            >,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/DownloadPersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "DownloadPersistentCacheTask",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// UploadPersistentCacheTask uploads persistent cache task to p2p network.
        pub async fn upload_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::UploadPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/UploadPersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "UploadPersistentCacheTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// StatPersistentCacheTask stats persistent cache task information.
        pub async fn stat_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/StatPersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "StatPersistentCacheTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// StatLocalPersistentCacheTask stats local persistent cache task information from peer.
        pub async fn stat_local_persistent_cache_task(
            &mut self,
            request: impl tonic::IntoRequest<super::StatLocalPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalPersistentCacheTaskResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentCacheTask",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "StatLocalPersistentCacheTask",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// ListLocalPersistentCacheTasks lists local persistent cache tasks from peer.
        pub async fn list_local_persistent_cache_tasks(
            &mut self,
            request: impl tonic::IntoRequest<super::ListLocalPersistentCacheTasksRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListLocalPersistentCacheTasksResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentCacheTasks",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonDownload",
                        "ListLocalPersistentCacheTasks",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod dfdaemon_download_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with DfdaemonDownloadServer.
    #[async_trait]
    pub trait DfdaemonDownload: std::marker::Send + std::marker::Sync + 'static {
        /// Server streaming response type for the DownloadTask method.
        type DownloadTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<super::DownloadTaskResponse, tonic::Status>,
            >
            + std::marker::Send
            + 'static;
        /// DownloadTask downloads task from p2p network.
        async fn download_task(
            &self,
            request: tonic::Request<super::DownloadTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadTaskStream>,
            tonic::Status,
        >;
        /// StatTask stats task information.
        async fn stat_task(
            &self,
            request: tonic::Request<super::StatTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::Task>,
            tonic::Status,
        >;
        /// StatLocalTask stats local task information from peer.
        async fn stat_local_task(
            &self,
            request: tonic::Request<super::StatLocalTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalTaskResponse>,
            tonic::Status,
        >;
        /// ListLocalTasks lists local tasks from peer.
        async fn list_local_tasks(
            &self,
            request: tonic::Request<super::ListLocalTasksRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListLocalTasksResponse>,
            tonic::Status,
        >;
        /// ListTaskEntries lists task entries for downloading directory.
        async fn list_task_entries(
            &self,
            request: tonic::Request<super::ListTaskEntriesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListTaskEntriesResponse>,
            tonic::Status,
        >;
        /// DeleteTask deletes task from p2p network.
        async fn delete_task(
            &self,
            request: tonic::Request<super::DeleteTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// DeleteLocalTask deletes local task from peer.
        async fn delete_local_task(
            &self,
            request: tonic::Request<super::DeleteLocalTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// DeleteHost releases host in scheduler.
        async fn delete_host(
            &self,
            request: tonic::Request<()>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// Server streaming response type for the DownloadCacheTask method.
        type DownloadCacheTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::DownloadCacheTaskResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// DownloadCacheTask downloads cache task from p2p network.
        async fn download_cache_task(
            &self,
            request: tonic::Request<super::DownloadCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadCacheTaskStream>,
            tonic::Status,
        >;
        /// StatCacheTask stats cache task information.
        async fn stat_cache_task(
            &self,
            request: tonic::Request<super::StatCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::CacheTask>,
            tonic::Status,
        >;
        /// DeleteCacheTask deletes cache task from p2p network.
        async fn delete_cache_task(
            &self,
            request: tonic::Request<super::DeleteCacheTaskRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status>;
        /// Server streaming response type for the DownloadPersistentTask method.
        type DownloadPersistentTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::DownloadPersistentTaskResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// DownloadPersistentTask downloads persistent task from p2p network.
        async fn download_persistent_task(
            &self,
            request: tonic::Request<super::DownloadPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadPersistentTaskStream>,
            tonic::Status,
        >;
        /// UploadPersistentTask uploads persistent task to p2p network.
        async fn upload_persistent_task(
            &self,
            request: tonic::Request<super::UploadPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentTask>,
            tonic::Status,
        >;
        /// StatPersistentTask stats persistent task information.
        async fn stat_persistent_task(
            &self,
            request: tonic::Request<super::StatPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentTask>,
            tonic::Status,
        >;
        /// StatLocalPersistentTask stats local persistent task information from peer.
        async fn stat_local_persistent_task(
            &self,
            request: tonic::Request<super::StatLocalPersistentTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalPersistentTaskResponse>,
            tonic::Status,
        >;
        /// ListLocalPersistentTasks lists local persistent tasks from peer.
        async fn list_local_persistent_tasks(
            &self,
            request: tonic::Request<super::ListLocalPersistentTasksRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListLocalPersistentTasksResponse>,
            tonic::Status,
        >;
        /// Server streaming response type for the DownloadPersistentCacheTask method.
        type DownloadPersistentCacheTaskStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::DownloadPersistentCacheTaskResponse,
                    tonic::Status,
                >,
            >
            + std::marker::Send
            + 'static;
        /// DownloadPersistentCacheTask downloads persistent cache task from p2p network.
        async fn download_persistent_cache_task(
            &self,
            request: tonic::Request<super::DownloadPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::DownloadPersistentCacheTaskStream>,
            tonic::Status,
        >;
        /// UploadPersistentCacheTask uploads persistent cache task to p2p network.
        async fn upload_persistent_cache_task(
            &self,
            request: tonic::Request<super::UploadPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
            tonic::Status,
        >;
        /// StatPersistentCacheTask stats persistent cache task information.
        async fn stat_persistent_cache_task(
            &self,
            request: tonic::Request<super::StatPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
            tonic::Status,
        >;
        /// StatLocalPersistentCacheTask stats local persistent cache task information from peer.
        async fn stat_local_persistent_cache_task(
            &self,
            request: tonic::Request<super::StatLocalPersistentCacheTaskRequest>,
        ) -> std::result::Result<
            tonic::Response<super::StatLocalPersistentCacheTaskResponse>,
            tonic::Status,
        >;
        /// ListLocalPersistentCacheTasks lists local persistent cache tasks from peer.
        async fn list_local_persistent_cache_tasks(
            &self,
            request: tonic::Request<super::ListLocalPersistentCacheTasksRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListLocalPersistentCacheTasksResponse>,
            tonic::Status,
        >;
    }
    /// DfdaemonDownload represents download service of dfdaemon.
    #[derive(Debug)]
    pub struct DfdaemonDownloadServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> DfdaemonDownloadServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for DfdaemonDownloadServer<T>
    where
        T: DfdaemonDownload,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/dfdaemon.v2.DfdaemonDownload/DownloadTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::ServerStreamingService<super::DownloadTaskRequest>
                    for DownloadTaskSvc<T> {
                        type Response = super::DownloadTaskResponse;
                        type ResponseStream = T::DownloadTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::download_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/StatTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::StatTaskRequest>
                    for StatTaskSvc<T> {
                        type Response = super::super::super::common::v2::Task;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::stat_task(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/StatLocalTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatLocalTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::StatLocalTaskRequest>
                    for StatLocalTaskSvc<T> {
                        type Response = super::StatLocalTaskResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatLocalTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::stat_local_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatLocalTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/ListLocalTasks" => {
                    #[allow(non_camel_case_types)]
                    struct ListLocalTasksSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::ListLocalTasksRequest>
                    for ListLocalTasksSvc<T> {
                        type Response = super::ListLocalTasksResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ListLocalTasksRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::list_local_tasks(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ListLocalTasksSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/ListTaskEntries" => {
                    #[allow(non_camel_case_types)]
                    struct ListTaskEntriesSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::ListTaskEntriesRequest>
                    for ListTaskEntriesSvc<T> {
                        type Response = super::ListTaskEntriesResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ListTaskEntriesRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::list_task_entries(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ListTaskEntriesSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/DeleteTask" => {
                    #[allow(non_camel_case_types)]
                    struct DeleteTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::DeleteTaskRequest>
                    for DeleteTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DeleteTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::delete_task(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeleteTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/DeleteLocalTask" => {
                    #[allow(non_camel_case_types)]
                    struct DeleteLocalTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::DeleteLocalTaskRequest>
                    for DeleteLocalTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DeleteLocalTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::delete_local_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeleteLocalTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/DeleteHost" => {
                    #[allow(non_camel_case_types)]
                    struct DeleteHostSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<T: DfdaemonDownload> tonic::server::UnaryService<()>
                    for DeleteHostSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::delete_host(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeleteHostSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/DownloadCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::ServerStreamingService<
                        super::DownloadCacheTaskRequest,
                    > for DownloadCacheTaskSvc<T> {
                        type Response = super::DownloadCacheTaskResponse;
                        type ResponseStream = T::DownloadCacheTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadCacheTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::download_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/StatCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::StatCacheTaskRequest>
                    for StatCacheTaskSvc<T> {
                        type Response = super::super::super::common::v2::CacheTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatCacheTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::stat_cache_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/DeleteCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct DeleteCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::DeleteCacheTaskRequest>
                    for DeleteCacheTaskSvc<T> {
                        type Response = ();
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DeleteCacheTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::delete_cache_task(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DeleteCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/DownloadPersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::ServerStreamingService<
                        super::DownloadPersistentTaskRequest,
                    > for DownloadPersistentTaskSvc<T> {
                        type Response = super::DownloadPersistentTaskResponse;
                        type ResponseStream = T::DownloadPersistentTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadPersistentTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::download_persistent_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadPersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/UploadPersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct UploadPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::UploadPersistentTaskRequest>
                    for UploadPersistentTaskSvc<T> {
                        type Response = super::super::super::common::v2::PersistentTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::UploadPersistentTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::upload_persistent_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = UploadPersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/StatPersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::StatPersistentTaskRequest>
                    for StatPersistentTaskSvc<T> {
                        type Response = super::super::super::common::v2::PersistentTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::StatPersistentTaskRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::stat_persistent_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatPersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatLocalPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::StatLocalPersistentTaskRequest>
                    for StatLocalPersistentTaskSvc<T> {
                        type Response = super::StatLocalPersistentTaskResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::StatLocalPersistentTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::stat_local_persistent_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatLocalPersistentTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentTasks" => {
                    #[allow(non_camel_case_types)]
                    struct ListLocalPersistentTasksSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::ListLocalPersistentTasksRequest>
                    for ListLocalPersistentTasksSvc<T> {
                        type Response = super::ListLocalPersistentTasksResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::ListLocalPersistentTasksRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::list_local_persistent_tasks(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ListLocalPersistentTasksSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/DownloadPersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadPersistentCacheTaskSvc<T: DfdaemonDownload>(
                        pub Arc<T>,
                    );
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::ServerStreamingService<
                        super::DownloadPersistentCacheTaskRequest,
                    > for DownloadPersistentCacheTaskSvc<T> {
                        type Response = super::DownloadPersistentCacheTaskResponse;
                        type ResponseStream = T::DownloadPersistentCacheTaskStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::DownloadPersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::download_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = DownloadPersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/UploadPersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct UploadPersistentCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<
                        super::UploadPersistentCacheTaskRequest,
                    > for UploadPersistentCacheTaskSvc<T> {
                        type Response = super::super::super::common::v2::PersistentCacheTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::UploadPersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::upload_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = UploadPersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/StatPersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatPersistentCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<super::StatPersistentCacheTaskRequest>
                    for StatPersistentCacheTaskSvc<T> {
                        type Response = super::super::super::common::v2::PersistentCacheTask;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::StatPersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::stat_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatPersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentCacheTask" => {
                    #[allow(non_camel_case_types)]
                    struct StatLocalPersistentCacheTaskSvc<T: DfdaemonDownload>(
                        pub Arc<T>,
                    );
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<
                        super::StatLocalPersistentCacheTaskRequest,
                    > for StatLocalPersistentCacheTaskSvc<T> {
                        type Response = super::StatLocalPersistentCacheTaskResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::StatLocalPersistentCacheTaskRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::stat_local_persistent_cache_task(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = StatLocalPersistentCacheTaskSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentCacheTasks" => {
                    #[allow(non_camel_case_types)]
                    struct ListLocalPersistentCacheTasksSvc<T: DfdaemonDownload>(
                        pub Arc<T>,
                    );
                    impl<
                        T: DfdaemonDownload,
                    > tonic::server::UnaryService<
                        super::ListLocalPersistentCacheTasksRequest,
                    > for ListLocalPersistentCacheTasksSvc<T> {
                        type Response = super::ListLocalPersistentCacheTasksResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::ListLocalPersistentCacheTasksRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonDownload>::list_local_persistent_cache_tasks(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = ListLocalPersistentCacheTasksSvc(inner);
                        let codec = tonic_prost::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for DfdaemonDownloadServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "dfdaemon.v2.DfdaemonDownload";
    impl<T> tonic::server::NamedService for DfdaemonDownloadServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
