1pub type OwnedGetFlowByIdRequestView = ::buffa::view::OwnedView<
5 crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowByIdRequestView<'static>,
6>;
7pub type OwnedGetFlowResponseView = ::buffa::view::OwnedView<
9 crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowResponseView<'static>,
10>;
11pub type OwnedListFlowsRequestView = ::buffa::view::OwnedView<
13 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsRequestView<'static>,
14>;
15pub type OwnedListFlowsResponseView = ::buffa::view::OwnedView<
17 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsResponseView<'static>,
18>;
19pub type OwnedListFlowsByTxRequestView = ::buffa::view::OwnedView<
21 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxRequestView<'static>,
22>;
23pub type OwnedListFlowsByTxResponseView = ::buffa::view::OwnedView<
25 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxResponseView<'static>,
26>;
27impl ::connectrpc::Encodable<crate::proto::chain::lifecycle::v1::GetFlowResponse>
28for crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowResponseView<'_> {
29 fn encode(
30 &self,
31 codec: ::connectrpc::CodecFormat,
32 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
33 ::connectrpc::__codegen::encode_view_body(self, codec)
34 }
35}
36impl ::connectrpc::Encodable<crate::proto::chain::lifecycle::v1::GetFlowResponse>
37for ::buffa::view::OwnedView<
38 crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowResponseView<'static>,
39> {
40 fn encode(
41 &self,
42 codec: ::connectrpc::CodecFormat,
43 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
44 ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
45 }
46}
47impl ::connectrpc::Encodable<crate::proto::chain::lifecycle::v1::ListFlowsResponse>
48for crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsResponseView<'_> {
49 fn encode(
50 &self,
51 codec: ::connectrpc::CodecFormat,
52 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
53 ::connectrpc::__codegen::encode_view_body(self, codec)
54 }
55}
56impl ::connectrpc::Encodable<crate::proto::chain::lifecycle::v1::ListFlowsResponse>
57for ::buffa::view::OwnedView<
58 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsResponseView<'static>,
59> {
60 fn encode(
61 &self,
62 codec: ::connectrpc::CodecFormat,
63 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
64 ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
65 }
66}
67impl ::connectrpc::Encodable<crate::proto::chain::lifecycle::v1::ListFlowsByTxResponse>
68for crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxResponseView<'_> {
69 fn encode(
70 &self,
71 codec: ::connectrpc::CodecFormat,
72 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
73 ::connectrpc::__codegen::encode_view_body(self, codec)
74 }
75}
76impl ::connectrpc::Encodable<crate::proto::chain::lifecycle::v1::ListFlowsByTxResponse>
77for ::buffa::view::OwnedView<
78 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxResponseView<'static>,
79> {
80 fn encode(
81 &self,
82 codec: ::connectrpc::CodecFormat,
83 ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
84 ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
85 }
86}
87pub const LIFECYCLE_READ_SERVICE_SERVICE_NAME: &str = "chain.lifecycle.v1.LifecycleReadService";
89pub const LIFECYCLE_READ_SERVICE_GET_FLOW_BY_ID_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
94 "/chain.lifecycle.v1.LifecycleReadService/GetFlowById",
95 ::connectrpc::StreamType::Unary,
96 )
97 .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
98pub const LIFECYCLE_READ_SERVICE_LIST_FLOWS_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
103 "/chain.lifecycle.v1.LifecycleReadService/ListFlows",
104 ::connectrpc::StreamType::Unary,
105 )
106 .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
107pub const LIFECYCLE_READ_SERVICE_LIST_FLOWS_BY_TX_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
112 "/chain.lifecycle.v1.LifecycleReadService/ListFlowsByTx",
113 ::connectrpc::StreamType::Unary,
114 )
115 .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
116#[allow(clippy::type_complexity)]
166pub trait LifecycleReadService: Send + Sync + 'static {
167 fn get_flow_by_id<'a>(
177 &'a self,
178 ctx: ::connectrpc::RequestContext,
179 request: ::connectrpc::ServiceRequest<
180 '_,
181 crate::proto::chain::lifecycle::v1::GetFlowByIdRequest,
182 >,
183 ) -> impl ::std::future::Future<
184 Output = ::connectrpc::ServiceResult<
185 impl ::connectrpc::Encodable<
186 crate::proto::chain::lifecycle::v1::GetFlowResponse,
187 > + Send + use<'a, Self>,
188 >,
189 > + Send;
190 fn list_flows<'a>(
201 &'a self,
202 ctx: ::connectrpc::RequestContext,
203 request: ::connectrpc::ServiceRequest<
204 '_,
205 crate::proto::chain::lifecycle::v1::ListFlowsRequest,
206 >,
207 ) -> impl ::std::future::Future<
208 Output = ::connectrpc::ServiceResult<
209 impl ::connectrpc::Encodable<
210 crate::proto::chain::lifecycle::v1::ListFlowsResponse,
211 > + Send + use<'a, Self>,
212 >,
213 > + Send;
214 fn list_flows_by_tx<'a>(
224 &'a self,
225 ctx: ::connectrpc::RequestContext,
226 request: ::connectrpc::ServiceRequest<
227 '_,
228 crate::proto::chain::lifecycle::v1::ListFlowsByTxRequest,
229 >,
230 ) -> impl ::std::future::Future<
231 Output = ::connectrpc::ServiceResult<
232 impl ::connectrpc::Encodable<
233 crate::proto::chain::lifecycle::v1::ListFlowsByTxResponse,
234 > + Send + use<'a, Self>,
235 >,
236 > + Send;
237}
238pub trait LifecycleReadServiceExt: LifecycleReadService {
254 fn register(
259 self: ::std::sync::Arc<Self>,
260 router: ::connectrpc::Router,
261 ) -> ::connectrpc::Router;
262}
263impl<S: LifecycleReadService> LifecycleReadServiceExt for S {
264 fn register(
265 self: ::std::sync::Arc<Self>,
266 router: ::connectrpc::Router,
267 ) -> ::connectrpc::Router {
268 router
269 .route_view(
270 LIFECYCLE_READ_SERVICE_SERVICE_NAME,
271 "GetFlowById",
272 {
273 let svc = ::std::sync::Arc::clone(&self);
274 ::connectrpc::view_handler_fn(move |
275 ctx,
276 req: ::buffa::view::OwnedView<
277 crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowByIdRequestView<
278 'static,
279 >,
280 >,
281 format|
282 {
283 let svc = ::std::sync::Arc::clone(&svc);
284 async move {
285 let sreq = ::connectrpc::ServiceRequest::<
286 crate::proto::chain::lifecycle::v1::GetFlowByIdRequest,
287 >::from_parts(req.reborrow(), req.bytes());
288 svc.get_flow_by_id(ctx, sreq)
289 .await?
290 .encode::<
291 crate::proto::chain::lifecycle::v1::GetFlowResponse,
292 >(format)
293 }
294 })
295 },
296 )
297 .with_spec(LIFECYCLE_READ_SERVICE_GET_FLOW_BY_ID_SPEC)
298 .route_view(
299 LIFECYCLE_READ_SERVICE_SERVICE_NAME,
300 "ListFlows",
301 {
302 let svc = ::std::sync::Arc::clone(&self);
303 ::connectrpc::view_handler_fn(move |
304 ctx,
305 req: ::buffa::view::OwnedView<
306 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsRequestView<
307 'static,
308 >,
309 >,
310 format|
311 {
312 let svc = ::std::sync::Arc::clone(&svc);
313 async move {
314 let sreq = ::connectrpc::ServiceRequest::<
315 crate::proto::chain::lifecycle::v1::ListFlowsRequest,
316 >::from_parts(req.reborrow(), req.bytes());
317 svc.list_flows(ctx, sreq)
318 .await?
319 .encode::<
320 crate::proto::chain::lifecycle::v1::ListFlowsResponse,
321 >(format)
322 }
323 })
324 },
325 )
326 .with_spec(LIFECYCLE_READ_SERVICE_LIST_FLOWS_SPEC)
327 .route_view(
328 LIFECYCLE_READ_SERVICE_SERVICE_NAME,
329 "ListFlowsByTx",
330 {
331 let svc = ::std::sync::Arc::clone(&self);
332 ::connectrpc::view_handler_fn(move |
333 ctx,
334 req: ::buffa::view::OwnedView<
335 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxRequestView<
336 'static,
337 >,
338 >,
339 format|
340 {
341 let svc = ::std::sync::Arc::clone(&svc);
342 async move {
343 let sreq = ::connectrpc::ServiceRequest::<
344 crate::proto::chain::lifecycle::v1::ListFlowsByTxRequest,
345 >::from_parts(req.reborrow(), req.bytes());
346 svc.list_flows_by_tx(ctx, sreq)
347 .await?
348 .encode::<
349 crate::proto::chain::lifecycle::v1::ListFlowsByTxResponse,
350 >(format)
351 }
352 })
353 },
354 )
355 .with_spec(LIFECYCLE_READ_SERVICE_LIST_FLOWS_BY_TX_SPEC)
356 }
357}
358#[doc(hidden)]
360pub struct LifecycleReadServiceRegisterMarker;
361impl<
362 S: LifecycleReadService,
363> ::connectrpc::ServiceRegister<LifecycleReadServiceRegisterMarker>
364for ::std::sync::Arc<S> {
365 fn register_service(self, router: ::connectrpc::Router) -> ::connectrpc::Router {
366 <S as LifecycleReadServiceExt>::register(self, router)
367 }
368}
369pub struct LifecycleReadServiceServer<T> {
383 inner: ::std::sync::Arc<T>,
384}
385impl<T: LifecycleReadService> LifecycleReadServiceServer<T> {
386 pub fn new(service: T) -> Self {
388 Self {
389 inner: ::std::sync::Arc::new(service),
390 }
391 }
392 pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
394 Self { inner }
395 }
396}
397impl<T> Clone for LifecycleReadServiceServer<T> {
398 fn clone(&self) -> Self {
399 Self {
400 inner: ::std::sync::Arc::clone(&self.inner),
401 }
402 }
403}
404impl<T: LifecycleReadService> ::connectrpc::Dispatcher
405for LifecycleReadServiceServer<T> {
406 #[inline]
407 fn lookup(
408 &self,
409 path: &str,
410 ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
411 let method = path.strip_prefix("chain.lifecycle.v1.LifecycleReadService/")?;
412 match method {
413 "GetFlowById" => {
414 Some(
415 ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
416 .with_spec(LIFECYCLE_READ_SERVICE_GET_FLOW_BY_ID_SPEC),
417 )
418 }
419 "ListFlows" => {
420 Some(
421 ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
422 .with_spec(LIFECYCLE_READ_SERVICE_LIST_FLOWS_SPEC),
423 )
424 }
425 "ListFlowsByTx" => {
426 Some(
427 ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
428 .with_spec(LIFECYCLE_READ_SERVICE_LIST_FLOWS_BY_TX_SPEC),
429 )
430 }
431 _ => None,
432 }
433 }
434 fn call_unary(
435 &self,
436 path: &str,
437 ctx: ::connectrpc::RequestContext,
438 request: ::connectrpc::Payload,
439 format: ::connectrpc::CodecFormat,
440 ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
441 let Some(method) = path.strip_prefix("chain.lifecycle.v1.LifecycleReadService/")
442 else {
443 return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
444 };
445 let _ = (&ctx, &request, &format);
446 match method {
447 "GetFlowById" => {
448 let svc = ::std::sync::Arc::clone(&self.inner);
449 Box::pin(async move {
450 let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
451 crate::proto::chain::lifecycle::v1::GetFlowByIdRequest,
452 >(request.encoded()?, format)?;
453 let req: crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowByIdRequestView<
454 '_,
455 > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
456 &body,
457 )?;
458 let req = ::connectrpc::ServiceRequest::<
459 crate::proto::chain::lifecycle::v1::GetFlowByIdRequest,
460 >::from_parts(&req, &body);
461 svc.get_flow_by_id(ctx, req)
462 .await?
463 .encode::<
464 crate::proto::chain::lifecycle::v1::GetFlowResponse,
465 >(format)
466 })
467 }
468 "ListFlows" => {
469 let svc = ::std::sync::Arc::clone(&self.inner);
470 Box::pin(async move {
471 let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
472 crate::proto::chain::lifecycle::v1::ListFlowsRequest,
473 >(request.encoded()?, format)?;
474 let req: crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsRequestView<
475 '_,
476 > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
477 &body,
478 )?;
479 let req = ::connectrpc::ServiceRequest::<
480 crate::proto::chain::lifecycle::v1::ListFlowsRequest,
481 >::from_parts(&req, &body);
482 svc.list_flows(ctx, req)
483 .await?
484 .encode::<
485 crate::proto::chain::lifecycle::v1::ListFlowsResponse,
486 >(format)
487 })
488 }
489 "ListFlowsByTx" => {
490 let svc = ::std::sync::Arc::clone(&self.inner);
491 Box::pin(async move {
492 let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
493 crate::proto::chain::lifecycle::v1::ListFlowsByTxRequest,
494 >(request.encoded()?, format)?;
495 let req: crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxRequestView<
496 '_,
497 > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
498 &body,
499 )?;
500 let req = ::connectrpc::ServiceRequest::<
501 crate::proto::chain::lifecycle::v1::ListFlowsByTxRequest,
502 >::from_parts(&req, &body);
503 svc.list_flows_by_tx(ctx, req)
504 .await?
505 .encode::<
506 crate::proto::chain::lifecycle::v1::ListFlowsByTxResponse,
507 >(format)
508 })
509 }
510 _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
511 }
512 }
513 fn call_server_streaming(
514 &self,
515 path: &str,
516 ctx: ::connectrpc::RequestContext,
517 request: ::buffa::bytes::Bytes,
518 format: ::connectrpc::CodecFormat,
519 ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
520 let Some(method) = path.strip_prefix("chain.lifecycle.v1.LifecycleReadService/")
521 else {
522 return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
523 };
524 let _ = (&ctx, &request, &format);
525 match method {
526 _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
527 }
528 }
529 fn call_client_streaming(
530 &self,
531 path: &str,
532 ctx: ::connectrpc::RequestContext,
533 requests: ::connectrpc::dispatcher::codegen::RequestStream,
534 format: ::connectrpc::CodecFormat,
535 ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
536 let Some(method) = path.strip_prefix("chain.lifecycle.v1.LifecycleReadService/")
537 else {
538 return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
539 };
540 let _ = (&ctx, &requests, &format);
541 match method {
542 _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
543 }
544 }
545 fn call_bidi_streaming(
546 &self,
547 path: &str,
548 ctx: ::connectrpc::RequestContext,
549 requests: ::connectrpc::dispatcher::codegen::RequestStream,
550 format: ::connectrpc::CodecFormat,
551 ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
552 let Some(method) = path.strip_prefix("chain.lifecycle.v1.LifecycleReadService/")
553 else {
554 return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
555 };
556 let _ = (&ctx, &requests, &format);
557 match method {
558 _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
559 }
560 }
561}
562#[derive(Clone)]
594pub struct LifecycleReadServiceClient<T> {
595 transport: T,
596 config: ::connectrpc::client::ClientConfig,
597}
598impl<T> LifecycleReadServiceClient<T>
599where
600 T: ::connectrpc::client::ClientTransport,
601 <T::ResponseBody as ::connectrpc::http_body::Body>::Error: ::std::fmt::Display,
602{
603 pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
605 Self { transport, config }
606 }
607 pub fn config(&self) -> &::connectrpc::client::ClientConfig {
609 &self.config
610 }
611 pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
613 &mut self.config
614 }
615 pub async fn get_flow_by_id(
617 &self,
618 request: crate::proto::chain::lifecycle::v1::GetFlowByIdRequest,
619 ) -> Result<
620 ::connectrpc::client::UnaryResponse<
621 ::buffa::view::OwnedView<
622 crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowResponseView<
623 'static,
624 >,
625 >,
626 >,
627 ::connectrpc::ConnectError,
628 > {
629 self.get_flow_by_id_with_options(
630 request,
631 ::connectrpc::client::CallOptions::default(),
632 )
633 .await
634 }
635 pub async fn get_flow_by_id_with_options(
637 &self,
638 request: crate::proto::chain::lifecycle::v1::GetFlowByIdRequest,
639 options: ::connectrpc::client::CallOptions,
640 ) -> Result<
641 ::connectrpc::client::UnaryResponse<
642 ::buffa::view::OwnedView<
643 crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowResponseView<
644 'static,
645 >,
646 >,
647 >,
648 ::connectrpc::ConnectError,
649 > {
650 ::connectrpc::client::call_unary(
651 &self.transport,
652 &self.config,
653 LIFECYCLE_READ_SERVICE_SERVICE_NAME,
654 "GetFlowById",
655 request,
656 options,
657 )
658 .await
659 }
660 pub async fn list_flows(
662 &self,
663 request: crate::proto::chain::lifecycle::v1::ListFlowsRequest,
664 ) -> Result<
665 ::connectrpc::client::UnaryResponse<
666 ::buffa::view::OwnedView<
667 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsResponseView<
668 'static,
669 >,
670 >,
671 >,
672 ::connectrpc::ConnectError,
673 > {
674 self.list_flows_with_options(
675 request,
676 ::connectrpc::client::CallOptions::default(),
677 )
678 .await
679 }
680 pub async fn list_flows_with_options(
682 &self,
683 request: crate::proto::chain::lifecycle::v1::ListFlowsRequest,
684 options: ::connectrpc::client::CallOptions,
685 ) -> Result<
686 ::connectrpc::client::UnaryResponse<
687 ::buffa::view::OwnedView<
688 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsResponseView<
689 'static,
690 >,
691 >,
692 >,
693 ::connectrpc::ConnectError,
694 > {
695 ::connectrpc::client::call_unary(
696 &self.transport,
697 &self.config,
698 LIFECYCLE_READ_SERVICE_SERVICE_NAME,
699 "ListFlows",
700 request,
701 options,
702 )
703 .await
704 }
705 pub async fn list_flows_by_tx(
707 &self,
708 request: crate::proto::chain::lifecycle::v1::ListFlowsByTxRequest,
709 ) -> Result<
710 ::connectrpc::client::UnaryResponse<
711 ::buffa::view::OwnedView<
712 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxResponseView<
713 'static,
714 >,
715 >,
716 >,
717 ::connectrpc::ConnectError,
718 > {
719 self.list_flows_by_tx_with_options(
720 request,
721 ::connectrpc::client::CallOptions::default(),
722 )
723 .await
724 }
725 pub async fn list_flows_by_tx_with_options(
727 &self,
728 request: crate::proto::chain::lifecycle::v1::ListFlowsByTxRequest,
729 options: ::connectrpc::client::CallOptions,
730 ) -> Result<
731 ::connectrpc::client::UnaryResponse<
732 ::buffa::view::OwnedView<
733 crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxResponseView<
734 'static,
735 >,
736 >,
737 >,
738 ::connectrpc::ConnectError,
739 > {
740 ::connectrpc::client::call_unary(
741 &self.transport,
742 &self.config,
743 LIFECYCLE_READ_SERVICE_SERVICE_NAME,
744 "ListFlowsByTx",
745 request,
746 options,
747 )
748 .await
749 }
750}