// This file is @generated by prost-build.
/// DownloadTaskRequest represents request of DownloadTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[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>,
}
/// DownloadPieceFinishedResponse represents piece download finished response of DownloadTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[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)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::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,
}
/// DownloadPieceRequest represents request of DownloadPiece.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceRequest {
    /// 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,
}
/// DownloadPieceResponse represents response of DownloadPieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceResponse {
    /// 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>,
}
/// StatTaskRequest represents request of StatTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
}
/// ListTaskEntriesRequest represents request of ListTaskEntries.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[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>,
}
/// ListTaskEntriesResponse represents response of ListTaskEntries.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
}
/// DownloadPersistentCacheTaskRequest represents request of DownloadPersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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>,
}
/// DownloadPersistentCacheTaskStartedResponse represents task download started response of DownloadPersistentCacheTaskResponse.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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)]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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 crc32 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>,
}
/// UpdatePersistentCacheTaskRequest represents request of UpdatePersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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,
}
/// StatPersistentCacheTaskRequest represents request of StatPersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatPersistentCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
}
/// DeletePersistentCacheTaskRequest represents request of DeletePersistentCacheTask.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeletePersistentCacheTaskRequest {
    /// Task id.
    #[prost(string, tag = "1")]
    pub task_id: ::prost::alloc::string::String,
}
/// SyncPersistentCachePiecesRequest represents request of SyncPersistentCachePieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::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,
}
/// DownloadPersistentCachePieceRequest represents request of DownloadPersistentCachePiece.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPersistentCachePieceRequest {
    /// 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,
}
/// DownloadPersistentCachePieceResponse represents response of DownloadPersistentCachePieces.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPersistentCachePieceResponse {
    /// 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>,
}
/// SyncHostRequest represents request of SyncHost.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::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>,
}
/// ExchangeIBVerbsQueuePairEndpointRequest represents request of ExchangeIBVerbsQueuePairEndpoint.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExchangeIbVerbsQueuePairEndpointRequest {
    /// Information of the source's queue pair endpoint of IBVerbs.
    #[prost(message, optional, tag = "1")]
    pub endpoint: ::core::option::Option<IbVerbsQueuePairEndpoint>,
}
/// ExchangeIBVerbsQueuePairEndpointResponse represents response of ExchangeIBVerbsQueuePairEndpoint.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExchangeIbVerbsQueuePairEndpointResponse {
    /// Information of the destination's queue pair endpoint of IBVerbs.
    #[prost(message, optional, tag = "1")]
    pub endpoint: ::core::option::Option<IbVerbsQueuePairEndpoint>,
}
/// Generated client implementations.
pub mod dfdaemon_upload_client {
    #![allow(unused_variables, dead_code, missing_docs, 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::BoxBody>,
        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::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
        /// 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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
        /// DownloadPiece downloads piece from the remote peer.
        pub async fn download_piece(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadPieceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DownloadPieceResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DownloadPiece",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DownloadPiece"));
            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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
        /// DownloadPersistentCachePiece downloads persistent cache piece from p2p network.
        pub async fn download_persistent_cache_piece(
            &mut self,
            request: impl tonic::IntoRequest<super::DownloadPersistentCachePieceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DownloadPersistentCachePieceResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCachePiece",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "DownloadPersistentCachePiece",
                    ),
                );
            self.inner.unary(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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
        /// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
        pub async fn exchange_ib_verbs_queue_pair_endpoint(
            &mut self,
            request: impl tonic::IntoRequest<
                super::ExchangeIbVerbsQueuePairEndpointRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::ExchangeIbVerbsQueuePairEndpointResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/dfdaemon.v2.DfdaemonUpload/ExchangeIBVerbsQueuePairEndpoint",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "dfdaemon.v2.DfdaemonUpload",
                        "ExchangeIBVerbsQueuePairEndpoint",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod dfdaemon_download_client {
    #![allow(unused_variables, dead_code, missing_docs, 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::BoxBody>,
        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::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
        /// 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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
        /// 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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
        /// 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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::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
        }
    }
}
/// Generated server implementations.
pub mod dfdaemon_upload_server {
    #![allow(unused_variables, dead_code, missing_docs, 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,
        >;
        /// 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>;
        /// DownloadPiece downloads piece from the remote peer.
        async fn download_piece(
            &self,
            request: tonic::Request<super::DownloadPieceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DownloadPieceResponse>,
            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,
        >;
        /// DownloadPersistentCachePiece downloads persistent cache piece from p2p network.
        async fn download_persistent_cache_piece(
            &self,
            request: tonic::Request<super::DownloadPersistentCachePieceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DownloadPersistentCachePieceResponse>,
            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>;
        /// ExchangeIBVerbsQueuePairEndpoint exchanges queue pair endpoint of IBVerbs with remote peer.
        async fn exchange_ib_verbs_queue_pair_endpoint(
            &self,
            request: tonic::Request<super::ExchangeIbVerbsQueuePairEndpointRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ExchangeIbVerbsQueuePairEndpointResponse>,
            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::BoxBody>;
        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::codec::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::codec::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::codec::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::codec::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/DownloadPiece" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadPieceSvc<T: DfdaemonUpload>(pub Arc<T>);
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<super::DownloadPieceRequest>
                    for DownloadPieceSvc<T> {
                        type Response = super::DownloadPieceResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DownloadPieceRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::download_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 = DownloadPieceSvc(inner);
                        let codec = tonic::codec::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::codec::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::codec::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::codec::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::codec::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::codec::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/DownloadPersistentCachePiece" => {
                    #[allow(non_camel_case_types)]
                    struct DownloadPersistentCachePieceSvc<T: DfdaemonUpload>(
                        pub Arc<T>,
                    );
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<
                        super::DownloadPersistentCachePieceRequest,
                    > for DownloadPersistentCachePieceSvc<T> {
                        type Response = super::DownloadPersistentCachePieceResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::DownloadPersistentCachePieceRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::download_persistent_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 = DownloadPersistentCachePieceSvc(inner);
                        let codec = tonic::codec::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/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::codec::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/ExchangeIBVerbsQueuePairEndpoint" => {
                    #[allow(non_camel_case_types)]
                    struct ExchangeIBVerbsQueuePairEndpointSvc<T: DfdaemonUpload>(
                        pub Arc<T>,
                    );
                    impl<
                        T: DfdaemonUpload,
                    > tonic::server::UnaryService<
                        super::ExchangeIbVerbsQueuePairEndpointRequest,
                    > for ExchangeIBVerbsQueuePairEndpointSvc<T> {
                        type Response = super::ExchangeIbVerbsQueuePairEndpointResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::ExchangeIbVerbsQueuePairEndpointRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as DfdaemonUpload>::exchange_ib_verbs_queue_pair_endpoint(
                                        &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 = ExchangeIBVerbsQueuePairEndpointSvc(inner);
                        let codec = tonic::codec::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 {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", tonic::Code::Unimplemented as i32)
                                .header(
                                    http::header::CONTENT_TYPE,
                                    tonic::metadata::GRPC_CONTENT_TYPE,
                                )
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    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 server implementations.
pub mod dfdaemon_download_server {
    #![allow(unused_variables, dead_code, missing_docs, 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,
        >;
        /// 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>;
        /// 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 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,
        >;
    }
    /// 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::BoxBody>;
        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::codec::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::codec::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::codec::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::codec::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::codec::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::codec::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::codec::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::codec::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 {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", tonic::Code::Unimplemented as i32)
                                .header(
                                    http::header::CONTENT_TYPE,
                                    tonic::metadata::GRPC_CONTENT_TYPE,
                                )
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    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;
    }
}
