#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIndexRequest {
#[prost(string, tag = "1")]
pub index_name: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub num_dimensions: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIndexResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIndexRequest {
#[prost(string, tag = "1")]
pub index_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIndexResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIndexesRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIndexesResponse {
#[prost(string, repeated, tag = "1")]
pub index_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteCacheRequest {
#[prost(string, tag = "1")]
pub cache_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteCacheResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCacheRequest {
#[prost(string, tag = "1")]
pub cache_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCacheResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCachesRequest {
#[prost(string, tag = "1")]
pub next_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CacheLimits {
#[prost(uint32, tag = "1")]
pub max_traffic_rate: u32,
#[prost(uint32, tag = "2")]
pub max_throughput_kbps: u32,
#[prost(uint32, tag = "3")]
pub max_item_size_kb: u32,
#[prost(uint64, tag = "4")]
pub max_ttl_seconds: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TopicLimits {
#[prost(uint32, tag = "1")]
pub max_publish_rate: u32,
#[prost(uint32, tag = "2")]
pub max_subscription_count: u32,
#[prost(uint32, tag = "3")]
pub max_publish_message_size_kb: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cache {
#[prost(string, tag = "1")]
pub cache_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub cache_limits: ::core::option::Option<CacheLimits>,
#[prost(message, optional, tag = "3")]
pub topic_limits: ::core::option::Option<TopicLimits>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCachesResponse {
#[prost(message, repeated, tag = "1")]
pub cache: ::prost::alloc::vec::Vec<Cache>,
#[prost(string, tag = "2")]
pub next_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSigningKeyRequest {
#[prost(uint32, tag = "1")]
pub ttl_minutes: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSigningKeyResponse {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub expires_at: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RevokeSigningKeyRequest {
#[prost(string, tag = "1")]
pub key_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RevokeSigningKeyResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SigningKey {
#[prost(string, tag = "1")]
pub key_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub expires_at: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSigningKeysRequest {
#[prost(string, tag = "1")]
pub next_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSigningKeysResponse {
#[prost(message, repeated, tag = "1")]
pub signing_key: ::prost::alloc::vec::Vec<SigningKey>,
#[prost(string, tag = "2")]
pub next_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlushCacheRequest {
#[prost(string, tag = "1")]
pub cache_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlushCacheResponse {}
pub mod scs_control_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 ScsControlClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ScsControlClient<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> ScsControlClient<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,
) -> ScsControlClient<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,
{
ScsControlClient::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 create_cache(
&mut self,
request: impl tonic::IntoRequest<super::CreateCacheRequest>,
) -> std::result::Result<
tonic::Response<super::CreateCacheResponse>,
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(
"/control_client.ScsControl/CreateCache",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "CreateCache"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_cache(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCacheRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteCacheResponse>,
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(
"/control_client.ScsControl/DeleteCache",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "DeleteCache"));
self.inner.unary(req, path, codec).await
}
pub async fn list_caches(
&mut self,
request: impl tonic::IntoRequest<super::ListCachesRequest>,
) -> std::result::Result<
tonic::Response<super::ListCachesResponse>,
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(
"/control_client.ScsControl/ListCaches",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "ListCaches"));
self.inner.unary(req, path, codec).await
}
pub async fn flush_cache(
&mut self,
request: impl tonic::IntoRequest<super::FlushCacheRequest>,
) -> std::result::Result<
tonic::Response<super::FlushCacheResponse>,
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(
"/control_client.ScsControl/FlushCache",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "FlushCache"));
self.inner.unary(req, path, codec).await
}
pub async fn create_signing_key(
&mut self,
request: impl tonic::IntoRequest<super::CreateSigningKeyRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSigningKeyResponse>,
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(
"/control_client.ScsControl/CreateSigningKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("control_client.ScsControl", "CreateSigningKey"),
);
self.inner.unary(req, path, codec).await
}
pub async fn revoke_signing_key(
&mut self,
request: impl tonic::IntoRequest<super::RevokeSigningKeyRequest>,
) -> std::result::Result<
tonic::Response<super::RevokeSigningKeyResponse>,
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(
"/control_client.ScsControl/RevokeSigningKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("control_client.ScsControl", "RevokeSigningKey"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_signing_keys(
&mut self,
request: impl tonic::IntoRequest<super::ListSigningKeysRequest>,
) -> std::result::Result<
tonic::Response<super::ListSigningKeysResponse>,
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(
"/control_client.ScsControl/ListSigningKeys",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "ListSigningKeys"));
self.inner.unary(req, path, codec).await
}
pub async fn create_index(
&mut self,
request: impl tonic::IntoRequest<super::CreateIndexRequest>,
) -> std::result::Result<
tonic::Response<super::CreateIndexResponse>,
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(
"/control_client.ScsControl/CreateIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "CreateIndex"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_index(
&mut self,
request: impl tonic::IntoRequest<super::DeleteIndexRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteIndexResponse>,
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(
"/control_client.ScsControl/DeleteIndex",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "DeleteIndex"));
self.inner.unary(req, path, codec).await
}
pub async fn list_indexes(
&mut self,
request: impl tonic::IntoRequest<super::ListIndexesRequest>,
) -> std::result::Result<
tonic::Response<super::ListIndexesResponse>,
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(
"/control_client.ScsControl/ListIndexes",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("control_client.ScsControl", "ListIndexes"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod scs_control_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait ScsControl: Send + Sync + 'static {
async fn create_cache(
&self,
request: tonic::Request<super::CreateCacheRequest>,
) -> std::result::Result<
tonic::Response<super::CreateCacheResponse>,
tonic::Status,
>;
async fn delete_cache(
&self,
request: tonic::Request<super::DeleteCacheRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteCacheResponse>,
tonic::Status,
>;
async fn list_caches(
&self,
request: tonic::Request<super::ListCachesRequest>,
) -> std::result::Result<
tonic::Response<super::ListCachesResponse>,
tonic::Status,
>;
async fn flush_cache(
&self,
request: tonic::Request<super::FlushCacheRequest>,
) -> std::result::Result<
tonic::Response<super::FlushCacheResponse>,
tonic::Status,
>;
async fn create_signing_key(
&self,
request: tonic::Request<super::CreateSigningKeyRequest>,
) -> std::result::Result<
tonic::Response<super::CreateSigningKeyResponse>,
tonic::Status,
>;
async fn revoke_signing_key(
&self,
request: tonic::Request<super::RevokeSigningKeyRequest>,
) -> std::result::Result<
tonic::Response<super::RevokeSigningKeyResponse>,
tonic::Status,
>;
async fn list_signing_keys(
&self,
request: tonic::Request<super::ListSigningKeysRequest>,
) -> std::result::Result<
tonic::Response<super::ListSigningKeysResponse>,
tonic::Status,
>;
async fn create_index(
&self,
request: tonic::Request<super::CreateIndexRequest>,
) -> std::result::Result<
tonic::Response<super::CreateIndexResponse>,
tonic::Status,
>;
async fn delete_index(
&self,
request: tonic::Request<super::DeleteIndexRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteIndexResponse>,
tonic::Status,
>;
async fn list_indexes(
&self,
request: tonic::Request<super::ListIndexesRequest>,
) -> std::result::Result<
tonic::Response<super::ListIndexesResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct ScsControlServer<T: ScsControl> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: ScsControl> ScsControlServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
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 ScsControlServer<T>
where
T: ScsControl,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/control_client.ScsControl/CreateCache" => {
#[allow(non_camel_case_types)]
struct CreateCacheSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::CreateCacheRequest>
for CreateCacheSvc<T> {
type Response = super::CreateCacheResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateCacheRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).create_cache(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 inner = inner.0;
let method = CreateCacheSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/DeleteCache" => {
#[allow(non_camel_case_types)]
struct DeleteCacheSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::DeleteCacheRequest>
for DeleteCacheSvc<T> {
type Response = super::DeleteCacheResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteCacheRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).delete_cache(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 inner = inner.0;
let method = DeleteCacheSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/ListCaches" => {
#[allow(non_camel_case_types)]
struct ListCachesSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::ListCachesRequest>
for ListCachesSvc<T> {
type Response = super::ListCachesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListCachesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).list_caches(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 inner = inner.0;
let method = ListCachesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/FlushCache" => {
#[allow(non_camel_case_types)]
struct FlushCacheSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::FlushCacheRequest>
for FlushCacheSvc<T> {
type Response = super::FlushCacheResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::FlushCacheRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move { (*inner).flush_cache(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 inner = inner.0;
let method = FlushCacheSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/CreateSigningKey" => {
#[allow(non_camel_case_types)]
struct CreateSigningKeySvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::CreateSigningKeyRequest>
for CreateSigningKeySvc<T> {
type Response = super::CreateSigningKeyResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateSigningKeyRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).create_signing_key(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 inner = inner.0;
let method = CreateSigningKeySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/RevokeSigningKey" => {
#[allow(non_camel_case_types)]
struct RevokeSigningKeySvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::RevokeSigningKeyRequest>
for RevokeSigningKeySvc<T> {
type Response = super::RevokeSigningKeyResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RevokeSigningKeyRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).revoke_signing_key(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 inner = inner.0;
let method = RevokeSigningKeySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/ListSigningKeys" => {
#[allow(non_camel_case_types)]
struct ListSigningKeysSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::ListSigningKeysRequest>
for ListSigningKeysSvc<T> {
type Response = super::ListSigningKeysResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListSigningKeysRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).list_signing_keys(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 inner = inner.0;
let method = ListSigningKeysSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/CreateIndex" => {
#[allow(non_camel_case_types)]
struct CreateIndexSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::CreateIndexRequest>
for CreateIndexSvc<T> {
type Response = super::CreateIndexResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateIndexRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).create_index(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 inner = inner.0;
let method = CreateIndexSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/DeleteIndex" => {
#[allow(non_camel_case_types)]
struct DeleteIndexSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::DeleteIndexRequest>
for DeleteIndexSvc<T> {
type Response = super::DeleteIndexResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteIndexRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).delete_index(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 inner = inner.0;
let method = DeleteIndexSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/control_client.ScsControl/ListIndexes" => {
#[allow(non_camel_case_types)]
struct ListIndexesSvc<T: ScsControl>(pub Arc<T>);
impl<
T: ScsControl,
> tonic::server::UnaryService<super::ListIndexesRequest>
for ListIndexesSvc<T> {
type Response = super::ListIndexesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListIndexesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
(*inner).list_indexes(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 inner = inner.0;
let method = ListIndexesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: ScsControl> Clone for ScsControlServer<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,
}
}
}
impl<T: ScsControl> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: ScsControl> tonic::server::NamedService for ScsControlServer<T> {
const NAME: &'static str = "control_client.ScsControl";
}
}