#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuspendImportRpcRequest {
#[prost(bool, tag = "1")]
pub should_suspend_imports: bool,
#[prost(uint64, tag = "2")]
pub duration_in_secs: u64,
#[prost(string, tag = "3")]
pub caller: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SuspendImportRpcResponse {
#[prost(bool, tag = "1")]
pub already_suspended: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwitchModeRequest {
#[prost(enumeration = "SwitchMode", tag = "1")]
pub mode: i32,
#[prost(message, repeated, tag = "2")]
pub ranges: ::prost::alloc::vec::Vec<Range>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SwitchModeResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetModeRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetModeResponse {
#[prost(enumeration = "SwitchMode", tag = "1")]
pub mode: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Range {
#[prost(bytes = "vec", tag = "1")]
pub start: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub end: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SstMeta {
#[prost(bytes = "vec", tag = "1")]
pub uuid: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<Range>,
#[prost(uint32, tag = "3")]
pub crc32: u32,
#[prost(uint64, tag = "4")]
pub length: u64,
#[prost(string, tag = "5")]
pub cf_name: ::prost::alloc::string::String,
#[prost(uint64, tag = "6")]
pub region_id: u64,
#[prost(message, optional, tag = "7")]
pub region_epoch: ::core::option::Option<super::metapb::RegionEpoch>,
#[prost(bool, tag = "8")]
pub end_key_exclusive: bool,
#[prost(uint64, tag = "9")]
pub total_kvs: u64,
#[prost(uint64, tag = "10")]
pub total_bytes: u64,
#[prost(enumeration = "super::kvrpcpb::ApiVersion", tag = "11")]
pub api_version: i32,
#[prost(bytes = "vec", tag = "12")]
pub cipher_iv: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RewriteRule {
#[prost(bytes = "vec", tag = "1")]
pub old_key_prefix: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub new_key_prefix: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "3")]
pub new_timestamp: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadRequest {
#[prost(oneof = "upload_request::Chunk", tags = "1, 2")]
pub chunk: ::core::option::Option<upload_request::Chunk>,
}
pub mod upload_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Chunk {
#[prost(message, tag = "1")]
Meta(super::SstMeta),
#[prost(bytes, tag = "2")]
Data(::prost::alloc::vec::Vec<u8>),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IngestRequest {
#[prost(message, optional, tag = "1")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
#[prost(message, optional, tag = "2")]
pub sst: ::core::option::Option<SstMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiIngestRequest {
#[prost(message, optional, tag = "1")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
#[prost(message, repeated, tag = "2")]
pub ssts: ::prost::alloc::vec::Vec<SstMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IngestResponse {
#[prost(message, optional, tag = "1")]
pub error: ::core::option::Option<super::errorpb::Error>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactRequest {
#[prost(message, optional, tag = "1")]
pub range: ::core::option::Option<Range>,
#[prost(int32, tag = "2")]
pub output_level: i32,
#[prost(message, optional, tag = "3")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadRequest {
#[prost(map = "string, message", tag = "1")]
pub ssts: ::std::collections::HashMap<::prost::alloc::string::String, SstMeta>,
#[prost(uint64, tag = "3")]
pub resolved_ts: u64,
#[prost(message, optional, tag = "2")]
pub sst: ::core::option::Option<SstMeta>,
#[prost(string, tag = "9")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "13")]
pub rewrite_rule: ::core::option::Option<RewriteRule>,
#[prost(message, optional, tag = "14")]
pub storage_backend: ::core::option::Option<super::backup::StorageBackend>,
#[prost(string, tag = "17")]
pub storage_cache_id: ::prost::alloc::string::String,
#[prost(bool, tag = "15")]
pub is_raw_kv: bool,
#[prost(message, optional, tag = "16")]
pub cipher_info: ::core::option::Option<super::backup::CipherInfo>,
#[prost(enumeration = "DownloadRequestType", tag = "18")]
pub request_type: i32,
#[prost(message, optional, tag = "19")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Error {
#[prost(string, tag = "1")]
pub message: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub store_error: ::core::option::Option<super::errorpb::Error>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadResponse {
#[prost(message, optional, tag = "1")]
pub range: ::core::option::Option<Range>,
#[prost(bool, tag = "2")]
pub is_empty: bool,
#[prost(message, optional, tag = "3")]
pub error: ::core::option::Option<Error>,
#[prost(uint32, tag = "4")]
pub crc32: u32,
#[prost(uint64, tag = "5")]
pub length: u64,
#[prost(message, repeated, tag = "6")]
pub ssts: ::prost::alloc::vec::Vec<SstMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetDownloadSpeedLimitRequest {
#[prost(uint64, tag = "1")]
pub speed_limit: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetDownloadSpeedLimitResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pair {
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(enumeration = "pair::Op", tag = "3")]
pub op: i32,
}
pub mod pair {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Op {
Put = 0,
Delete = 1,
}
impl Op {
pub fn as_str_name(&self) -> &'static str {
match self {
Op::Put => "Put",
Op::Delete => "Delete",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Put" => Some(Self::Put),
"Delete" => Some(Self::Delete),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteBatch {
#[prost(uint64, tag = "1")]
pub commit_ts: u64,
#[prost(message, repeated, tag = "2")]
pub pairs: ::prost::alloc::vec::Vec<Pair>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteRequest {
#[prost(message, optional, tag = "3")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
#[prost(oneof = "write_request::Chunk", tags = "1, 2")]
pub chunk: ::core::option::Option<write_request::Chunk>,
}
pub mod write_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Chunk {
#[prost(message, tag = "1")]
Meta(super::SstMeta),
#[prost(message, tag = "2")]
Batch(super::WriteBatch),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteResponse {
#[prost(message, optional, tag = "1")]
pub error: ::core::option::Option<Error>,
#[prost(message, repeated, tag = "2")]
pub metas: ::prost::alloc::vec::Vec<SstMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawWriteBatch {
#[prost(uint64, tag = "1")]
pub ttl: u64,
#[prost(message, repeated, tag = "2")]
pub pairs: ::prost::alloc::vec::Vec<Pair>,
#[prost(uint64, tag = "3")]
pub ts: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawWriteRequest {
#[prost(message, optional, tag = "3")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
#[prost(oneof = "raw_write_request::Chunk", tags = "1, 2")]
pub chunk: ::core::option::Option<raw_write_request::Chunk>,
}
pub mod raw_write_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Chunk {
#[prost(message, tag = "1")]
Meta(super::SstMeta),
#[prost(message, tag = "2")]
Batch(super::RawWriteBatch),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawWriteResponse {
#[prost(message, optional, tag = "1")]
pub error: ::core::option::Option<Error>,
#[prost(message, repeated, tag = "2")]
pub metas: ::prost::alloc::vec::Vec<SstMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DuplicateDetectRequest {
#[prost(message, optional, tag = "1")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
#[prost(bytes = "vec", tag = "2")]
pub start_key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "3")]
pub end_key: ::prost::alloc::vec::Vec<u8>,
#[prost(bool, tag = "4")]
pub key_only: bool,
#[prost(uint64, tag = "5")]
pub min_commit_ts: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KvPair {
#[prost(bytes = "vec", tag = "1")]
pub key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "3")]
pub commit_ts: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DuplicateDetectResponse {
#[prost(message, optional, tag = "1")]
pub region_error: ::core::option::Option<super::errorpb::Error>,
#[prost(message, optional, tag = "2")]
pub key_error: ::core::option::Option<Error>,
#[prost(message, repeated, tag = "3")]
pub pairs: ::prost::alloc::vec::Vec<KvPair>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KvMeta {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(uint64, tag = "11")]
pub range_offset: u64,
#[prost(uint64, tag = "2")]
pub length: u64,
#[prost(uint64, tag = "12")]
pub range_length: u64,
#[prost(string, tag = "3")]
pub cf: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub is_delete: bool,
#[prost(uint64, tag = "10")]
pub start_ts: u64,
#[prost(uint64, tag = "5")]
pub restore_ts: u64,
#[prost(bytes = "vec", tag = "6")]
pub start_key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "7")]
pub end_key: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "8")]
pub sha256: ::prost::alloc::vec::Vec<u8>,
#[prost(uint64, tag = "9")]
pub start_snapshot_ts: u64,
#[prost(enumeration = "super::backup::CompressionType", tag = "13")]
pub compression_type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyRequest {
#[prost(message, optional, tag = "1")]
pub meta: ::core::option::Option<KvMeta>,
#[prost(message, repeated, tag = "12")]
pub metas: ::prost::alloc::vec::Vec<KvMeta>,
#[prost(message, optional, tag = "2")]
pub rewrite_rule: ::core::option::Option<RewriteRule>,
#[prost(message, repeated, tag = "13")]
pub rewrite_rules: ::prost::alloc::vec::Vec<RewriteRule>,
#[prost(string, tag = "5")]
pub storage_cache_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub storage_backend: ::core::option::Option<super::backup::StorageBackend>,
#[prost(message, optional, tag = "4")]
pub context: ::core::option::Option<super::kvrpcpb::Context>,
#[prost(message, optional, tag = "11")]
pub cipher_info: ::core::option::Option<super::backup::CipherInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyResponse {
#[prost(message, optional, tag = "1")]
pub range: ::core::option::Option<Range>,
#[prost(message, optional, tag = "2")]
pub error: ::core::option::Option<Error>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClearRequest {
#[prost(string, tag = "1")]
pub prefix: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClearResponse {
#[prost(message, optional, tag = "1")]
pub error: ::core::option::Option<Error>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SwitchMode {
Normal = 0,
Import = 1,
}
impl SwitchMode {
pub fn as_str_name(&self) -> &'static str {
match self {
SwitchMode::Normal => "Normal",
SwitchMode::Import => "Import",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Normal" => Some(Self::Normal),
"Import" => Some(Self::Import),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DownloadRequestType {
Legacy = 0,
Keyspace = 1,
}
impl DownloadRequestType {
pub fn as_str_name(&self) -> &'static str {
match self {
DownloadRequestType::Legacy => "Legacy",
DownloadRequestType::Keyspace => "Keyspace",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"Legacy" => Some(Self::Legacy),
"Keyspace" => Some(Self::Keyspace),
_ => None,
}
}
}
pub mod import_sst_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ImportSstClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ImportSstClient<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> ImportSstClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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,
) -> ImportSstClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ImportSstClient::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 switch_mode(
&mut self,
request: impl tonic::IntoRequest<super::SwitchModeRequest>,
) -> std::result::Result<
tonic::Response<super::SwitchModeResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/SwitchMode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "SwitchMode"));
self.inner.unary(req, path, codec).await
}
pub async fn get_mode(
&mut self,
request: impl tonic::IntoRequest<super::GetModeRequest>,
) -> std::result::Result<
tonic::Response<super::GetModeResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/GetMode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "GetMode"));
self.inner.unary(req, path, codec).await
}
pub async fn upload(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::UploadRequest>,
) -> std::result::Result<tonic::Response<super::UploadResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/Upload",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "Upload"));
self.inner.client_streaming(req, path, codec).await
}
pub async fn ingest(
&mut self,
request: impl tonic::IntoRequest<super::IngestRequest>,
) -> std::result::Result<tonic::Response<super::IngestResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/Ingest",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "Ingest"));
self.inner.unary(req, path, codec).await
}
pub async fn compact(
&mut self,
request: impl tonic::IntoRequest<super::CompactRequest>,
) -> std::result::Result<
tonic::Response<super::CompactResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/Compact",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "Compact"));
self.inner.unary(req, path, codec).await
}
pub async fn set_download_speed_limit(
&mut self,
request: impl tonic::IntoRequest<super::SetDownloadSpeedLimitRequest>,
) -> std::result::Result<
tonic::Response<super::SetDownloadSpeedLimitResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/SetDownloadSpeedLimit",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("import_sstpb.ImportSST", "SetDownloadSpeedLimit"),
);
self.inner.unary(req, path, codec).await
}
pub async fn download(
&mut self,
request: impl tonic::IntoRequest<super::DownloadRequest>,
) -> std::result::Result<
tonic::Response<super::DownloadResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/Download",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "Download"));
self.inner.unary(req, path, codec).await
}
pub async fn write(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::WriteRequest>,
) -> std::result::Result<tonic::Response<super::WriteResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/Write",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "Write"));
self.inner.client_streaming(req, path, codec).await
}
pub async fn raw_write(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::RawWriteRequest>,
) -> std::result::Result<
tonic::Response<super::RawWriteResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/RawWrite",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "RawWrite"));
self.inner.client_streaming(req, path, codec).await
}
pub async fn multi_ingest(
&mut self,
request: impl tonic::IntoRequest<super::MultiIngestRequest>,
) -> std::result::Result<tonic::Response<super::IngestResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/MultiIngest",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "MultiIngest"));
self.inner.unary(req, path, codec).await
}
pub async fn duplicate_detect(
&mut self,
request: impl tonic::IntoRequest<super::DuplicateDetectRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::DuplicateDetectResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/DuplicateDetect",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "DuplicateDetect"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn apply(
&mut self,
request: impl tonic::IntoRequest<super::ApplyRequest>,
) -> std::result::Result<tonic::Response<super::ApplyResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/Apply",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "Apply"));
self.inner.unary(req, path, codec).await
}
pub async fn clear_files(
&mut self,
request: impl tonic::IntoRequest<super::ClearRequest>,
) -> std::result::Result<tonic::Response<super::ClearResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/ClearFiles",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "ClearFiles"));
self.inner.unary(req, path, codec).await
}
pub async fn suspend_import_rpc(
&mut self,
request: impl tonic::IntoRequest<super::SuspendImportRpcRequest>,
) -> std::result::Result<
tonic::Response<super::SuspendImportRpcResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/import_sstpb.ImportSST/SuspendImportRPC",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("import_sstpb.ImportSST", "SuspendImportRPC"));
self.inner.unary(req, path, codec).await
}
}
}