Skip to main content

polyester/gen/connect/
chain.lifecycle.v1.rs

1// @generated by connectrpc-codegen. DO NOT EDIT.
2
3///Shorthand for `OwnedView<GetFlowByIdRequestView<'static>>`.
4pub type OwnedGetFlowByIdRequestView = ::buffa::view::OwnedView<
5    crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowByIdRequestView<'static>,
6>;
7///Shorthand for `OwnedView<GetFlowResponseView<'static>>`.
8pub type OwnedGetFlowResponseView = ::buffa::view::OwnedView<
9    crate::proto::chain::lifecycle::v1::__buffa::view::GetFlowResponseView<'static>,
10>;
11///Shorthand for `OwnedView<ListFlowsRequestView<'static>>`.
12pub type OwnedListFlowsRequestView = ::buffa::view::OwnedView<
13    crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsRequestView<'static>,
14>;
15///Shorthand for `OwnedView<ListFlowsResponseView<'static>>`.
16pub type OwnedListFlowsResponseView = ::buffa::view::OwnedView<
17    crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsResponseView<'static>,
18>;
19///Shorthand for `OwnedView<ListFlowsByTxRequestView<'static>>`.
20pub type OwnedListFlowsByTxRequestView = ::buffa::view::OwnedView<
21    crate::proto::chain::lifecycle::v1::__buffa::view::ListFlowsByTxRequestView<'static>,
22>;
23///Shorthand for `OwnedView<ListFlowsByTxResponseView<'static>>`.
24pub 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}
87/// Full service name for this service.
88pub const LIFECYCLE_READ_SERVICE_SERVICE_NAME: &str = "chain.lifecycle.v1.LifecycleReadService";
89/// Static [`Spec`](::connectrpc::Spec) for the server-side `GetFlowById` RPC.
90///
91/// The dispatcher surfaces this on
92/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
93pub 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);
98/// Static [`Spec`](::connectrpc::Spec) for the server-side `ListFlows` RPC.
99///
100/// The dispatcher surfaces this on
101/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
102pub 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);
107/// Static [`Spec`](::connectrpc::Spec) for the server-side `ListFlowsByTx` RPC.
108///
109/// The dispatcher surfaces this on
110/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
111pub 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/// LifecycleReadService exposes lifecycle flow lookup and listing APIs.
117///
118/// # Implementing handlers
119///
120/// Implement methods with plain `async fn`; the returned future satisfies
121/// the `Send` bound automatically.
122///
123/// **Unary and server-streaming requests** arrive as
124/// [`ServiceRequest<'_, Req>`](::connectrpc::ServiceRequest): a zero-copy
125/// view of the request plus its body, valid for the duration of the call.
126/// Fields are read directly (`request.name` is a `&str` into the decoded
127/// buffer) and the borrow may be held across `.await` points. Anything
128/// that must outlive the call — `tokio::spawn`, channels, server state,
129/// or data captured by a returned response stream — takes owned data:
130/// call `request.to_owned_message()` (or copy the specific fields)
131/// first.
132///
133/// **Client-streaming and bidi requests** arrive as
134/// [`InboundStream<Req>`](::connectrpc::InboundStream) — a
135/// `ServiceStream` of [`StreamMessage`](::connectrpc::StreamMessage)s.
136/// Each item owns its decoded buffer and is `Send + 'static`, so items
137/// can be buffered or moved into spawned tasks; read fields zero-copy
138/// through the generated accessor methods (`item.name()`) or `.view()`,
139/// convert with `.to_owned_message()`, or yield an item back unchanged —
140/// `StreamMessage<M>` implements `Encodable<M>`.
141///
142/// Request types resolved through `extern_path` (e.g. well-known types
143/// from another crate) use the same wrappers; the crate that owns the
144/// type must be generated with buffa ≥ 0.8.0 and views enabled so the
145/// backing `HasMessageView` impl exists.
146///
147/// The `impl Encodable<Out>` return bound accepts the owned `Out`, the
148/// generated `OutView<'_>` / `OwnedOutView`,
149/// [`MaybeBorrowed`](::connectrpc::MaybeBorrowed), or
150/// [`PreEncoded`](::connectrpc::PreEncoded) for handlers that encode a
151/// non-`'static` view internally and pass the bytes across the handler
152/// boundary. View bodies are not emitted for output types mapped via
153/// `extern_path` (the impl would be an orphan); return owned for
154/// WKT/extern outputs.
155///
156/// Server-streaming and bidi-streaming methods return
157/// `ServiceStream<impl Encodable<Out> + Send + use<Self>>`. The
158/// `use<Self>` precise-capturing clause excludes `&self`'s lifetime and
159/// the request's lifetime (unary methods use `use<'a, Self>` and may
160/// borrow from `&self`), so stream items must be `'static` and cannot
161/// borrow from the request. To stream view-encoded data, encode each
162/// item inside the stream body and yield
163/// [`PreEncoded`](::connectrpc::PreEncoded) — see its `# Streaming
164/// example` doc.
165#[allow(clippy::type_complexity)]
166pub trait LifecycleReadService: Send + Sync + 'static {
167    /// GetFlowById retrieves one lifecycle flow by public flow id.
168    ///
169    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
170    ///
171    /// `request` is borrowed from the request body and is valid for the
172    /// duration of the call; message fields are read directly on it
173    /// (zero-copy). The response cannot borrow from `request` — use
174    /// `.to_owned_message()` (or copy the specific fields) for anything
175    /// returned, stored, or moved into `tokio::spawn`.
176    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    /// ListFlows lists lifecycle flows with optional filters and keyset
191    /// pagination.
192    ///
193    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
194    ///
195    /// `request` is borrowed from the request body and is valid for the
196    /// duration of the call; message fields are read directly on it
197    /// (zero-copy). The response cannot borrow from `request` — use
198    /// `.to_owned_message()` (or copy the specific fields) for anything
199    /// returned, stored, or moved into `tokio::spawn`.
200    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    /// ListFlowsByTx lists lifecycle flows that reference a transaction hash.
215    ///
216    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
217    ///
218    /// `request` is borrowed from the request body and is valid for the
219    /// duration of the call; message fields are read directly on it
220    /// (zero-copy). The response cannot borrow from `request` — use
221    /// `.to_owned_message()` (or copy the specific fields) for anything
222    /// returned, stored, or moved into `tokio::spawn`.
223    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}
238/// Extension trait for registering a service implementation with a Router.
239///
240/// This trait is automatically implemented for all types that implement the service trait.
241/// Prefer [`Router::add_service`](::connectrpc::Router::add_service) for
242/// top-down registration; `register` remains available for compatibility
243/// and cases where the service-first call shape is more convenient.
244///
245/// # Example
246///
247/// ```rust,ignore
248/// use std::sync::Arc;
249///
250/// let service = Arc::new(MyServiceImpl);
251/// let router = service.register(Router::new());
252/// ```
253pub trait LifecycleReadServiceExt: LifecycleReadService {
254    /// Register this service implementation with a Router.
255    ///
256    /// Takes ownership of the `Arc<Self>` and returns a new Router with
257    /// this service's methods registered.
258    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/// Type-inference marker used by [`Router::add_service`](::connectrpc::Router::add_service).
359#[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}
369/// Monomorphic dispatcher for `LifecycleReadService`.
370///
371/// Unlike `.register(Router)` which type-erases each method into an `Arc<dyn ErasedHandler>` stored in a `HashMap`, this struct dispatches via a compile-time `match` on method name: no vtable, no hash lookup.
372///
373/// # Example
374///
375/// ```rust,ignore
376/// use connectrpc::ConnectRpcService;
377///
378/// let server = LifecycleReadServiceServer::new(MyImpl);
379/// let service = ConnectRpcService::new(server);
380/// // hand `service` to axum/hyper as a fallback_service
381/// ```
382pub struct LifecycleReadServiceServer<T> {
383    inner: ::std::sync::Arc<T>,
384}
385impl<T: LifecycleReadService> LifecycleReadServiceServer<T> {
386    /// Wrap a service implementation in a monomorphic dispatcher.
387    pub fn new(service: T) -> Self {
388        Self {
389            inner: ::std::sync::Arc::new(service),
390        }
391    }
392    /// Wrap an already-`Arc`'d service implementation.
393    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/// Client for this service.
563///
564/// Generic over `T: ClientTransport`. For **gRPC** (HTTP/2), use
565/// `Http2Connection` — it has honest `poll_ready` and composes with
566/// `tower::balance` for multi-connection load balancing. For **Connect
567/// over HTTP/1.1** (or unknown protocol), use `HttpClient`.
568///
569/// # Working with the response
570///
571/// Unary calls return [`UnaryResponse<OwnedView<FooView>>`](::connectrpc::client::UnaryResponse).
572/// [`view()`](::connectrpc::client::UnaryResponse::view) borrows the response
573/// message, so field access is zero-copy:
574///
575/// ```rust,ignore
576/// let resp = client.get_flow_by_id(request).await?;
577/// let name: &str = resp.view().name;  // borrow into the response buffer
578/// ```
579///
580/// If you need the owned struct (e.g. to store or pass by value), use
581/// [`into_owned()`](::connectrpc::client::UnaryResponse::into_owned):
582///
583/// ```rust,ignore
584/// let owned = client.get_flow_by_id(request).await?.into_owned();
585/// ```
586///
587/// [`into_view()`](::connectrpc::client::UnaryResponse::into_view) keeps the
588/// zero-copy decoded body (an `OwnedView`) without copying; field access on it
589/// goes through `.reborrow()`. Streaming responses yield one
590/// [`StreamMessage`](::connectrpc::StreamMessage) per received message from
591/// `.message().await` — read fields zero-copy through the generated accessor
592/// methods (`msg.name()`) or `.view()`, or convert with `.to_owned_message()`.
593#[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    /// Create a new client with the given transport and configuration.
604    pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
605        Self { transport, config }
606    }
607    /// Get the client configuration.
608    pub fn config(&self) -> &::connectrpc::client::ClientConfig {
609        &self.config
610    }
611    /// Get a mutable reference to the client configuration.
612    pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
613        &mut self.config
614    }
615    /// Call the GetFlowById RPC. Sends a request to /chain.lifecycle.v1.LifecycleReadService/GetFlowById.
616    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    /// Call the GetFlowById RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
636    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    /// Call the ListFlows RPC. Sends a request to /chain.lifecycle.v1.LifecycleReadService/ListFlows.
661    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    /// Call the ListFlows RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
681    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    /// Call the ListFlowsByTx RPC. Sends a request to /chain.lifecycle.v1.LifecycleReadService/ListFlowsByTx.
706    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    /// Call the ListFlowsByTx RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
726    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}