#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Empty {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct InitRequest {
#[prost(uint32, tag = "1")]
pub event_server: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnCreateRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OnCreateResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnMessageRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub in_message: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnMessageResponse {
#[prost(bytes = "vec", tag = "1")]
pub out_message: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnCloseRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OnCloseResponse {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PGetCapabilitiesResponse {
#[prost(uint64, tag = "1")]
pub capabilities: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub message: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EmitFlowEventRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EmitInputRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub input: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EmitOutputRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub output: ::prost::alloc::vec::Vec<u8>,
#[prost(int32, tag = "3")]
pub port: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EmitErrorRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Variable {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub scope: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVaultItemRequest {
#[prost(string, tag = "1")]
pub item_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vault_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVaultItemResponse {
#[prost(message, optional, tag = "1")]
pub item: ::core::option::Option<::prost_types::Struct>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetVaultItemRequest {
#[prost(string, tag = "1")]
pub item_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub vault_id: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetVaultItemResponse {
#[prost(message, optional, tag = "1")]
pub item: ::core::option::Option<::prost_types::Struct>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVariableRequest {
#[prost(message, optional, tag = "1")]
pub variable: ::core::option::Option<Variable>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVariableResponse {
#[prost(message, optional, tag = "1")]
pub value: ::core::option::Option<::prost_types::Struct>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetVariableRequest {
#[prost(message, optional, tag = "1")]
pub variable: ::core::option::Option<Variable>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<::prost_types::Struct>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRobotInfoResponse {
#[prost(message, optional, tag = "1")]
pub robot: ::core::option::Option<::prost_types::Struct>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppRequestRequest {
#[prost(bytes = "vec", tag = "1")]
pub request: ::prost::alloc::vec::Vec<u8>,
#[prost(int32, tag = "2")]
pub timeout: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppRequestResponse {
#[prost(bytes = "vec", tag = "1")]
pub response: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppRequestV2Request {
#[prost(bytes = "vec", tag = "1")]
pub request: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppRequestV2Response {
#[prost(bytes = "vec", tag = "1")]
pub response: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppPublishRequest {
#[prost(bytes = "vec", tag = "1")]
pub request: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppDownloadRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub directory: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub file: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppDownloadResponse {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppUploadRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppUploadResponse {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GatewayRequestRequest {
#[prost(string, tag = "1")]
pub method: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub endpoint: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub body: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "4")]
pub headers: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GatewayRequestResponse {
#[prost(int32, tag = "1")]
pub status_code: i32,
#[prost(bytes = "vec", tag = "2")]
pub body: ::prost::alloc::vec::Vec<u8>,
#[prost(map = "string, string", tag = "3")]
pub headers: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpRequest {
#[prost(string, tag = "1")]
pub method: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub url: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub headers: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bytes = "vec", tag = "4")]
pub body: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HttpResponse {
#[prost(int32, tag = "1")]
pub status_code: i32,
#[prost(bytes = "vec", tag = "2")]
pub body: ::prost::alloc::vec::Vec<u8>,
#[prost(map = "string, string", tag = "3")]
pub headers: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct IsRunningResponse {
#[prost(bool, tag = "1")]
pub is_running: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPortConnectionsRequest {
#[prost(string, tag = "1")]
pub guid: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub port: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeInfo {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPortConnectionsResponse {
#[prost(message, repeated, tag = "1")]
pub nodes: ::prost::alloc::vec::Vec<NodeInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInstanceAccessResponse {
#[prost(string, tag = "1")]
pub amq_endpoint: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub api_endpoint: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub access_token: ::prost::alloc::string::String,
}
pub mod node_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 NodeClient<T> {
inner: tonic::client::Grpc<T>,
}
impl NodeClient<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> NodeClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> NodeClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
NodeClient::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 init(
&mut self,
request: impl tonic::IntoRequest<super::InitRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Node/Init");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Node", "Init"));
self.inner.unary(req, path, codec).await
}
pub async fn on_create(
&mut self,
request: impl tonic::IntoRequest<super::OnCreateRequest>,
) -> std::result::Result<
tonic::Response<super::OnCreateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Node/OnCreate");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Node", "OnCreate"));
self.inner.unary(req, path, codec).await
}
pub async fn on_message(
&mut self,
request: impl tonic::IntoRequest<super::OnMessageRequest>,
) -> std::result::Result<
tonic::Response<super::OnMessageResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Node/OnMessage");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Node", "OnMessage"));
self.inner.unary(req, path, codec).await
}
pub async fn on_close(
&mut self,
request: impl tonic::IntoRequest<super::OnCloseRequest>,
) -> std::result::Result<
tonic::Response<super::OnCloseResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Node/OnClose");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Node", "OnClose"));
self.inner.unary(req, path, codec).await
}
pub async fn get_capabilities(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> std::result::Result<
tonic::Response<super::PGetCapabilitiesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Node/GetCapabilities",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.Node", "GetCapabilities"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod runtime_helper_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 RuntimeHelperClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RuntimeHelperClient<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> RuntimeHelperClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RuntimeHelperClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
RuntimeHelperClient::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 close(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/Close",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.RuntimeHelper", "Close"));
self.inner.unary(req, path, codec).await
}
pub async fn debug(
&mut self,
request: impl tonic::IntoRequest<super::DebugRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/Debug",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.RuntimeHelper", "Debug"));
self.inner.unary(req, path, codec).await
}
pub async fn emit_flow_event(
&mut self,
request: impl tonic::IntoRequest<super::EmitFlowEventRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/EmitFlowEvent",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "EmitFlowEvent"));
self.inner.unary(req, path, codec).await
}
pub async fn emit_input(
&mut self,
request: impl tonic::IntoRequest<super::EmitInputRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/EmitInput",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "EmitInput"));
self.inner.unary(req, path, codec).await
}
pub async fn emit_output(
&mut self,
request: impl tonic::IntoRequest<super::EmitOutputRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/EmitOutput",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "EmitOutput"));
self.inner.unary(req, path, codec).await
}
pub async fn emit_error(
&mut self,
request: impl tonic::IntoRequest<super::EmitErrorRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/EmitError",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "EmitError"));
self.inner.unary(req, path, codec).await
}
pub async fn get_vault_item(
&mut self,
request: impl tonic::IntoRequest<super::GetVaultItemRequest>,
) -> std::result::Result<
tonic::Response<super::GetVaultItemResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/GetVaultItem",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "GetVaultItem"));
self.inner.unary(req, path, codec).await
}
pub async fn set_vault_item(
&mut self,
request: impl tonic::IntoRequest<super::SetVaultItemRequest>,
) -> std::result::Result<
tonic::Response<super::SetVaultItemResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/SetVaultItem",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "SetVaultItem"));
self.inner.unary(req, path, codec).await
}
pub async fn get_variable(
&mut self,
request: impl tonic::IntoRequest<super::GetVariableRequest>,
) -> std::result::Result<
tonic::Response<super::GetVariableResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/GetVariable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "GetVariable"));
self.inner.unary(req, path, codec).await
}
pub async fn set_variable(
&mut self,
request: impl tonic::IntoRequest<super::SetVariableRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/SetVariable",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "SetVariable"));
self.inner.unary(req, path, codec).await
}
pub async fn get_robot_info(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> std::result::Result<
tonic::Response<super::GetRobotInfoResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/GetRobotInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "GetRobotInfo"));
self.inner.unary(req, path, codec).await
}
pub async fn app_request(
&mut self,
request: impl tonic::IntoRequest<super::AppRequestRequest>,
) -> std::result::Result<
tonic::Response<super::AppRequestResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/AppRequest",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "AppRequest"));
self.inner.unary(req, path, codec).await
}
pub async fn app_request_v2(
&mut self,
request: impl tonic::IntoRequest<super::AppRequestV2Request>,
) -> std::result::Result<
tonic::Response<super::AppRequestV2Response>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/AppRequestV2",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "AppRequestV2"));
self.inner.unary(req, path, codec).await
}
pub async fn app_publish(
&mut self,
request: impl tonic::IntoRequest<super::AppPublishRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/AppPublish",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "AppPublish"));
self.inner.unary(req, path, codec).await
}
pub async fn app_download(
&mut self,
request: impl tonic::IntoRequest<super::AppDownloadRequest>,
) -> std::result::Result<
tonic::Response<super::AppDownloadResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/AppDownload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "AppDownload"));
self.inner.unary(req, path, codec).await
}
pub async fn app_upload(
&mut self,
request: impl tonic::IntoRequest<super::AppUploadRequest>,
) -> std::result::Result<
tonic::Response<super::AppUploadResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/AppUpload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "AppUpload"));
self.inner.unary(req, path, codec).await
}
pub async fn gateway_request(
&mut self,
request: impl tonic::IntoRequest<super::GatewayRequestRequest>,
) -> std::result::Result<
tonic::Response<super::GatewayRequestResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/GatewayRequest",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "GatewayRequest"));
self.inner.unary(req, path, codec).await
}
pub async fn proxy_request(
&mut self,
request: impl tonic::IntoRequest<super::HttpRequest>,
) -> std::result::Result<tonic::Response<super::HttpResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/ProxyRequest",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "ProxyRequest"));
self.inner.unary(req, path, codec).await
}
pub async fn is_running(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> std::result::Result<
tonic::Response<super::IsRunningResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/IsRunning",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "IsRunning"));
self.inner.unary(req, path, codec).await
}
pub async fn get_port_connections(
&mut self,
request: impl tonic::IntoRequest<super::GetPortConnectionsRequest>,
) -> std::result::Result<
tonic::Response<super::GetPortConnectionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/GetPortConnections",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "GetPortConnections"));
self.inner.unary(req, path, codec).await
}
pub async fn get_instance_access(
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> std::result::Result<
tonic::Response<super::GetInstanceAccessResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.RuntimeHelper/GetInstanceAccess",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.RuntimeHelper", "GetInstanceAccess"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod node_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Node: std::marker::Send + std::marker::Sync + 'static {
async fn init(
&self,
request: tonic::Request<super::InitRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn on_create(
&self,
request: tonic::Request<super::OnCreateRequest>,
) -> std::result::Result<
tonic::Response<super::OnCreateResponse>,
tonic::Status,
>;
async fn on_message(
&self,
request: tonic::Request<super::OnMessageRequest>,
) -> std::result::Result<
tonic::Response<super::OnMessageResponse>,
tonic::Status,
>;
async fn on_close(
&self,
request: tonic::Request<super::OnCloseRequest>,
) -> std::result::Result<tonic::Response<super::OnCloseResponse>, tonic::Status>;
async fn get_capabilities(
&self,
request: tonic::Request<super::Empty>,
) -> std::result::Result<
tonic::Response<super::PGetCapabilitiesResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct NodeServer<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> NodeServer<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 NodeServer<T>
where
T: Node,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/proto.Node/Init" => {
#[allow(non_camel_case_types)]
struct InitSvc<T: Node>(pub Arc<T>);
impl<T: Node> tonic::server::UnaryService<super::InitRequest>
for InitSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InitRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Node>::init(&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 = InitSvc(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)
}
"/proto.Node/OnCreate" => {
#[allow(non_camel_case_types)]
struct OnCreateSvc<T: Node>(pub Arc<T>);
impl<T: Node> tonic::server::UnaryService<super::OnCreateRequest>
for OnCreateSvc<T> {
type Response = super::OnCreateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::OnCreateRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Node>::on_create(&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 = OnCreateSvc(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)
}
"/proto.Node/OnMessage" => {
#[allow(non_camel_case_types)]
struct OnMessageSvc<T: Node>(pub Arc<T>);
impl<T: Node> tonic::server::UnaryService<super::OnMessageRequest>
for OnMessageSvc<T> {
type Response = super::OnMessageResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::OnMessageRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Node>::on_message(&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 = OnMessageSvc(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)
}
"/proto.Node/OnClose" => {
#[allow(non_camel_case_types)]
struct OnCloseSvc<T: Node>(pub Arc<T>);
impl<T: Node> tonic::server::UnaryService<super::OnCloseRequest>
for OnCloseSvc<T> {
type Response = super::OnCloseResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::OnCloseRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Node>::on_close(&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 = OnCloseSvc(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)
}
"/proto.Node/GetCapabilities" => {
#[allow(non_camel_case_types)]
struct GetCapabilitiesSvc<T: Node>(pub Arc<T>);
impl<T: Node> tonic::server::UnaryService<super::Empty>
for GetCapabilitiesSvc<T> {
type Response = super::PGetCapabilitiesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Empty>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Node>::get_capabilities(&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 = GetCapabilitiesSvc(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 {
let mut response = http::Response::new(empty_body());
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 NodeServer<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 = "proto.Node";
impl<T> tonic::server::NamedService for NodeServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod runtime_helper_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait RuntimeHelper: std::marker::Send + std::marker::Sync + 'static {
async fn close(
&self,
request: tonic::Request<super::Empty>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn debug(
&self,
request: tonic::Request<super::DebugRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn emit_flow_event(
&self,
request: tonic::Request<super::EmitFlowEventRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn emit_input(
&self,
request: tonic::Request<super::EmitInputRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn emit_output(
&self,
request: tonic::Request<super::EmitOutputRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn emit_error(
&self,
request: tonic::Request<super::EmitErrorRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn get_vault_item(
&self,
request: tonic::Request<super::GetVaultItemRequest>,
) -> std::result::Result<
tonic::Response<super::GetVaultItemResponse>,
tonic::Status,
>;
async fn set_vault_item(
&self,
request: tonic::Request<super::SetVaultItemRequest>,
) -> std::result::Result<
tonic::Response<super::SetVaultItemResponse>,
tonic::Status,
>;
async fn get_variable(
&self,
request: tonic::Request<super::GetVariableRequest>,
) -> std::result::Result<
tonic::Response<super::GetVariableResponse>,
tonic::Status,
>;
async fn set_variable(
&self,
request: tonic::Request<super::SetVariableRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn get_robot_info(
&self,
request: tonic::Request<super::Empty>,
) -> std::result::Result<
tonic::Response<super::GetRobotInfoResponse>,
tonic::Status,
>;
async fn app_request(
&self,
request: tonic::Request<super::AppRequestRequest>,
) -> std::result::Result<
tonic::Response<super::AppRequestResponse>,
tonic::Status,
>;
async fn app_request_v2(
&self,
request: tonic::Request<super::AppRequestV2Request>,
) -> std::result::Result<
tonic::Response<super::AppRequestV2Response>,
tonic::Status,
>;
async fn app_publish(
&self,
request: tonic::Request<super::AppPublishRequest>,
) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
async fn app_download(
&self,
request: tonic::Request<super::AppDownloadRequest>,
) -> std::result::Result<
tonic::Response<super::AppDownloadResponse>,
tonic::Status,
>;
async fn app_upload(
&self,
request: tonic::Request<super::AppUploadRequest>,
) -> std::result::Result<
tonic::Response<super::AppUploadResponse>,
tonic::Status,
>;
async fn gateway_request(
&self,
request: tonic::Request<super::GatewayRequestRequest>,
) -> std::result::Result<
tonic::Response<super::GatewayRequestResponse>,
tonic::Status,
>;
async fn proxy_request(
&self,
request: tonic::Request<super::HttpRequest>,
) -> std::result::Result<tonic::Response<super::HttpResponse>, tonic::Status>;
async fn is_running(
&self,
request: tonic::Request<super::Empty>,
) -> std::result::Result<
tonic::Response<super::IsRunningResponse>,
tonic::Status,
>;
async fn get_port_connections(
&self,
request: tonic::Request<super::GetPortConnectionsRequest>,
) -> std::result::Result<
tonic::Response<super::GetPortConnectionsResponse>,
tonic::Status,
>;
async fn get_instance_access(
&self,
request: tonic::Request<super::Empty>,
) -> std::result::Result<
tonic::Response<super::GetInstanceAccessResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct RuntimeHelperServer<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> RuntimeHelperServer<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 RuntimeHelperServer<T>
where
T: RuntimeHelper,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/proto.RuntimeHelper/Close" => {
#[allow(non_camel_case_types)]
struct CloseSvc<T: RuntimeHelper>(pub Arc<T>);
impl<T: RuntimeHelper> tonic::server::UnaryService<super::Empty>
for CloseSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Empty>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::close(&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 = CloseSvc(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)
}
"/proto.RuntimeHelper/Debug" => {
#[allow(non_camel_case_types)]
struct DebugSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::DebugRequest> for DebugSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DebugRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::debug(&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 = DebugSvc(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)
}
"/proto.RuntimeHelper/EmitFlowEvent" => {
#[allow(non_camel_case_types)]
struct EmitFlowEventSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::EmitFlowEventRequest>
for EmitFlowEventSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::EmitFlowEventRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::emit_flow_event(&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 = EmitFlowEventSvc(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)
}
"/proto.RuntimeHelper/EmitInput" => {
#[allow(non_camel_case_types)]
struct EmitInputSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::EmitInputRequest>
for EmitInputSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::EmitInputRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::emit_input(&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 = EmitInputSvc(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)
}
"/proto.RuntimeHelper/EmitOutput" => {
#[allow(non_camel_case_types)]
struct EmitOutputSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::EmitOutputRequest>
for EmitOutputSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::EmitOutputRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::emit_output(&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 = EmitOutputSvc(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)
}
"/proto.RuntimeHelper/EmitError" => {
#[allow(non_camel_case_types)]
struct EmitErrorSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::EmitErrorRequest>
for EmitErrorSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::EmitErrorRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::emit_error(&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 = EmitErrorSvc(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)
}
"/proto.RuntimeHelper/GetVaultItem" => {
#[allow(non_camel_case_types)]
struct GetVaultItemSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::GetVaultItemRequest>
for GetVaultItemSvc<T> {
type Response = super::GetVaultItemResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetVaultItemRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::get_vault_item(&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 = GetVaultItemSvc(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)
}
"/proto.RuntimeHelper/SetVaultItem" => {
#[allow(non_camel_case_types)]
struct SetVaultItemSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::SetVaultItemRequest>
for SetVaultItemSvc<T> {
type Response = super::SetVaultItemResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetVaultItemRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::set_vault_item(&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 = SetVaultItemSvc(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)
}
"/proto.RuntimeHelper/GetVariable" => {
#[allow(non_camel_case_types)]
struct GetVariableSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::GetVariableRequest>
for GetVariableSvc<T> {
type Response = super::GetVariableResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetVariableRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::get_variable(&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 = GetVariableSvc(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)
}
"/proto.RuntimeHelper/SetVariable" => {
#[allow(non_camel_case_types)]
struct SetVariableSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::SetVariableRequest>
for SetVariableSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::SetVariableRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::set_variable(&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 = SetVariableSvc(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)
}
"/proto.RuntimeHelper/GetRobotInfo" => {
#[allow(non_camel_case_types)]
struct GetRobotInfoSvc<T: RuntimeHelper>(pub Arc<T>);
impl<T: RuntimeHelper> tonic::server::UnaryService<super::Empty>
for GetRobotInfoSvc<T> {
type Response = super::GetRobotInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Empty>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::get_robot_info(&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 = GetRobotInfoSvc(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)
}
"/proto.RuntimeHelper/AppRequest" => {
#[allow(non_camel_case_types)]
struct AppRequestSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::AppRequestRequest>
for AppRequestSvc<T> {
type Response = super::AppRequestResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AppRequestRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::app_request(&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 = AppRequestSvc(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)
}
"/proto.RuntimeHelper/AppRequestV2" => {
#[allow(non_camel_case_types)]
struct AppRequestV2Svc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::AppRequestV2Request>
for AppRequestV2Svc<T> {
type Response = super::AppRequestV2Response;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AppRequestV2Request>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::app_request_v2(&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 = AppRequestV2Svc(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)
}
"/proto.RuntimeHelper/AppPublish" => {
#[allow(non_camel_case_types)]
struct AppPublishSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::AppPublishRequest>
for AppPublishSvc<T> {
type Response = super::Empty;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AppPublishRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::app_publish(&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 = AppPublishSvc(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)
}
"/proto.RuntimeHelper/AppDownload" => {
#[allow(non_camel_case_types)]
struct AppDownloadSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::AppDownloadRequest>
for AppDownloadSvc<T> {
type Response = super::AppDownloadResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AppDownloadRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::app_download(&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 = AppDownloadSvc(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)
}
"/proto.RuntimeHelper/AppUpload" => {
#[allow(non_camel_case_types)]
struct AppUploadSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::AppUploadRequest>
for AppUploadSvc<T> {
type Response = super::AppUploadResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AppUploadRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::app_upload(&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 = AppUploadSvc(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)
}
"/proto.RuntimeHelper/GatewayRequest" => {
#[allow(non_camel_case_types)]
struct GatewayRequestSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::GatewayRequestRequest>
for GatewayRequestSvc<T> {
type Response = super::GatewayRequestResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GatewayRequestRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::gateway_request(&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 = GatewayRequestSvc(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)
}
"/proto.RuntimeHelper/ProxyRequest" => {
#[allow(non_camel_case_types)]
struct ProxyRequestSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::HttpRequest>
for ProxyRequestSvc<T> {
type Response = super::HttpResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::HttpRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::proxy_request(&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 = ProxyRequestSvc(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)
}
"/proto.RuntimeHelper/IsRunning" => {
#[allow(non_camel_case_types)]
struct IsRunningSvc<T: RuntimeHelper>(pub Arc<T>);
impl<T: RuntimeHelper> tonic::server::UnaryService<super::Empty>
for IsRunningSvc<T> {
type Response = super::IsRunningResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Empty>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::is_running(&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 = IsRunningSvc(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)
}
"/proto.RuntimeHelper/GetPortConnections" => {
#[allow(non_camel_case_types)]
struct GetPortConnectionsSvc<T: RuntimeHelper>(pub Arc<T>);
impl<
T: RuntimeHelper,
> tonic::server::UnaryService<super::GetPortConnectionsRequest>
for GetPortConnectionsSvc<T> {
type Response = super::GetPortConnectionsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetPortConnectionsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::get_port_connections(&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 = GetPortConnectionsSvc(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)
}
"/proto.RuntimeHelper/GetInstanceAccess" => {
#[allow(non_camel_case_types)]
struct GetInstanceAccessSvc<T: RuntimeHelper>(pub Arc<T>);
impl<T: RuntimeHelper> tonic::server::UnaryService<super::Empty>
for GetInstanceAccessSvc<T> {
type Response = super::GetInstanceAccessResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Empty>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as RuntimeHelper>::get_instance_access(&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 = GetInstanceAccessSvc(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 {
let mut response = http::Response::new(empty_body());
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 RuntimeHelperServer<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 = "proto.RuntimeHelper";
impl<T> tonic::server::NamedService for RuntimeHelperServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Null {}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Nil {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitRunnerRequest {
#[prost(string, tag = "1")]
pub api_url: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub token: ::prost::alloc::string::String,
#[prost(uint32, tag = "3")]
pub robot_server: u32,
#[prost(uint32, tag = "4")]
pub nats_port: u32,
#[prost(string, tag = "5")]
pub robot_name: ::prost::alloc::string::String,
#[prost(bool, tag = "6")]
pub send_crash: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunRequest {
#[prost(string, tag = "1")]
pub repoid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub repository: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub version: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RobotNameResponse {
#[prost(string, tag = "1")]
pub robot_name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetCapabilitiesResponse {
#[prost(uint64, tag = "1")]
pub capabilities: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttachRequest {
#[prost(bytes = "vec", tag = "1")]
pub config: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DetachRequest {
#[prost(string, tag = "1")]
pub namespace: ::prost::alloc::string::String,
}
pub mod runner_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 RunnerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RunnerClient<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> RunnerClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RunnerClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
RunnerClient::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 init(
&mut self,
request: impl tonic::IntoRequest<super::InitRunnerRequest>,
) -> std::result::Result<tonic::Response<super::Null>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Runner/Init");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Runner", "Init"));
self.inner.unary(req, path, codec).await
}
pub async fn run(
&mut self,
request: impl tonic::IntoRequest<super::RunRequest>,
) -> std::result::Result<tonic::Response<super::Null>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Runner/Run");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Runner", "Run"));
self.inner.unary(req, path, codec).await
}
pub async fn clear(
&mut self,
request: impl tonic::IntoRequest<super::Null>,
) -> std::result::Result<tonic::Response<super::Null>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Runner/Clear");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Runner", "Clear"));
self.inner.unary(req, path, codec).await
}
pub async fn robot_name(
&mut self,
request: impl tonic::IntoRequest<super::Null>,
) -> std::result::Result<
tonic::Response<super::RobotNameResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Runner/RobotName");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Runner", "RobotName"));
self.inner.unary(req, path, codec).await
}
pub async fn get_capabilities(
&mut self,
request: impl tonic::IntoRequest<super::Null>,
) -> std::result::Result<
tonic::Response<super::GetCapabilitiesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/proto.Runner/GetCapabilities",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("proto.Runner", "GetCapabilities"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod robot_helper_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 RobotHelperClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RobotHelperClient<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> RobotHelperClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RobotHelperClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
RobotHelperClient::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 mod debug_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 DebugClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DebugClient<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> DebugClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> DebugClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
DebugClient::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 attach(
&mut self,
request: impl tonic::IntoRequest<super::AttachRequest>,
) -> std::result::Result<tonic::Response<super::Nil>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Debug/Attach");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Debug", "Attach"));
self.inner.unary(req, path, codec).await
}
pub async fn detach(
&mut self,
request: impl tonic::IntoRequest<super::DetachRequest>,
) -> std::result::Result<tonic::Response<super::Nil>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/proto.Debug/Detach");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new("proto.Debug", "Detach"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod runner_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Runner: std::marker::Send + std::marker::Sync + 'static {
async fn init(
&self,
request: tonic::Request<super::InitRunnerRequest>,
) -> std::result::Result<tonic::Response<super::Null>, tonic::Status>;
async fn run(
&self,
request: tonic::Request<super::RunRequest>,
) -> std::result::Result<tonic::Response<super::Null>, tonic::Status>;
async fn clear(
&self,
request: tonic::Request<super::Null>,
) -> std::result::Result<tonic::Response<super::Null>, tonic::Status>;
async fn robot_name(
&self,
request: tonic::Request<super::Null>,
) -> std::result::Result<
tonic::Response<super::RobotNameResponse>,
tonic::Status,
>;
async fn get_capabilities(
&self,
request: tonic::Request<super::Null>,
) -> std::result::Result<
tonic::Response<super::GetCapabilitiesResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct RunnerServer<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> RunnerServer<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 RunnerServer<T>
where
T: Runner,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/proto.Runner/Init" => {
#[allow(non_camel_case_types)]
struct InitSvc<T: Runner>(pub Arc<T>);
impl<T: Runner> tonic::server::UnaryService<super::InitRunnerRequest>
for InitSvc<T> {
type Response = super::Null;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::InitRunnerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Runner>::init(&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 = InitSvc(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)
}
"/proto.Runner/Run" => {
#[allow(non_camel_case_types)]
struct RunSvc<T: Runner>(pub Arc<T>);
impl<T: Runner> tonic::server::UnaryService<super::RunRequest>
for RunSvc<T> {
type Response = super::Null;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RunRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Runner>::run(&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 = RunSvc(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)
}
"/proto.Runner/Clear" => {
#[allow(non_camel_case_types)]
struct ClearSvc<T: Runner>(pub Arc<T>);
impl<T: Runner> tonic::server::UnaryService<super::Null>
for ClearSvc<T> {
type Response = super::Null;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Null>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Runner>::clear(&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 = ClearSvc(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)
}
"/proto.Runner/RobotName" => {
#[allow(non_camel_case_types)]
struct RobotNameSvc<T: Runner>(pub Arc<T>);
impl<T: Runner> tonic::server::UnaryService<super::Null>
for RobotNameSvc<T> {
type Response = super::RobotNameResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Null>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Runner>::robot_name(&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 = RobotNameSvc(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)
}
"/proto.Runner/GetCapabilities" => {
#[allow(non_camel_case_types)]
struct GetCapabilitiesSvc<T: Runner>(pub Arc<T>);
impl<T: Runner> tonic::server::UnaryService<super::Null>
for GetCapabilitiesSvc<T> {
type Response = super::GetCapabilitiesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::Null>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Runner>::get_capabilities(&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 = GetCapabilitiesSvc(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 {
let mut response = http::Response::new(empty_body());
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 RunnerServer<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 = "proto.Runner";
impl<T> tonic::server::NamedService for RunnerServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod robot_helper_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait RobotHelper: std::marker::Send + std::marker::Sync + 'static {}
#[derive(Debug)]
pub struct RobotHelperServer<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> RobotHelperServer<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 RobotHelperServer<T>
where
T: RobotHelper,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
_ => {
Box::pin(async move {
let mut response = http::Response::new(empty_body());
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 RobotHelperServer<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 = "proto.RobotHelper";
impl<T> tonic::server::NamedService for RobotHelperServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod debug_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Debug: std::marker::Send + std::marker::Sync + 'static {
async fn attach(
&self,
request: tonic::Request<super::AttachRequest>,
) -> std::result::Result<tonic::Response<super::Nil>, tonic::Status>;
async fn detach(
&self,
request: tonic::Request<super::DetachRequest>,
) -> std::result::Result<tonic::Response<super::Nil>, tonic::Status>;
}
#[derive(Debug)]
pub struct DebugServer<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> DebugServer<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 DebugServer<T>
where
T: Debug,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/proto.Debug/Attach" => {
#[allow(non_camel_case_types)]
struct AttachSvc<T: Debug>(pub Arc<T>);
impl<T: Debug> tonic::server::UnaryService<super::AttachRequest>
for AttachSvc<T> {
type Response = super::Nil;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AttachRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Debug>::attach(&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 = AttachSvc(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)
}
"/proto.Debug/Detach" => {
#[allow(non_camel_case_types)]
struct DetachSvc<T: Debug>(pub Arc<T>);
impl<T: Debug> tonic::server::UnaryService<super::DetachRequest>
for DetachSvc<T> {
type Response = super::Nil;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DetachRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Debug>::detach(&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 = DetachSvc(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 {
let mut response = http::Response::new(empty_body());
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 DebugServer<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 = "proto.Debug";
impl<T> tonic::server::NamedService for DebugServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}