wick_rpc/generated/
wick.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct InvocationRequest {
4  #[prost(oneof = "invocation_request::Data", tags = "1, 2")]
5  pub data: ::core::option::Option<invocation_request::Data>,
6}
7/// Nested message and enum types in `InvocationRequest`.
8pub mod invocation_request {
9  #[allow(clippy::derive_partial_eq_without_eq)]
10  #[derive(Clone, PartialEq, ::prost::Oneof)]
11  pub enum Data {
12    #[prost(message, tag = "1")]
13    Invocation(super::Invocation),
14    #[prost(message, tag = "2")]
15    Packet(super::Packet),
16  }
17}
18#[allow(clippy::derive_partial_eq_without_eq)]
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct Invocation {
21  #[prost(string, tag = "1")]
22  pub origin: ::prost::alloc::string::String,
23  #[prost(string, tag = "2")]
24  pub target: ::prost::alloc::string::String,
25  #[prost(string, tag = "4")]
26  pub id: ::prost::alloc::string::String,
27  #[prost(string, tag = "5")]
28  pub tx_id: ::prost::alloc::string::String,
29  #[prost(message, optional, tag = "6")]
30  pub inherent: ::core::option::Option<InherentData>,
31}
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct Packet {
35  #[prost(message, optional, tag = "1")]
36  pub metadata: ::core::option::Option<Metadata>,
37  #[prost(oneof = "packet::Data", tags = "2, 3")]
38  pub data: ::core::option::Option<packet::Data>,
39}
40/// Nested message and enum types in `Packet`.
41pub mod packet {
42  #[allow(clippy::derive_partial_eq_without_eq)]
43  #[derive(Clone, PartialEq, ::prost::Oneof)]
44  pub enum Data {
45    #[prost(message, tag = "2")]
46    Ok(super::Ok),
47    #[prost(message, tag = "3")]
48    Err(super::Err),
49  }
50}
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct Metadata {
54  #[prost(string, tag = "1")]
55  pub port: ::prost::alloc::string::String,
56  #[prost(uint32, tag = "2")]
57  pub index: u32,
58  #[prost(uint32, tag = "3")]
59  pub flags: u32,
60}
61#[allow(clippy::derive_partial_eq_without_eq)]
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct Ok {
64  #[prost(oneof = "ok::Data", tags = "1, 3")]
65  pub data: ::core::option::Option<ok::Data>,
66}
67/// Nested message and enum types in `Ok`.
68pub mod ok {
69  #[allow(clippy::derive_partial_eq_without_eq)]
70  #[derive(Clone, PartialEq, ::prost::Oneof)]
71  pub enum Data {
72    #[prost(bytes, tag = "1")]
73    Messagepack(::prost::alloc::vec::Vec<u8>),
74    #[prost(string, tag = "3")]
75    Json(::prost::alloc::string::String),
76  }
77}
78#[allow(clippy::derive_partial_eq_without_eq)]
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct Err {
81  #[prost(string, tag = "1")]
82  pub message: ::prost::alloc::string::String,
83  #[prost(uint32, tag = "2")]
84  pub code: u32,
85}
86#[allow(clippy::derive_partial_eq_without_eq)]
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct InherentData {
89  #[prost(uint64, tag = "1")]
90  pub seed: u64,
91  #[prost(uint64, tag = "2")]
92  pub timestamp: u64,
93}
94#[allow(clippy::derive_partial_eq_without_eq)]
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct ListRequest {}
97#[allow(clippy::derive_partial_eq_without_eq)]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct ListResponse {
100  #[prost(message, repeated, tag = "1")]
101  pub components: ::prost::alloc::vec::Vec<ComponentSignature>,
102}
103#[allow(clippy::derive_partial_eq_without_eq)]
104#[derive(Clone, PartialEq, ::prost::Message)]
105pub struct Operation {
106  #[prost(string, tag = "1")]
107  pub name: ::prost::alloc::string::String,
108  #[prost(enumeration = "operation::OperationKind", tag = "2")]
109  pub kind: i32,
110  #[prost(message, repeated, tag = "5")]
111  pub config: ::prost::alloc::vec::Vec<Field>,
112  #[prost(message, repeated, tag = "3")]
113  pub inputs: ::prost::alloc::vec::Vec<Field>,
114  #[prost(message, repeated, tag = "4")]
115  pub outputs: ::prost::alloc::vec::Vec<Field>,
116}
117/// Nested message and enum types in `Operation`.
118pub mod operation {
119  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
120  #[repr(i32)]
121  pub enum OperationKind {
122    Operation = 0,
123    Schematic = 1,
124  }
125  impl OperationKind {
126    /// String value of the enum field names used in the ProtoBuf definition.
127    ///
128    /// The values are not transformed in any way and thus are considered stable
129    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
130    pub fn as_str_name(&self) -> &'static str {
131      match self {
132        OperationKind::Operation => "Operation",
133        OperationKind::Schematic => "Schematic",
134      }
135    }
136    /// Creates an enum from field names used in the ProtoBuf definition.
137    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
138      match value {
139        "Operation" => Some(Self::Operation),
140        "Schematic" => Some(Self::Schematic),
141        _ => None,
142      }
143    }
144  }
145}
146#[allow(clippy::derive_partial_eq_without_eq)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct Field {
149  #[prost(string, tag = "1")]
150  pub name: ::prost::alloc::string::String,
151  #[prost(message, optional, tag = "2")]
152  pub r#type: ::core::option::Option<TypeSignature>,
153  #[prost(string, tag = "3")]
154  pub description: ::prost::alloc::string::String,
155}
156#[allow(clippy::derive_partial_eq_without_eq)]
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct ComponentSignature {
159  #[prost(string, tag = "1")]
160  pub name: ::prost::alloc::string::String,
161  #[prost(uint32, tag = "2")]
162  pub format: u32,
163  #[prost(message, optional, tag = "8")]
164  pub metadata: ::core::option::Option<ComponentMetadata>,
165  #[prost(message, repeated, tag = "3")]
166  pub operations: ::prost::alloc::vec::Vec<Operation>,
167  #[prost(message, repeated, tag = "4")]
168  pub types: ::prost::alloc::vec::Vec<TypeDefinition>,
169  #[prost(message, repeated, tag = "5")]
170  pub config: ::prost::alloc::vec::Vec<Field>,
171  #[prost(message, repeated, tag = "7")]
172  pub wellknown: ::prost::alloc::vec::Vec<WellKnownSchema>,
173}
174#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct ComponentMetadata {
177  #[prost(string, optional, tag = "2")]
178  pub version: ::core::option::Option<::prost::alloc::string::String>,
179}
180#[allow(clippy::derive_partial_eq_without_eq)]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct TypeDefinition {
183  #[prost(oneof = "type_definition::Type", tags = "1, 2, 3")]
184  pub r#type: ::core::option::Option<type_definition::Type>,
185}
186/// Nested message and enum types in `TypeDefinition`.
187pub mod type_definition {
188  #[allow(clippy::derive_partial_eq_without_eq)]
189  #[derive(Clone, PartialEq, ::prost::Oneof)]
190  pub enum Type {
191    #[prost(message, tag = "1")]
192    Struct(super::StructSignature),
193    #[prost(message, tag = "2")]
194    Enum(super::EnumSignature),
195    #[prost(message, tag = "3")]
196    Union(super::UnionSignature),
197  }
198}
199#[allow(clippy::derive_partial_eq_without_eq)]
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct WellKnownSchema {
202  #[prost(string, repeated, tag = "1")]
203  pub capabilities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
204  #[prost(string, tag = "2")]
205  pub url: ::prost::alloc::string::String,
206  #[prost(message, optional, tag = "3")]
207  pub schema: ::core::option::Option<ComponentSignature>,
208}
209#[allow(clippy::derive_partial_eq_without_eq)]
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct StatsRequest {}
212#[allow(clippy::derive_partial_eq_without_eq)]
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct StatsResponse {
215  #[prost(message, repeated, tag = "1")]
216  pub stats: ::prost::alloc::vec::Vec<Statistic>,
217}
218#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct Statistic {
221  #[prost(string, tag = "1")]
222  pub name: ::prost::alloc::string::String,
223  #[prost(uint32, tag = "2")]
224  pub runs: u32,
225  #[prost(uint32, tag = "3")]
226  pub errors: u32,
227  #[prost(message, optional, tag = "4")]
228  pub execution_statistics: ::core::option::Option<DurationStatistics>,
229}
230#[allow(clippy::derive_partial_eq_without_eq)]
231#[derive(Clone, PartialEq, ::prost::Message)]
232pub struct DurationStatistics {
233  #[prost(uint64, tag = "1")]
234  pub min: u64,
235  #[prost(uint64, tag = "2")]
236  pub max: u64,
237  #[prost(uint64, tag = "3")]
238  pub average: u64,
239  #[prost(uint64, tag = "4")]
240  pub total: u64,
241}
242#[allow(clippy::derive_partial_eq_without_eq)]
243#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct StructSignature {
245  #[prost(string, tag = "1")]
246  pub name: ::prost::alloc::string::String,
247  #[prost(message, repeated, tag = "2")]
248  pub fields: ::prost::alloc::vec::Vec<Field>,
249  #[prost(string, tag = "3")]
250  pub description: ::prost::alloc::string::String,
251}
252#[allow(clippy::derive_partial_eq_without_eq)]
253#[derive(Clone, PartialEq, ::prost::Message)]
254pub struct EnumSignature {
255  #[prost(string, tag = "1")]
256  pub name: ::prost::alloc::string::String,
257  #[prost(message, repeated, tag = "2")]
258  pub values: ::prost::alloc::vec::Vec<EnumVariant>,
259  #[prost(string, tag = "3")]
260  pub description: ::prost::alloc::string::String,
261}
262#[allow(clippy::derive_partial_eq_without_eq)]
263#[derive(Clone, PartialEq, ::prost::Message)]
264pub struct UnionSignature {
265  #[prost(string, tag = "1")]
266  pub name: ::prost::alloc::string::String,
267  #[prost(message, repeated, tag = "2")]
268  pub types: ::prost::alloc::vec::Vec<TypeSignature>,
269  #[prost(string, tag = "3")]
270  pub description: ::prost::alloc::string::String,
271}
272#[allow(clippy::derive_partial_eq_without_eq)]
273#[derive(Clone, PartialEq, ::prost::Message)]
274pub struct EnumVariant {
275  #[prost(string, tag = "1")]
276  pub name: ::prost::alloc::string::String,
277  #[prost(uint32, optional, tag = "2")]
278  pub index: ::core::option::Option<u32>,
279  #[prost(string, optional, tag = "3")]
280  pub value: ::core::option::Option<::prost::alloc::string::String>,
281  #[prost(string, tag = "4")]
282  pub description: ::prost::alloc::string::String,
283}
284#[allow(clippy::derive_partial_eq_without_eq)]
285#[derive(Clone, PartialEq, ::prost::Message)]
286pub struct TypeSignature {
287  #[prost(oneof = "type_signature::Signature", tags = "1, 2, 3, 4, 10, 11")]
288  pub signature: ::core::option::Option<type_signature::Signature>,
289}
290/// Nested message and enum types in `TypeSignature`.
291pub mod type_signature {
292  #[allow(clippy::derive_partial_eq_without_eq)]
293  #[derive(Clone, PartialEq, ::prost::Oneof)]
294  pub enum Signature {
295    #[prost(message, tag = "1")]
296    Simple(super::SimpleType),
297    #[prost(message, tag = "2")]
298    Map(::prost::alloc::boxed::Box<super::MapType>),
299    #[prost(message, tag = "3")]
300    List(::prost::alloc::boxed::Box<super::InnerType>),
301    #[prost(message, tag = "4")]
302    Optional(::prost::alloc::boxed::Box<super::InnerType>),
303    #[prost(message, tag = "10")]
304    AnonymousStruct(super::AnonymousStruct),
305    #[prost(string, tag = "11")]
306    Named(::prost::alloc::string::String),
307  }
308}
309#[allow(clippy::derive_partial_eq_without_eq)]
310#[derive(Clone, PartialEq, ::prost::Message)]
311pub struct AnonymousStruct {
312  #[prost(message, repeated, tag = "1")]
313  pub fields: ::prost::alloc::vec::Vec<Field>,
314}
315#[allow(clippy::derive_partial_eq_without_eq)]
316#[derive(Clone, PartialEq, ::prost::Message)]
317pub struct SimpleType {
318  #[prost(enumeration = "simple_type::PrimitiveType", tag = "1")]
319  pub r#type: i32,
320}
321/// Nested message and enum types in `SimpleType`.
322pub mod simple_type {
323  #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
324  #[repr(i32)]
325  pub enum PrimitiveType {
326    I8 = 0,
327    U8 = 1,
328    I16 = 2,
329    U16 = 3,
330    I32 = 4,
331    U32 = 5,
332    I64 = 6,
333    U64 = 7,
334    F32 = 8,
335    F64 = 9,
336    Bool = 10,
337    String = 11,
338    Datetime = 12,
339    Bytes = 13,
340    Object = 15,
341  }
342  impl PrimitiveType {
343    /// String value of the enum field names used in the ProtoBuf definition.
344    ///
345    /// The values are not transformed in any way and thus are considered stable
346    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
347    pub fn as_str_name(&self) -> &'static str {
348      match self {
349        PrimitiveType::I8 => "I8",
350        PrimitiveType::U8 => "U8",
351        PrimitiveType::I16 => "I16",
352        PrimitiveType::U16 => "U16",
353        PrimitiveType::I32 => "I32",
354        PrimitiveType::U32 => "U32",
355        PrimitiveType::I64 => "I64",
356        PrimitiveType::U64 => "U64",
357        PrimitiveType::F32 => "F32",
358        PrimitiveType::F64 => "F64",
359        PrimitiveType::Bool => "BOOL",
360        PrimitiveType::String => "STRING",
361        PrimitiveType::Datetime => "DATETIME",
362        PrimitiveType::Bytes => "BYTES",
363        PrimitiveType::Object => "OBJECT",
364      }
365    }
366    /// Creates an enum from field names used in the ProtoBuf definition.
367    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
368      match value {
369        "I8" => Some(Self::I8),
370        "U8" => Some(Self::U8),
371        "I16" => Some(Self::I16),
372        "U16" => Some(Self::U16),
373        "I32" => Some(Self::I32),
374        "U32" => Some(Self::U32),
375        "I64" => Some(Self::I64),
376        "U64" => Some(Self::U64),
377        "F32" => Some(Self::F32),
378        "F64" => Some(Self::F64),
379        "BOOL" => Some(Self::Bool),
380        "STRING" => Some(Self::String),
381        "DATETIME" => Some(Self::Datetime),
382        "BYTES" => Some(Self::Bytes),
383        "OBJECT" => Some(Self::Object),
384        _ => None,
385      }
386    }
387  }
388}
389#[allow(clippy::derive_partial_eq_without_eq)]
390#[derive(Clone, PartialEq, ::prost::Message)]
391pub struct MapType {
392  #[prost(message, optional, boxed, tag = "1")]
393  pub key_type: ::core::option::Option<::prost::alloc::boxed::Box<TypeSignature>>,
394  #[prost(message, optional, boxed, tag = "2")]
395  pub value_type: ::core::option::Option<::prost::alloc::boxed::Box<TypeSignature>>,
396}
397#[allow(clippy::derive_partial_eq_without_eq)]
398#[derive(Clone, PartialEq, ::prost::Message)]
399pub struct InnerType {
400  #[prost(message, optional, boxed, tag = "1")]
401  pub r#type: ::core::option::Option<::prost::alloc::boxed::Box<TypeSignature>>,
402}
403/// Generated client implementations.
404pub mod invocation_service_client {
405  #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
406  use tonic::codegen::http::Uri;
407  use tonic::codegen::*;
408  #[derive(Debug, Clone)]
409  pub struct InvocationServiceClient<T> {
410    inner: tonic::client::Grpc<T>,
411  }
412  impl InvocationServiceClient<tonic::transport::Channel> {
413    /// Attempt to create a new client by connecting to a given endpoint.
414    pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
415    where
416      D: TryInto<tonic::transport::Endpoint>,
417      D::Error: Into<StdError>,
418    {
419      let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
420      Ok(Self::new(conn))
421    }
422  }
423  impl<T> InvocationServiceClient<T>
424  where
425    T: tonic::client::GrpcService<tonic::body::BoxBody>,
426    T::Error: Into<StdError>,
427    T::ResponseBody: Body<Data = Bytes> + Send + 'static,
428    <T::ResponseBody as Body>::Error: Into<StdError> + Send,
429  {
430    pub fn new(inner: T) -> Self {
431      let inner = tonic::client::Grpc::new(inner);
432      Self { inner }
433    }
434    pub fn with_origin(inner: T, origin: Uri) -> Self {
435      let inner = tonic::client::Grpc::with_origin(inner, origin);
436      Self { inner }
437    }
438    pub fn with_interceptor<F>(inner: T, interceptor: F) -> InvocationServiceClient<InterceptedService<T, F>>
439    where
440      F: tonic::service::Interceptor,
441      T::ResponseBody: Default,
442      T: tonic::codegen::Service<
443        http::Request<tonic::body::BoxBody>,
444        Response = http::Response<<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody>,
445      >,
446      <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: Into<StdError> + Send + Sync,
447    {
448      InvocationServiceClient::new(InterceptedService::new(inner, interceptor))
449    }
450    /// Compress requests with the given encoding.
451    ///
452    /// This requires the server to support it otherwise it might respond with an
453    /// error.
454    #[must_use]
455    pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
456      self.inner = self.inner.send_compressed(encoding);
457      self
458    }
459    /// Enable decompressing responses.
460    #[must_use]
461    pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
462      self.inner = self.inner.accept_compressed(encoding);
463      self
464    }
465    /// Limits the maximum size of a decoded message.
466    ///
467    /// Default: `4MB`
468    #[must_use]
469    pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
470      self.inner = self.inner.max_decoding_message_size(limit);
471      self
472    }
473    /// Limits the maximum size of an encoded message.
474    ///
475    /// Default: `usize::MAX`
476    #[must_use]
477    pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
478      self.inner = self.inner.max_encoding_message_size(limit);
479      self
480    }
481    pub async fn invoke(
482      &mut self,
483      request: impl tonic::IntoStreamingRequest<Message = super::InvocationRequest>,
484    ) -> std::result::Result<tonic::Response<tonic::codec::Streaming<super::Packet>>, tonic::Status> {
485      self
486        .inner
487        .ready()
488        .await
489        .map_err(|e| tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into())))?;
490      let codec = tonic::codec::ProstCodec::default();
491      let path = http::uri::PathAndQuery::from_static("/wick.InvocationService/Invoke");
492      let mut req = request.into_streaming_request();
493      req
494        .extensions_mut()
495        .insert(GrpcMethod::new("wick.InvocationService", "Invoke"));
496      self.inner.streaming(req, path, codec).await
497    }
498    pub async fn list(
499      &mut self,
500      request: impl tonic::IntoRequest<super::ListRequest>,
501    ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status> {
502      self
503        .inner
504        .ready()
505        .await
506        .map_err(|e| tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into())))?;
507      let codec = tonic::codec::ProstCodec::default();
508      let path = http::uri::PathAndQuery::from_static("/wick.InvocationService/List");
509      let mut req = request.into_request();
510      req
511        .extensions_mut()
512        .insert(GrpcMethod::new("wick.InvocationService", "List"));
513      self.inner.unary(req, path, codec).await
514    }
515    pub async fn stats(
516      &mut self,
517      request: impl tonic::IntoRequest<super::StatsRequest>,
518    ) -> std::result::Result<tonic::Response<super::StatsResponse>, tonic::Status> {
519      self
520        .inner
521        .ready()
522        .await
523        .map_err(|e| tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into())))?;
524      let codec = tonic::codec::ProstCodec::default();
525      let path = http::uri::PathAndQuery::from_static("/wick.InvocationService/Stats");
526      let mut req = request.into_request();
527      req
528        .extensions_mut()
529        .insert(GrpcMethod::new("wick.InvocationService", "Stats"));
530      self.inner.unary(req, path, codec).await
531    }
532  }
533}
534/// Generated server implementations.
535pub mod invocation_service_server {
536  #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
537  use tonic::codegen::*;
538  /// Generated trait containing gRPC methods that should be implemented for use with InvocationServiceServer.
539  #[async_trait]
540  pub trait InvocationService: Send + Sync + 'static {
541    /// Server streaming response type for the Invoke method.
542    type InvokeStream: futures_core::Stream<Item = std::result::Result<super::Packet, tonic::Status>> + Send + 'static;
543    async fn invoke(
544      &self,
545      request: tonic::Request<tonic::Streaming<super::InvocationRequest>>,
546    ) -> std::result::Result<tonic::Response<Self::InvokeStream>, tonic::Status>;
547    async fn list(
548      &self,
549      request: tonic::Request<super::ListRequest>,
550    ) -> std::result::Result<tonic::Response<super::ListResponse>, tonic::Status>;
551    async fn stats(
552      &self,
553      request: tonic::Request<super::StatsRequest>,
554    ) -> std::result::Result<tonic::Response<super::StatsResponse>, tonic::Status>;
555  }
556  #[derive(Debug)]
557  pub struct InvocationServiceServer<T: InvocationService> {
558    inner: _Inner<T>,
559    accept_compression_encodings: EnabledCompressionEncodings,
560    send_compression_encodings: EnabledCompressionEncodings,
561    max_decoding_message_size: Option<usize>,
562    max_encoding_message_size: Option<usize>,
563  }
564  struct _Inner<T>(Arc<T>);
565  impl<T: InvocationService> InvocationServiceServer<T> {
566    pub fn new(inner: T) -> Self {
567      Self::from_arc(Arc::new(inner))
568    }
569    pub fn from_arc(inner: Arc<T>) -> Self {
570      let inner = _Inner(inner);
571      Self {
572        inner,
573        accept_compression_encodings: Default::default(),
574        send_compression_encodings: Default::default(),
575        max_decoding_message_size: None,
576        max_encoding_message_size: None,
577      }
578    }
579    pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
580    where
581      F: tonic::service::Interceptor,
582    {
583      InterceptedService::new(Self::new(inner), interceptor)
584    }
585    /// Enable decompressing requests with the given encoding.
586    #[must_use]
587    pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
588      self.accept_compression_encodings.enable(encoding);
589      self
590    }
591    /// Compress responses with the given encoding, if the client supports it.
592    #[must_use]
593    pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
594      self.send_compression_encodings.enable(encoding);
595      self
596    }
597    /// Limits the maximum size of a decoded message.
598    ///
599    /// Default: `4MB`
600    #[must_use]
601    pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
602      self.max_decoding_message_size = Some(limit);
603      self
604    }
605    /// Limits the maximum size of an encoded message.
606    ///
607    /// Default: `usize::MAX`
608    #[must_use]
609    pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
610      self.max_encoding_message_size = Some(limit);
611      self
612    }
613  }
614  impl<T, B> tonic::codegen::Service<http::Request<B>> for InvocationServiceServer<T>
615  where
616    T: InvocationService,
617    B: Body + Send + 'static,
618    B::Error: Into<StdError> + Send + 'static,
619  {
620    type Response = http::Response<tonic::body::BoxBody>;
621    type Error = std::convert::Infallible;
622    type Future = BoxFuture<Self::Response, Self::Error>;
623    fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<std::result::Result<(), Self::Error>> {
624      Poll::Ready(Ok(()))
625    }
626    fn call(&mut self, req: http::Request<B>) -> Self::Future {
627      let inner = self.inner.clone();
628      match req.uri().path() {
629        "/wick.InvocationService/Invoke" => {
630          #[allow(non_camel_case_types)]
631          struct InvokeSvc<T: InvocationService>(pub Arc<T>);
632          impl<T: InvocationService> tonic::server::StreamingService<super::InvocationRequest> for InvokeSvc<T> {
633            type Response = super::Packet;
634            type ResponseStream = T::InvokeStream;
635            type Future = BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
636            fn call(&mut self, request: tonic::Request<tonic::Streaming<super::InvocationRequest>>) -> Self::Future {
637              let inner = Arc::clone(&self.0);
638              let fut = async move { (*inner).invoke(request).await };
639              Box::pin(fut)
640            }
641          }
642          let accept_compression_encodings = self.accept_compression_encodings;
643          let send_compression_encodings = self.send_compression_encodings;
644          let max_decoding_message_size = self.max_decoding_message_size;
645          let max_encoding_message_size = self.max_encoding_message_size;
646          let inner = self.inner.clone();
647          let fut = async move {
648            let inner = inner.0;
649            let method = InvokeSvc(inner);
650            let codec = tonic::codec::ProstCodec::default();
651            let mut grpc = tonic::server::Grpc::new(codec)
652              .apply_compression_config(accept_compression_encodings, send_compression_encodings)
653              .apply_max_message_size_config(max_decoding_message_size, max_encoding_message_size);
654            let res = grpc.streaming(method, req).await;
655            Ok(res)
656          };
657          Box::pin(fut)
658        }
659        "/wick.InvocationService/List" => {
660          #[allow(non_camel_case_types)]
661          struct ListSvc<T: InvocationService>(pub Arc<T>);
662          impl<T: InvocationService> tonic::server::UnaryService<super::ListRequest> for ListSvc<T> {
663            type Response = super::ListResponse;
664            type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
665            fn call(&mut self, request: tonic::Request<super::ListRequest>) -> Self::Future {
666              let inner = Arc::clone(&self.0);
667              let fut = async move { (*inner).list(request).await };
668              Box::pin(fut)
669            }
670          }
671          let accept_compression_encodings = self.accept_compression_encodings;
672          let send_compression_encodings = self.send_compression_encodings;
673          let max_decoding_message_size = self.max_decoding_message_size;
674          let max_encoding_message_size = self.max_encoding_message_size;
675          let inner = self.inner.clone();
676          let fut = async move {
677            let inner = inner.0;
678            let method = ListSvc(inner);
679            let codec = tonic::codec::ProstCodec::default();
680            let mut grpc = tonic::server::Grpc::new(codec)
681              .apply_compression_config(accept_compression_encodings, send_compression_encodings)
682              .apply_max_message_size_config(max_decoding_message_size, max_encoding_message_size);
683            let res = grpc.unary(method, req).await;
684            Ok(res)
685          };
686          Box::pin(fut)
687        }
688        "/wick.InvocationService/Stats" => {
689          #[allow(non_camel_case_types)]
690          struct StatsSvc<T: InvocationService>(pub Arc<T>);
691          impl<T: InvocationService> tonic::server::UnaryService<super::StatsRequest> for StatsSvc<T> {
692            type Response = super::StatsResponse;
693            type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
694            fn call(&mut self, request: tonic::Request<super::StatsRequest>) -> Self::Future {
695              let inner = Arc::clone(&self.0);
696              let fut = async move { (*inner).stats(request).await };
697              Box::pin(fut)
698            }
699          }
700          let accept_compression_encodings = self.accept_compression_encodings;
701          let send_compression_encodings = self.send_compression_encodings;
702          let max_decoding_message_size = self.max_decoding_message_size;
703          let max_encoding_message_size = self.max_encoding_message_size;
704          let inner = self.inner.clone();
705          let fut = async move {
706            let inner = inner.0;
707            let method = StatsSvc(inner);
708            let codec = tonic::codec::ProstCodec::default();
709            let mut grpc = tonic::server::Grpc::new(codec)
710              .apply_compression_config(accept_compression_encodings, send_compression_encodings)
711              .apply_max_message_size_config(max_decoding_message_size, max_encoding_message_size);
712            let res = grpc.unary(method, req).await;
713            Ok(res)
714          };
715          Box::pin(fut)
716        }
717        _ => Box::pin(async move {
718          Ok(
719            http::Response::builder()
720              .status(200)
721              .header("grpc-status", "12")
722              .header("content-type", "application/grpc")
723              .body(empty_body())
724              .unwrap(),
725          )
726        }),
727      }
728    }
729  }
730  impl<T: InvocationService> Clone for InvocationServiceServer<T> {
731    fn clone(&self) -> Self {
732      let inner = self.inner.clone();
733      Self {
734        inner,
735        accept_compression_encodings: self.accept_compression_encodings,
736        send_compression_encodings: self.send_compression_encodings,
737        max_decoding_message_size: self.max_decoding_message_size,
738        max_encoding_message_size: self.max_encoding_message_size,
739      }
740    }
741  }
742  impl<T: InvocationService> Clone for _Inner<T> {
743    fn clone(&self) -> Self {
744      Self(Arc::clone(&self.0))
745    }
746  }
747  impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
748    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
749      write!(f, "{:?}", self.0)
750    }
751  }
752  impl<T: InvocationService> tonic::server::NamedService for InvocationServiceServer<T> {
753    const NAME: &'static str = "wick.InvocationService";
754  }
755}