#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskRequest {
#[prost(message, optional, tag = "1")]
pub download: ::core::option::Option<super::super::common::v2::Download>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskStartedResponse {
#[prost(uint64, tag = "1")]
pub content_length: u64,
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<super::super::common::v2::Range>,
#[prost(map = "string, string", tag = "3")]
pub response_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, repeated, tag = "4")]
pub pieces: ::prost::alloc::vec::Vec<super::super::common::v2::Piece>,
#[prost(bool, tag = "5")]
pub is_finished: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPieceFinishedResponse {
#[prost(message, optional, tag = "1")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadTaskResponse {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[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>,
}
pub mod download_task_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "4")]
DownloadTaskStartedResponse(super::DownloadTaskStartedResponse),
#[prost(message, tag = "5")]
DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPiecesRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(uint32, repeated, tag = "3")]
pub interested_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPiecesResponse {
#[prost(uint32, tag = "1")]
pub number: u32,
#[prost(uint64, tag = "2")]
pub offset: u64,
#[prost(uint64, tag = "3")]
pub length: u64,
#[prost(string, tag = "4")]
pub ip: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "5")]
pub tcp_port: ::core::option::Option<i32>,
#[prost(int32, optional, tag = "6")]
pub quic_port: ::core::option::Option<i32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatLocalTaskResponse {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "2")]
pub piece_length: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "3")]
pub content_length: ::core::option::Option<u64>,
#[prost(map = "string, string", tag = "4")]
pub response_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(uint64, tag = "5")]
pub uploading_count: u64,
#[prost(uint64, tag = "6")]
pub uploaded_count: u64,
#[prost(message, optional, tag = "7")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub prefetched_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub failed_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "11")]
pub finished_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListLocalTasksRequest {
#[prost(string, optional, tag = "1")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocalTasksResponse {
#[prost(message, repeated, tag = "1")]
pub tasks: ::prost::alloc::vec::Vec<StatLocalTaskResponse>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTaskEntriesRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub request_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "4")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(bytes = "vec", repeated, tag = "5")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(message, optional, tag = "6")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(message, optional, tag = "7")]
pub hdfs: ::core::option::Option<super::super::common::v2::Hdfs>,
#[prost(string, optional, tag = "8")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "9")]
pub hugging_face: ::core::option::Option<super::super::common::v2::HuggingFace>,
#[prost(message, optional, tag = "10")]
pub model_scope: ::core::option::Option<super::super::common::v2::ModelScope>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTaskEntriesResponse {
#[prost(uint64, tag = "1")]
pub content_length: u64,
#[prost(map = "string, string", tag = "2")]
pub response_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(int32, optional, tag = "3")]
pub status_code: ::core::option::Option<i32>,
#[prost(message, repeated, tag = "4")]
pub entries: ::prost::alloc::vec::Vec<Entry>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Entry {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub content_length: u64,
#[prost(bool, tag = "3")]
pub is_dir: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteLocalTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadCacheTaskRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub range: ::core::option::Option<super::super::common::v2::Range>,
#[prost(enumeration = "super::super::common::v2::TaskType", tag = "4")]
pub r#type: i32,
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "super::super::common::v2::Priority", tag = "7")]
pub priority: i32,
#[prost(string, repeated, tag = "8")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "9")]
pub request_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(uint64, optional, tag = "10")]
pub piece_length: ::core::option::Option<u64>,
#[prost(string, optional, tag = "11")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(bool, tag = "13")]
pub disable_back_to_source: bool,
#[prost(bool, tag = "14")]
pub need_back_to_source: bool,
#[prost(bytes = "vec", repeated, tag = "15")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(bool, tag = "16")]
pub prefetch: bool,
#[prost(message, optional, tag = "17")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(message, optional, tag = "18")]
pub hdfs: ::core::option::Option<super::super::common::v2::Hdfs>,
#[prost(bool, tag = "19")]
pub is_prefetch: bool,
#[prost(bool, tag = "20")]
pub need_piece_content: bool,
#[prost(string, optional, tag = "21")]
pub content_for_calculating_task_id: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "22")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "23")]
pub overwrite: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadCacheTaskStartedResponse {
#[prost(uint64, tag = "1")]
pub content_length: u64,
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<super::super::common::v2::Range>,
#[prost(map = "string, string", tag = "3")]
pub response_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, repeated, tag = "4")]
pub pieces: ::prost::alloc::vec::Vec<super::super::common::v2::Piece>,
#[prost(bool, tag = "5")]
pub is_finished: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadCacheTaskResponse {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(oneof = "download_cache_task_response::Response", tags = "4, 5")]
pub response: ::core::option::Option<download_cache_task_response::Response>,
}
pub mod download_cache_task_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "4")]
DownloadCacheTaskStartedResponse(super::DownloadCacheTaskStartedResponse),
#[prost(message, tag = "5")]
DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncCachePiecesRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(uint32, repeated, tag = "3")]
pub interested_cache_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncCachePiecesResponse {
#[prost(uint32, tag = "1")]
pub number: u32,
#[prost(uint64, tag = "2")]
pub offset: u64,
#[prost(uint64, tag = "3")]
pub length: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePieceRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub piece_number: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePieceResponse {
#[prost(message, optional, tag = "1")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatCacheTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCacheTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentTaskRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(bool, tag = "3")]
pub persistent: bool,
#[prost(string, optional, tag = "4")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "5")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(bool, tag = "6")]
pub need_piece_content: bool,
#[prost(bool, tag = "7")]
pub force_hard_link: bool,
#[prost(string, optional, tag = "8")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "9")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "10")]
pub overwrite: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentTaskStartedResponse {
#[prost(uint64, tag = "1")]
pub content_length: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentTaskResponse {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(oneof = "download_persistent_task_response::Response", tags = "4, 5")]
pub response: ::core::option::Option<download_persistent_task_response::Response>,
}
pub mod download_persistent_task_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "4")]
DownloadPersistentTaskStartedResponse(
super::DownloadPersistentTaskStartedResponse,
),
#[prost(message, tag = "5")]
DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentTaskRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(string, tag = "3")]
pub path: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub persistent_replica_count: u64,
#[prost(message, optional, tag = "5")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(message, optional, tag = "6")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(string, optional, tag = "7")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdatePersistentTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub persistent: bool,
#[prost(string, optional, tag = "3")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentTaskResponse {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub persistent: bool,
#[prost(message, optional, tag = "3")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(uint64, optional, tag = "4")]
pub piece_length: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub content_length: ::core::option::Option<u64>,
#[prost(uint64, tag = "6")]
pub uploading_count: u64,
#[prost(uint64, tag = "7")]
pub uploaded_count: u64,
#[prost(message, optional, tag = "8")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub failed_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "11")]
pub finished_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListLocalPersistentTasksRequest {
#[prost(string, optional, tag = "1")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocalPersistentTasksResponse {
#[prost(message, repeated, tag = "1")]
pub tasks: ::prost::alloc::vec::Vec<StatLocalPersistentTaskResponse>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentPiecesRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(uint32, repeated, tag = "3")]
pub interested_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentPiecesResponse {
#[prost(uint32, tag = "1")]
pub number: u32,
#[prost(uint64, tag = "2")]
pub offset: u64,
#[prost(uint64, tag = "3")]
pub length: u64,
#[prost(string, tag = "4")]
pub ip: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "5")]
pub tcp_port: ::core::option::Option<i32>,
#[prost(int32, optional, tag = "6")]
pub quic_port: ::core::option::Option<i32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCacheTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub persistent: bool,
#[prost(string, optional, tag = "3")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(bool, tag = "7")]
pub need_piece_content: bool,
#[prost(bool, tag = "8")]
pub force_hard_link: bool,
#[prost(string, optional, tag = "9")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "10")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, tag = "11")]
pub overwrite: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCacheTaskStartedResponse {
#[prost(uint64, tag = "1")]
pub content_length: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCacheTaskResponse {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[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,
>,
}
pub mod download_persistent_cache_task_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "4")]
DownloadPersistentCacheTaskStartedResponse(
super::DownloadPersistentCacheTaskStartedResponse,
),
#[prost(message, tag = "5")]
DownloadPieceFinishedResponse(super::DownloadPieceFinishedResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentCacheTaskRequest {
#[prost(string, optional, tag = "1")]
pub content_for_calculating_task_id: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(string, tag = "2")]
pub path: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub persistent_replica_count: u64,
#[prost(string, optional, tag = "4")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "5")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "6")]
pub piece_length: ::core::option::Option<u64>,
#[prost(message, optional, tag = "7")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(message, optional, tag = "8")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(string, optional, tag = "9")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdatePersistentCacheTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub persistent: bool,
#[prost(string, optional, tag = "3")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentCacheTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentCacheTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatLocalPersistentCacheTaskResponse {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub persistent: bool,
#[prost(message, optional, tag = "3")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(uint64, optional, tag = "4")]
pub piece_length: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "5")]
pub content_length: ::core::option::Option<u64>,
#[prost(uint64, tag = "6")]
pub uploading_count: u64,
#[prost(uint64, tag = "7")]
pub uploaded_count: u64,
#[prost(message, optional, tag = "8")]
pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub updated_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub failed_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "11")]
pub finished_at: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListLocalPersistentCacheTasksRequest {
#[prost(string, optional, tag = "1")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocalPersistentCacheTasksResponse {
#[prost(message, repeated, tag = "1")]
pub tasks: ::prost::alloc::vec::Vec<StatLocalPersistentCacheTaskResponse>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentCacheTaskRequest {
#[prost(string, tag = "1")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentCachePiecesRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(uint32, repeated, tag = "3")]
pub interested_piece_numbers: ::prost::alloc::vec::Vec<u32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncPersistentCachePiecesResponse {
#[prost(uint32, tag = "1")]
pub number: u32,
#[prost(uint64, tag = "2")]
pub offset: u64,
#[prost(uint64, tag = "3")]
pub length: u64,
#[prost(string, tag = "4")]
pub ip: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "5")]
pub tcp_port: ::core::option::Option<i32>,
#[prost(int32, optional, tag = "6")]
pub quic_port: ::core::option::Option<i32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SyncHostRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IbVerbsQueuePairEndpoint {
#[prost(uint32, tag = "1")]
pub num: u32,
#[prost(uint32, tag = "2")]
pub lid: u32,
#[prost(bytes = "vec", tag = "3")]
pub gid: ::prost::alloc::vec::Vec<u8>,
}
pub mod dfdaemon_upload_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DfdaemonUploadClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DfdaemonUploadClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DfdaemonUploadClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DfdaemonUploadClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DfdaemonUploadClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn download_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadTaskRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::DownloadTaskResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DownloadTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DownloadTask"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn stat_task(
&mut self,
request: impl tonic::IntoRequest<super::StatTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Task>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/StatTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatTask"));
self.inner.unary(req, path, codec).await
}
pub async fn stat_local_task(
&mut self,
request: impl tonic::IntoRequest<super::StatLocalTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalTaskResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/StatLocalTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatLocalTask"));
self.inner.unary(req, path, codec).await
}
pub async fn list_task_entries(
&mut self,
request: impl tonic::IntoRequest<super::ListTaskEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::ListTaskEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/ListTaskEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "ListTaskEntries"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DeleteTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DeleteTask"));
self.inner.unary(req, path, codec).await
}
pub async fn sync_pieces(
&mut self,
request: impl tonic::IntoRequest<super::SyncPiecesRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::SyncPiecesResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/SyncPieces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncPieces"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn download_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::DownloadCacheTaskResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DownloadCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DownloadCacheTask"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn stat_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::StatCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CacheTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/StatCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatCacheTask"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DeleteCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DeleteCacheTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn sync_cache_pieces(
&mut self,
request: impl tonic::IntoRequest<super::SyncCachePiecesRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::SyncCachePiecesResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/SyncCachePieces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncCachePieces"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn download_cache_piece(
&mut self,
request: impl tonic::IntoRequest<super::DownloadCachePieceRequest>,
) -> std::result::Result<
tonic::Response<super::DownloadCachePieceResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DownloadCachePiece",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DownloadCachePiece"),
);
self.inner.unary(req, path, codec).await
}
pub async fn download_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::DownloadPersistentTaskResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DownloadPersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonUpload",
"DownloadPersistentTask",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn sync_persistent_pieces(
&mut self,
request: impl tonic::IntoRequest<super::SyncPersistentPiecesRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::SyncPersistentPiecesResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/SyncPersistentPieces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncPersistentPieces"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn update_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::UpdatePersistentTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/UpdatePersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "UpdatePersistentTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/StatPersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "StatPersistentTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::DeletePersistentTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DeletePersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "DeletePersistentTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn download_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::DownloadPersistentCacheTaskResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonUpload",
"DownloadPersistentCacheTask",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn update_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::UpdatePersistentCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/UpdatePersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonUpload",
"UpdatePersistentCacheTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/StatPersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonUpload",
"StatPersistentCacheTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DeletePersistentCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/DeletePersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonUpload",
"DeletePersistentCacheTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn sync_persistent_cache_pieces(
&mut self,
request: impl tonic::IntoRequest<super::SyncPersistentCachePiecesRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::SyncPersistentCachePiecesResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/SyncPersistentCachePieces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonUpload",
"SyncPersistentCachePieces",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn sync_host(
&mut self,
request: impl tonic::IntoRequest<super::SyncHostRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::super::super::common::v2::Host>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonUpload/SyncHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonUpload", "SyncHost"));
self.inner.server_streaming(req, path, codec).await
}
}
}
pub mod dfdaemon_upload_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait DfdaemonUpload: std::marker::Send + std::marker::Sync + 'static {
type DownloadTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::DownloadTaskResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn download_task(
&self,
request: tonic::Request<super::DownloadTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadTaskStream>,
tonic::Status,
>;
async fn stat_task(
&self,
request: tonic::Request<super::StatTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Task>,
tonic::Status,
>;
async fn stat_local_task(
&self,
request: tonic::Request<super::StatLocalTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalTaskResponse>,
tonic::Status,
>;
async fn list_task_entries(
&self,
request: tonic::Request<super::ListTaskEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::ListTaskEntriesResponse>,
tonic::Status,
>;
async fn delete_task(
&self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type SyncPiecesStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::SyncPiecesResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn sync_pieces(
&self,
request: tonic::Request<super::SyncPiecesRequest>,
) -> std::result::Result<tonic::Response<Self::SyncPiecesStream>, tonic::Status>;
type DownloadCacheTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::DownloadCacheTaskResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn download_cache_task(
&self,
request: tonic::Request<super::DownloadCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadCacheTaskStream>,
tonic::Status,
>;
async fn stat_cache_task(
&self,
request: tonic::Request<super::StatCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CacheTask>,
tonic::Status,
>;
async fn delete_cache_task(
&self,
request: tonic::Request<super::DeleteCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type SyncCachePiecesStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::SyncCachePiecesResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn sync_cache_pieces(
&self,
request: tonic::Request<super::SyncCachePiecesRequest>,
) -> std::result::Result<
tonic::Response<Self::SyncCachePiecesStream>,
tonic::Status,
>;
async fn download_cache_piece(
&self,
request: tonic::Request<super::DownloadCachePieceRequest>,
) -> std::result::Result<
tonic::Response<super::DownloadCachePieceResponse>,
tonic::Status,
>;
type DownloadPersistentTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::DownloadPersistentTaskResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn download_persistent_task(
&self,
request: tonic::Request<super::DownloadPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadPersistentTaskStream>,
tonic::Status,
>;
type SyncPersistentPiecesStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::SyncPersistentPiecesResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn sync_persistent_pieces(
&self,
request: tonic::Request<super::SyncPersistentPiecesRequest>,
) -> std::result::Result<
tonic::Response<Self::SyncPersistentPiecesStream>,
tonic::Status,
>;
async fn update_persistent_task(
&self,
request: tonic::Request<super::UpdatePersistentTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn stat_persistent_task(
&self,
request: tonic::Request<super::StatPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
>;
async fn delete_persistent_task(
&self,
request: tonic::Request<super::DeletePersistentTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type DownloadPersistentCacheTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::DownloadPersistentCacheTaskResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn download_persistent_cache_task(
&self,
request: tonic::Request<super::DownloadPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadPersistentCacheTaskStream>,
tonic::Status,
>;
async fn update_persistent_cache_task(
&self,
request: tonic::Request<super::UpdatePersistentCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
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,
>;
async fn delete_persistent_cache_task(
&self,
request: tonic::Request<super::DeletePersistentCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type SyncPersistentCachePiecesStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::SyncPersistentCachePiecesResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn sync_persistent_cache_pieces(
&self,
request: tonic::Request<super::SyncPersistentCachePiecesRequest>,
) -> std::result::Result<
tonic::Response<Self::SyncPersistentCachePiecesStream>,
tonic::Status,
>;
type SyncHostStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::super::super::common::v2::Host,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn sync_host(
&self,
request: tonic::Request<super::SyncHostRequest>,
) -> std::result::Result<tonic::Response<Self::SyncHostStream>, tonic::Status>;
}
#[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)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for DfdaemonUploadServer<T>
where
T: DfdaemonUpload,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/dfdaemon.v2.DfdaemonUpload/DownloadTask" => {
#[allow(non_camel_case_types)]
struct DownloadTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<super::DownloadTaskRequest>
for DownloadTaskSvc<T> {
type Response = super::DownloadTaskResponse;
type ResponseStream = T::DownloadTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::download_task(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/StatTask" => {
#[allow(non_camel_case_types)]
struct StatTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::StatTaskRequest>
for StatTaskSvc<T> {
type Response = super::super::super::common::v2::Task;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::stat_task(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/StatLocalTask" => {
#[allow(non_camel_case_types)]
struct StatLocalTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::StatLocalTaskRequest>
for StatLocalTaskSvc<T> {
type Response = super::StatLocalTaskResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatLocalTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::stat_local_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatLocalTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/ListTaskEntries" => {
#[allow(non_camel_case_types)]
struct ListTaskEntriesSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::ListTaskEntriesRequest>
for ListTaskEntriesSvc<T> {
type Response = super::ListTaskEntriesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListTaskEntriesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::list_task_entries(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListTaskEntriesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DeleteTask" => {
#[allow(non_camel_case_types)]
struct DeleteTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::DeleteTaskRequest>
for DeleteTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::delete_task(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/SyncPieces" => {
#[allow(non_camel_case_types)]
struct SyncPiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<super::SyncPiecesRequest>
for SyncPiecesSvc<T> {
type Response = super::SyncPiecesResponse;
type ResponseStream = T::SyncPiecesStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SyncPiecesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::sync_pieces(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SyncPiecesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DownloadCacheTask" => {
#[allow(non_camel_case_types)]
struct DownloadCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<
super::DownloadCacheTaskRequest,
> for DownloadCacheTaskSvc<T> {
type Response = super::DownloadCacheTaskResponse;
type ResponseStream = T::DownloadCacheTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::download_cache_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/StatCacheTask" => {
#[allow(non_camel_case_types)]
struct StatCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::StatCacheTaskRequest>
for StatCacheTaskSvc<T> {
type Response = super::super::super::common::v2::CacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::stat_cache_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DeleteCacheTask" => {
#[allow(non_camel_case_types)]
struct DeleteCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::DeleteCacheTaskRequest>
for DeleteCacheTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::delete_cache_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/SyncCachePieces" => {
#[allow(non_camel_case_types)]
struct SyncCachePiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<
super::SyncCachePiecesRequest,
> for SyncCachePiecesSvc<T> {
type Response = super::SyncCachePiecesResponse;
type ResponseStream = T::SyncCachePiecesStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SyncCachePiecesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::sync_cache_pieces(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SyncCachePiecesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DownloadCachePiece" => {
#[allow(non_camel_case_types)]
struct DownloadCachePieceSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::DownloadCachePieceRequest>
for DownloadCachePieceSvc<T> {
type Response = super::DownloadCachePieceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadCachePieceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::download_cache_piece(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadCachePieceSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DownloadPersistentTask" => {
#[allow(non_camel_case_types)]
struct DownloadPersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<
super::DownloadPersistentTaskRequest,
> for DownloadPersistentTaskSvc<T> {
type Response = super::DownloadPersistentTaskResponse;
type ResponseStream = T::DownloadPersistentTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadPersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::download_persistent_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadPersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/SyncPersistentPieces" => {
#[allow(non_camel_case_types)]
struct SyncPersistentPiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<
super::SyncPersistentPiecesRequest,
> for SyncPersistentPiecesSvc<T> {
type Response = super::SyncPersistentPiecesResponse;
type ResponseStream = T::SyncPersistentPiecesStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SyncPersistentPiecesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::sync_persistent_pieces(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SyncPersistentPiecesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/UpdatePersistentTask" => {
#[allow(non_camel_case_types)]
struct UpdatePersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::UpdatePersistentTaskRequest>
for UpdatePersistentTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UpdatePersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::update_persistent_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpdatePersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/StatPersistentTask" => {
#[allow(non_camel_case_types)]
struct StatPersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::StatPersistentTaskRequest>
for StatPersistentTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatPersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::stat_persistent_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatPersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DeletePersistentTask" => {
#[allow(non_camel_case_types)]
struct DeletePersistentTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::DeletePersistentTaskRequest>
for DeletePersistentTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::delete_persistent_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeletePersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DownloadPersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct DownloadPersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<
super::DownloadPersistentCacheTaskRequest,
> for DownloadPersistentCacheTaskSvc<T> {
type Response = super::DownloadPersistentCacheTaskResponse;
type ResponseStream = T::DownloadPersistentCacheTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::DownloadPersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::download_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadPersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/UpdatePersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct UpdatePersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<
super::UpdatePersistentCacheTaskRequest,
> for UpdatePersistentCacheTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UpdatePersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::update_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpdatePersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/StatPersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct StatPersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<super::StatPersistentCacheTaskRequest>
for StatPersistentCacheTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentCacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::StatPersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::stat_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatPersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/DeletePersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct DeletePersistentCacheTaskSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::UnaryService<
super::DeletePersistentCacheTaskRequest,
> for DeletePersistentCacheTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::DeletePersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::delete_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeletePersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/SyncPersistentCachePieces" => {
#[allow(non_camel_case_types)]
struct SyncPersistentCachePiecesSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<
super::SyncPersistentCachePiecesRequest,
> for SyncPersistentCachePiecesSvc<T> {
type Response = super::SyncPersistentCachePiecesResponse;
type ResponseStream = T::SyncPersistentCachePiecesStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::SyncPersistentCachePiecesRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::sync_persistent_cache_pieces(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SyncPersistentCachePiecesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonUpload/SyncHost" => {
#[allow(non_camel_case_types)]
struct SyncHostSvc<T: DfdaemonUpload>(pub Arc<T>);
impl<
T: DfdaemonUpload,
> tonic::server::ServerStreamingService<super::SyncHostRequest>
for SyncHostSvc<T> {
type Response = super::super::super::common::v2::Host;
type ResponseStream = T::SyncHostStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SyncHostRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonUpload>::sync_host(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = SyncHostSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for DfdaemonUploadServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "dfdaemon.v2.DfdaemonUpload";
impl<T> tonic::server::NamedService for DfdaemonUploadServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod dfdaemon_download_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct DfdaemonDownloadClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DfdaemonDownloadClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> DfdaemonDownloadClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DfdaemonDownloadClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DfdaemonDownloadClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn download_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadTaskRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::DownloadTaskResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DownloadTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DownloadTask"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn stat_task(
&mut self,
request: impl tonic::IntoRequest<super::StatTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Task>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/StatTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatTask"));
self.inner.unary(req, path, codec).await
}
pub async fn stat_local_task(
&mut self,
request: impl tonic::IntoRequest<super::StatLocalTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalTaskResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/StatLocalTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatLocalTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_local_tasks(
&mut self,
request: impl tonic::IntoRequest<super::ListLocalTasksRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocalTasksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/ListLocalTasks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "ListLocalTasks"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_task_entries(
&mut self,
request: impl tonic::IntoRequest<super::ListTaskEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::ListTaskEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/ListTaskEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "ListTaskEntries"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DeleteTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteTask"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_local_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteLocalTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DeleteLocalTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteLocalTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_host(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DeleteHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteHost"));
self.inner.unary(req, path, codec).await
}
pub async fn download_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::DownloadCacheTaskResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DownloadCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DownloadCacheTask"),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn stat_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::StatCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CacheTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/StatCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatCacheTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DeleteCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "DeleteCacheTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn download_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::DownloadPersistentTaskResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DownloadPersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"DownloadPersistentTask",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn upload_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::UploadPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/UploadPersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"UploadPersistentTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/StatPersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("dfdaemon.v2.DfdaemonDownload", "StatPersistentTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_local_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::StatLocalPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalPersistentTaskResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"StatLocalPersistentTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_local_persistent_tasks(
&mut self,
request: impl tonic::IntoRequest<super::ListLocalPersistentTasksRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocalPersistentTasksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentTasks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"ListLocalPersistentTasks",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn download_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DownloadPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::DownloadPersistentCacheTaskResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/DownloadPersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"DownloadPersistentCacheTask",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn upload_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::UploadPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/UploadPersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"UploadPersistentCacheTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/StatPersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"StatPersistentCacheTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_local_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::StatLocalPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalPersistentCacheTaskResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"StatLocalPersistentCacheTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_local_persistent_cache_tasks(
&mut self,
request: impl tonic::IntoRequest<super::ListLocalPersistentCacheTasksRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocalPersistentCacheTasksResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentCacheTasks",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"dfdaemon.v2.DfdaemonDownload",
"ListLocalPersistentCacheTasks",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod dfdaemon_download_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait DfdaemonDownload: std::marker::Send + std::marker::Sync + 'static {
type DownloadTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::DownloadTaskResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn download_task(
&self,
request: tonic::Request<super::DownloadTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadTaskStream>,
tonic::Status,
>;
async fn stat_task(
&self,
request: tonic::Request<super::StatTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Task>,
tonic::Status,
>;
async fn stat_local_task(
&self,
request: tonic::Request<super::StatLocalTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalTaskResponse>,
tonic::Status,
>;
async fn list_local_tasks(
&self,
request: tonic::Request<super::ListLocalTasksRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocalTasksResponse>,
tonic::Status,
>;
async fn list_task_entries(
&self,
request: tonic::Request<super::ListTaskEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::ListTaskEntriesResponse>,
tonic::Status,
>;
async fn delete_task(
&self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn delete_local_task(
&self,
request: tonic::Request<super::DeleteLocalTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn delete_host(
&self,
request: tonic::Request<()>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type DownloadCacheTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::DownloadCacheTaskResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn download_cache_task(
&self,
request: tonic::Request<super::DownloadCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadCacheTaskStream>,
tonic::Status,
>;
async fn stat_cache_task(
&self,
request: tonic::Request<super::StatCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CacheTask>,
tonic::Status,
>;
async fn delete_cache_task(
&self,
request: tonic::Request<super::DeleteCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type DownloadPersistentTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::DownloadPersistentTaskResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn download_persistent_task(
&self,
request: tonic::Request<super::DownloadPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadPersistentTaskStream>,
tonic::Status,
>;
async fn upload_persistent_task(
&self,
request: tonic::Request<super::UploadPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
>;
async fn stat_persistent_task(
&self,
request: tonic::Request<super::StatPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
>;
async fn stat_local_persistent_task(
&self,
request: tonic::Request<super::StatLocalPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalPersistentTaskResponse>,
tonic::Status,
>;
async fn list_local_persistent_tasks(
&self,
request: tonic::Request<super::ListLocalPersistentTasksRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocalPersistentTasksResponse>,
tonic::Status,
>;
type DownloadPersistentCacheTaskStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::DownloadPersistentCacheTaskResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn download_persistent_cache_task(
&self,
request: tonic::Request<super::DownloadPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<Self::DownloadPersistentCacheTaskStream>,
tonic::Status,
>;
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,
>;
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,
>;
async fn stat_local_persistent_cache_task(
&self,
request: tonic::Request<super::StatLocalPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::StatLocalPersistentCacheTaskResponse>,
tonic::Status,
>;
async fn list_local_persistent_cache_tasks(
&self,
request: tonic::Request<super::ListLocalPersistentCacheTasksRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocalPersistentCacheTasksResponse>,
tonic::Status,
>;
}
#[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)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for DfdaemonDownloadServer<T>
where
T: DfdaemonDownload,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/dfdaemon.v2.DfdaemonDownload/DownloadTask" => {
#[allow(non_camel_case_types)]
struct DownloadTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::ServerStreamingService<super::DownloadTaskRequest>
for DownloadTaskSvc<T> {
type Response = super::DownloadTaskResponse;
type ResponseStream = T::DownloadTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::download_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/StatTask" => {
#[allow(non_camel_case_types)]
struct StatTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::StatTaskRequest>
for StatTaskSvc<T> {
type Response = super::super::super::common::v2::Task;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::stat_task(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/StatLocalTask" => {
#[allow(non_camel_case_types)]
struct StatLocalTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::StatLocalTaskRequest>
for StatLocalTaskSvc<T> {
type Response = super::StatLocalTaskResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatLocalTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::stat_local_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatLocalTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/ListLocalTasks" => {
#[allow(non_camel_case_types)]
struct ListLocalTasksSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::ListLocalTasksRequest>
for ListLocalTasksSvc<T> {
type Response = super::ListLocalTasksResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListLocalTasksRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::list_local_tasks(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListLocalTasksSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/ListTaskEntries" => {
#[allow(non_camel_case_types)]
struct ListTaskEntriesSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::ListTaskEntriesRequest>
for ListTaskEntriesSvc<T> {
type Response = super::ListTaskEntriesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListTaskEntriesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::list_task_entries(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListTaskEntriesSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/DeleteTask" => {
#[allow(non_camel_case_types)]
struct DeleteTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::DeleteTaskRequest>
for DeleteTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::delete_task(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/DeleteLocalTask" => {
#[allow(non_camel_case_types)]
struct DeleteLocalTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::DeleteLocalTaskRequest>
for DeleteLocalTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteLocalTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::delete_local_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteLocalTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/DeleteHost" => {
#[allow(non_camel_case_types)]
struct DeleteHostSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<T: DfdaemonDownload> tonic::server::UnaryService<()>
for DeleteHostSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::delete_host(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteHostSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/DownloadCacheTask" => {
#[allow(non_camel_case_types)]
struct DownloadCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::ServerStreamingService<
super::DownloadCacheTaskRequest,
> for DownloadCacheTaskSvc<T> {
type Response = super::DownloadCacheTaskResponse;
type ResponseStream = T::DownloadCacheTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::download_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/StatCacheTask" => {
#[allow(non_camel_case_types)]
struct StatCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::StatCacheTaskRequest>
for StatCacheTaskSvc<T> {
type Response = super::super::super::common::v2::CacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::stat_cache_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/DeleteCacheTask" => {
#[allow(non_camel_case_types)]
struct DeleteCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::DeleteCacheTaskRequest>
for DeleteCacheTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::delete_cache_task(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/DownloadPersistentTask" => {
#[allow(non_camel_case_types)]
struct DownloadPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::ServerStreamingService<
super::DownloadPersistentTaskRequest,
> for DownloadPersistentTaskSvc<T> {
type Response = super::DownloadPersistentTaskResponse;
type ResponseStream = T::DownloadPersistentTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DownloadPersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::download_persistent_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadPersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/UploadPersistentTask" => {
#[allow(non_camel_case_types)]
struct UploadPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::UploadPersistentTaskRequest>
for UploadPersistentTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::UploadPersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::upload_persistent_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UploadPersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/StatPersistentTask" => {
#[allow(non_camel_case_types)]
struct StatPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::StatPersistentTaskRequest>
for StatPersistentTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatPersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::stat_persistent_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatPersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentTask" => {
#[allow(non_camel_case_types)]
struct StatLocalPersistentTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::StatLocalPersistentTaskRequest>
for StatLocalPersistentTaskSvc<T> {
type Response = super::StatLocalPersistentTaskResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::StatLocalPersistentTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::stat_local_persistent_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatLocalPersistentTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentTasks" => {
#[allow(non_camel_case_types)]
struct ListLocalPersistentTasksSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::ListLocalPersistentTasksRequest>
for ListLocalPersistentTasksSvc<T> {
type Response = super::ListLocalPersistentTasksResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::ListLocalPersistentTasksRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::list_local_persistent_tasks(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListLocalPersistentTasksSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/DownloadPersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct DownloadPersistentCacheTaskSvc<T: DfdaemonDownload>(
pub Arc<T>,
);
impl<
T: DfdaemonDownload,
> tonic::server::ServerStreamingService<
super::DownloadPersistentCacheTaskRequest,
> for DownloadPersistentCacheTaskSvc<T> {
type Response = super::DownloadPersistentCacheTaskResponse;
type ResponseStream = T::DownloadPersistentCacheTaskStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::DownloadPersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::download_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DownloadPersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/UploadPersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct UploadPersistentCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<
super::UploadPersistentCacheTaskRequest,
> for UploadPersistentCacheTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentCacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UploadPersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::upload_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UploadPersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/StatPersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct StatPersistentCacheTaskSvc<T: DfdaemonDownload>(pub Arc<T>);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<super::StatPersistentCacheTaskRequest>
for StatPersistentCacheTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentCacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::StatPersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::stat_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatPersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/StatLocalPersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct StatLocalPersistentCacheTaskSvc<T: DfdaemonDownload>(
pub Arc<T>,
);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<
super::StatLocalPersistentCacheTaskRequest,
> for StatLocalPersistentCacheTaskSvc<T> {
type Response = super::StatLocalPersistentCacheTaskResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::StatLocalPersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::stat_local_persistent_cache_task(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = StatLocalPersistentCacheTaskSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/dfdaemon.v2.DfdaemonDownload/ListLocalPersistentCacheTasks" => {
#[allow(non_camel_case_types)]
struct ListLocalPersistentCacheTasksSvc<T: DfdaemonDownload>(
pub Arc<T>,
);
impl<
T: DfdaemonDownload,
> tonic::server::UnaryService<
super::ListLocalPersistentCacheTasksRequest,
> for ListLocalPersistentCacheTasksSvc<T> {
type Response = super::ListLocalPersistentCacheTasksResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::ListLocalPersistentCacheTasksRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as DfdaemonDownload>::list_local_persistent_cache_tasks(
&inner,
request,
)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListLocalPersistentCacheTasksSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for DfdaemonDownloadServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "dfdaemon.v2.DfdaemonDownload";
impl<T> tonic::server::NamedService for DfdaemonDownloadServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}