Skip to main content

polyester/gen/connect/
marketdata.v1.rs

1// @generated by connectrpc-codegen. DO NOT EDIT.
2
3///Shorthand for `OwnedView<GetOrderbookHeatmapRequestView<'static>>`.
4pub type OwnedGetOrderbookHeatmapRequestView = ::buffa::view::OwnedView<
5    crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapRequestView<'static>,
6>;
7///Shorthand for `OwnedView<GetOrderbookHeatmapResponseView<'static>>`.
8pub type OwnedGetOrderbookHeatmapResponseView = ::buffa::view::OwnedView<
9    crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapResponseView<'static>,
10>;
11impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetOrderbookHeatmapResponse>
12for crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapResponseView<'_> {
13    fn encode(
14        &self,
15        codec: ::connectrpc::CodecFormat,
16    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
17        ::connectrpc::__codegen::encode_view_body(self, codec)
18    }
19}
20impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetOrderbookHeatmapResponse>
21for ::buffa::view::OwnedView<
22    crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapResponseView<'static>,
23> {
24    fn encode(
25        &self,
26        codec: ::connectrpc::CodecFormat,
27    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
28        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
29    }
30}
31/// Full service name for this service.
32pub const HEATMAP_SERVICE_SERVICE_NAME: &str = "marketdata.v1.HeatmapService";
33/// Static [`Spec`](::connectrpc::Spec) for the server-side `GetOrderbookHeatmap` RPC.
34///
35/// The dispatcher surfaces this on
36/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
37pub const HEATMAP_SERVICE_GET_ORDERBOOK_HEATMAP_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
38        "/marketdata.v1.HeatmapService/GetOrderbookHeatmap",
39        ::connectrpc::StreamType::Unary,
40    )
41    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
42/// HeatmapService serves historical orderbook heatmap chains.
43///
44/// # Implementing handlers
45///
46/// Implement methods with plain `async fn`; the returned future satisfies
47/// the `Send` bound automatically.
48///
49/// **Unary and server-streaming requests** arrive as
50/// [`ServiceRequest<'_, Req>`](::connectrpc::ServiceRequest): a zero-copy
51/// view of the request plus its body, valid for the duration of the call.
52/// Fields are read directly (`request.name` is a `&str` into the decoded
53/// buffer) and the borrow may be held across `.await` points. Anything
54/// that must outlive the call — `tokio::spawn`, channels, server state,
55/// or data captured by a returned response stream — takes owned data:
56/// call `request.to_owned_message()` (or copy the specific fields)
57/// first.
58///
59/// **Client-streaming and bidi requests** arrive as
60/// [`InboundStream<Req>`](::connectrpc::InboundStream) — a
61/// `ServiceStream` of [`StreamMessage`](::connectrpc::StreamMessage)s.
62/// Each item owns its decoded buffer and is `Send + 'static`, so items
63/// can be buffered or moved into spawned tasks; read fields zero-copy
64/// through the generated accessor methods (`item.name()`) or `.view()`,
65/// convert with `.to_owned_message()`, or yield an item back unchanged —
66/// `StreamMessage<M>` implements `Encodable<M>`.
67///
68/// Request types resolved through `extern_path` (e.g. well-known types
69/// from another crate) use the same wrappers; the crate that owns the
70/// type must be generated with buffa ≥ 0.8.0 and views enabled so the
71/// backing `HasMessageView` impl exists.
72///
73/// The `impl Encodable<Out>` return bound accepts the owned `Out`, the
74/// generated `OutView<'_>` / `OwnedOutView`,
75/// [`MaybeBorrowed`](::connectrpc::MaybeBorrowed), or
76/// [`PreEncoded`](::connectrpc::PreEncoded) for handlers that encode a
77/// non-`'static` view internally and pass the bytes across the handler
78/// boundary. View bodies are not emitted for output types mapped via
79/// `extern_path` (the impl would be an orphan); return owned for
80/// WKT/extern outputs.
81///
82/// Server-streaming and bidi-streaming methods return
83/// `ServiceStream<impl Encodable<Out> + Send + use<Self>>`. The
84/// `use<Self>` precise-capturing clause excludes `&self`'s lifetime and
85/// the request's lifetime (unary methods use `use<'a, Self>` and may
86/// borrow from `&self`), so stream items must be `'static` and cannot
87/// borrow from the request. To stream view-encoded data, encode each
88/// item inside the stream body and yield
89/// [`PreEncoded`](::connectrpc::PreEncoded) — see its `# Streaming
90/// example` doc.
91#[allow(clippy::type_complexity)]
92pub trait HeatmapService: Send + Sync + 'static {
93    /// Retrieve historical orderbook heatmap data for a spot symbol.
94    /// - All intervals (1s/1m/5m/1h) return snapshot + sparse delta chain.
95    /// - Response may also include the latest live bucket state when available.
96    /// Response always includes realtime stitching anchors.
97    ///
98    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
99    ///
100    /// `request` is borrowed from the request body and is valid for the
101    /// duration of the call; message fields are read directly on it
102    /// (zero-copy). The response cannot borrow from `request` — use
103    /// `.to_owned_message()` (or copy the specific fields) for anything
104    /// returned, stored, or moved into `tokio::spawn`.
105    fn get_orderbook_heatmap<'a>(
106        &'a self,
107        ctx: ::connectrpc::RequestContext,
108        request: ::connectrpc::ServiceRequest<
109            '_,
110            crate::proto::marketdata::v1::GetOrderbookHeatmapRequest,
111        >,
112    ) -> impl ::std::future::Future<
113        Output = ::connectrpc::ServiceResult<
114            impl ::connectrpc::Encodable<
115                crate::proto::marketdata::v1::GetOrderbookHeatmapResponse,
116            > + Send + use<'a, Self>,
117        >,
118    > + Send;
119}
120/// Extension trait for registering a service implementation with a Router.
121///
122/// This trait is automatically implemented for all types that implement the service trait.
123/// Prefer [`Router::add_service`](::connectrpc::Router::add_service) for
124/// top-down registration; `register` remains available for compatibility
125/// and cases where the service-first call shape is more convenient.
126///
127/// # Example
128///
129/// ```rust,ignore
130/// use std::sync::Arc;
131///
132/// let service = Arc::new(MyServiceImpl);
133/// let router = service.register(Router::new());
134/// ```
135pub trait HeatmapServiceExt: HeatmapService {
136    /// Register this service implementation with a Router.
137    ///
138    /// Takes ownership of the `Arc<Self>` and returns a new Router with
139    /// this service's methods registered.
140    fn register(
141        self: ::std::sync::Arc<Self>,
142        router: ::connectrpc::Router,
143    ) -> ::connectrpc::Router;
144}
145impl<S: HeatmapService> HeatmapServiceExt for S {
146    fn register(
147        self: ::std::sync::Arc<Self>,
148        router: ::connectrpc::Router,
149    ) -> ::connectrpc::Router {
150        router
151            .route_view(
152                HEATMAP_SERVICE_SERVICE_NAME,
153                "GetOrderbookHeatmap",
154                {
155                    let svc = ::std::sync::Arc::clone(&self);
156                    ::connectrpc::view_handler_fn(move |
157                        ctx,
158                        req: ::buffa::view::OwnedView<
159                            crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapRequestView<
160                                'static,
161                            >,
162                        >,
163                        format|
164                    {
165                        let svc = ::std::sync::Arc::clone(&svc);
166                        async move {
167                            let sreq = ::connectrpc::ServiceRequest::<
168                                crate::proto::marketdata::v1::GetOrderbookHeatmapRequest,
169                            >::from_parts(req.reborrow(), req.bytes());
170                            svc.get_orderbook_heatmap(ctx, sreq)
171                                .await?
172                                .encode::<
173                                    crate::proto::marketdata::v1::GetOrderbookHeatmapResponse,
174                                >(format)
175                        }
176                    })
177                },
178            )
179            .with_spec(HEATMAP_SERVICE_GET_ORDERBOOK_HEATMAP_SPEC)
180    }
181}
182/// Type-inference marker used by [`Router::add_service`](::connectrpc::Router::add_service).
183#[doc(hidden)]
184pub struct HeatmapServiceRegisterMarker;
185impl<S: HeatmapService> ::connectrpc::ServiceRegister<HeatmapServiceRegisterMarker>
186for ::std::sync::Arc<S> {
187    fn register_service(self, router: ::connectrpc::Router) -> ::connectrpc::Router {
188        <S as HeatmapServiceExt>::register(self, router)
189    }
190}
191/// Monomorphic dispatcher for `HeatmapService`.
192///
193/// 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.
194///
195/// # Example
196///
197/// ```rust,ignore
198/// use connectrpc::ConnectRpcService;
199///
200/// let server = HeatmapServiceServer::new(MyImpl);
201/// let service = ConnectRpcService::new(server);
202/// // hand `service` to axum/hyper as a fallback_service
203/// ```
204pub struct HeatmapServiceServer<T> {
205    inner: ::std::sync::Arc<T>,
206}
207impl<T: HeatmapService> HeatmapServiceServer<T> {
208    /// Wrap a service implementation in a monomorphic dispatcher.
209    pub fn new(service: T) -> Self {
210        Self {
211            inner: ::std::sync::Arc::new(service),
212        }
213    }
214    /// Wrap an already-`Arc`'d service implementation.
215    pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
216        Self { inner }
217    }
218}
219impl<T> Clone for HeatmapServiceServer<T> {
220    fn clone(&self) -> Self {
221        Self {
222            inner: ::std::sync::Arc::clone(&self.inner),
223        }
224    }
225}
226impl<T: HeatmapService> ::connectrpc::Dispatcher for HeatmapServiceServer<T> {
227    #[inline]
228    fn lookup(
229        &self,
230        path: &str,
231    ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
232        let method = path.strip_prefix("marketdata.v1.HeatmapService/")?;
233        match method {
234            "GetOrderbookHeatmap" => {
235                Some(
236                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
237                        .with_spec(HEATMAP_SERVICE_GET_ORDERBOOK_HEATMAP_SPEC),
238                )
239            }
240            _ => None,
241        }
242    }
243    fn call_unary(
244        &self,
245        path: &str,
246        ctx: ::connectrpc::RequestContext,
247        request: ::connectrpc::Payload,
248        format: ::connectrpc::CodecFormat,
249    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
250        let Some(method) = path.strip_prefix("marketdata.v1.HeatmapService/") else {
251            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
252        };
253        let _ = (&ctx, &request, &format);
254        match method {
255            "GetOrderbookHeatmap" => {
256                let svc = ::std::sync::Arc::clone(&self.inner);
257                Box::pin(async move {
258                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
259                        crate::proto::marketdata::v1::GetOrderbookHeatmapRequest,
260                    >(request.encoded()?, format)?;
261                    let req: crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapRequestView<
262                        '_,
263                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
264                        &body,
265                    )?;
266                    let req = ::connectrpc::ServiceRequest::<
267                        crate::proto::marketdata::v1::GetOrderbookHeatmapRequest,
268                    >::from_parts(&req, &body);
269                    svc.get_orderbook_heatmap(ctx, req)
270                        .await?
271                        .encode::<
272                            crate::proto::marketdata::v1::GetOrderbookHeatmapResponse,
273                        >(format)
274                })
275            }
276            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
277        }
278    }
279    fn call_server_streaming(
280        &self,
281        path: &str,
282        ctx: ::connectrpc::RequestContext,
283        request: ::buffa::bytes::Bytes,
284        format: ::connectrpc::CodecFormat,
285    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
286        let Some(method) = path.strip_prefix("marketdata.v1.HeatmapService/") else {
287            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
288        };
289        let _ = (&ctx, &request, &format);
290        match method {
291            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
292        }
293    }
294    fn call_client_streaming(
295        &self,
296        path: &str,
297        ctx: ::connectrpc::RequestContext,
298        requests: ::connectrpc::dispatcher::codegen::RequestStream,
299        format: ::connectrpc::CodecFormat,
300    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
301        let Some(method) = path.strip_prefix("marketdata.v1.HeatmapService/") else {
302            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
303        };
304        let _ = (&ctx, &requests, &format);
305        match method {
306            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
307        }
308    }
309    fn call_bidi_streaming(
310        &self,
311        path: &str,
312        ctx: ::connectrpc::RequestContext,
313        requests: ::connectrpc::dispatcher::codegen::RequestStream,
314        format: ::connectrpc::CodecFormat,
315    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
316        let Some(method) = path.strip_prefix("marketdata.v1.HeatmapService/") else {
317            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
318        };
319        let _ = (&ctx, &requests, &format);
320        match method {
321            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
322        }
323    }
324}
325/// Client for this service.
326///
327/// Generic over `T: ClientTransport`. For **gRPC** (HTTP/2), use
328/// `Http2Connection` — it has honest `poll_ready` and composes with
329/// `tower::balance` for multi-connection load balancing. For **Connect
330/// over HTTP/1.1** (or unknown protocol), use `HttpClient`.
331///
332/// # Working with the response
333///
334/// Unary calls return [`UnaryResponse<OwnedView<FooView>>`](::connectrpc::client::UnaryResponse).
335/// [`view()`](::connectrpc::client::UnaryResponse::view) borrows the response
336/// message, so field access is zero-copy:
337///
338/// ```rust,ignore
339/// let resp = client.get_orderbook_heatmap(request).await?;
340/// let name: &str = resp.view().name;  // borrow into the response buffer
341/// ```
342///
343/// If you need the owned struct (e.g. to store or pass by value), use
344/// [`into_owned()`](::connectrpc::client::UnaryResponse::into_owned):
345///
346/// ```rust,ignore
347/// let owned = client.get_orderbook_heatmap(request).await?.into_owned();
348/// ```
349///
350/// [`into_view()`](::connectrpc::client::UnaryResponse::into_view) keeps the
351/// zero-copy decoded body (an `OwnedView`) without copying; field access on it
352/// goes through `.reborrow()`. Streaming responses yield one
353/// [`StreamMessage`](::connectrpc::StreamMessage) per received message from
354/// `.message().await` — read fields zero-copy through the generated accessor
355/// methods (`msg.name()`) or `.view()`, or convert with `.to_owned_message()`.
356#[derive(Clone)]
357pub struct HeatmapServiceClient<T> {
358    transport: T,
359    config: ::connectrpc::client::ClientConfig,
360}
361impl<T> HeatmapServiceClient<T>
362where
363    T: ::connectrpc::client::ClientTransport,
364    <T::ResponseBody as ::connectrpc::http_body::Body>::Error: ::std::fmt::Display,
365{
366    /// Create a new client with the given transport and configuration.
367    pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
368        Self { transport, config }
369    }
370    /// Get the client configuration.
371    pub fn config(&self) -> &::connectrpc::client::ClientConfig {
372        &self.config
373    }
374    /// Get a mutable reference to the client configuration.
375    pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
376        &mut self.config
377    }
378    /// Call the GetOrderbookHeatmap RPC. Sends a request to /marketdata.v1.HeatmapService/GetOrderbookHeatmap.
379    pub async fn get_orderbook_heatmap(
380        &self,
381        request: crate::proto::marketdata::v1::GetOrderbookHeatmapRequest,
382    ) -> Result<
383        ::connectrpc::client::UnaryResponse<
384            ::buffa::view::OwnedView<
385                crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapResponseView<
386                    'static,
387                >,
388            >,
389        >,
390        ::connectrpc::ConnectError,
391    > {
392        self.get_orderbook_heatmap_with_options(
393                request,
394                ::connectrpc::client::CallOptions::default(),
395            )
396            .await
397    }
398    /// Call the GetOrderbookHeatmap RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
399    pub async fn get_orderbook_heatmap_with_options(
400        &self,
401        request: crate::proto::marketdata::v1::GetOrderbookHeatmapRequest,
402        options: ::connectrpc::client::CallOptions,
403    ) -> Result<
404        ::connectrpc::client::UnaryResponse<
405            ::buffa::view::OwnedView<
406                crate::proto::marketdata::v1::__buffa::view::GetOrderbookHeatmapResponseView<
407                    'static,
408                >,
409            >,
410        >,
411        ::connectrpc::ConnectError,
412    > {
413        ::connectrpc::client::call_unary(
414                &self.transport,
415                &self.config,
416                HEATMAP_SERVICE_SERVICE_NAME,
417                "GetOrderbookHeatmap",
418                request,
419                options,
420            )
421            .await
422    }
423}
424
425///Shorthand for `OwnedView<GetTradesRequestView<'static>>`.
426pub type OwnedGetTradesRequestView = ::buffa::view::OwnedView<
427    crate::proto::marketdata::v1::__buffa::view::GetTradesRequestView<'static>,
428>;
429///Shorthand for `OwnedView<GetTradesResponseView<'static>>`.
430pub type OwnedGetTradesResponseView = ::buffa::view::OwnedView<
431    crate::proto::marketdata::v1::__buffa::view::GetTradesResponseView<'static>,
432>;
433///Shorthand for `OwnedView<GetCandlesRequestView<'static>>`.
434pub type OwnedGetCandlesRequestView = ::buffa::view::OwnedView<
435    crate::proto::marketdata::v1::__buffa::view::GetCandlesRequestView<'static>,
436>;
437///Shorthand for `OwnedView<GetCandlesResponseView<'static>>`.
438pub type OwnedGetCandlesResponseView = ::buffa::view::OwnedView<
439    crate::proto::marketdata::v1::__buffa::view::GetCandlesResponseView<'static>,
440>;
441///Shorthand for `OwnedView<GetCandlesColumnsRequestView<'static>>`.
442pub type OwnedGetCandlesColumnsRequestView = ::buffa::view::OwnedView<
443    crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsRequestView<'static>,
444>;
445///Shorthand for `OwnedView<GetCandlesColumnsResponseView<'static>>`.
446pub type OwnedGetCandlesColumnsResponseView = ::buffa::view::OwnedView<
447    crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsResponseView<'static>,
448>;
449///Shorthand for `OwnedView<GetSpotConfigRequestView<'static>>`.
450pub type OwnedGetSpotConfigRequestView = ::buffa::view::OwnedView<
451    crate::proto::marketdata::v1::__buffa::view::GetSpotConfigRequestView<'static>,
452>;
453///Shorthand for `OwnedView<GetSpotConfigResponseView<'static>>`.
454pub type OwnedGetSpotConfigResponseView = ::buffa::view::OwnedView<
455    crate::proto::marketdata::v1::__buffa::view::GetSpotConfigResponseView<'static>,
456>;
457impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetTradesResponse>
458for crate::proto::marketdata::v1::__buffa::view::GetTradesResponseView<'_> {
459    fn encode(
460        &self,
461        codec: ::connectrpc::CodecFormat,
462    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
463        ::connectrpc::__codegen::encode_view_body(self, codec)
464    }
465}
466impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetTradesResponse>
467for ::buffa::view::OwnedView<
468    crate::proto::marketdata::v1::__buffa::view::GetTradesResponseView<'static>,
469> {
470    fn encode(
471        &self,
472        codec: ::connectrpc::CodecFormat,
473    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
474        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
475    }
476}
477impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetCandlesResponse>
478for crate::proto::marketdata::v1::__buffa::view::GetCandlesResponseView<'_> {
479    fn encode(
480        &self,
481        codec: ::connectrpc::CodecFormat,
482    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
483        ::connectrpc::__codegen::encode_view_body(self, codec)
484    }
485}
486impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetCandlesResponse>
487for ::buffa::view::OwnedView<
488    crate::proto::marketdata::v1::__buffa::view::GetCandlesResponseView<'static>,
489> {
490    fn encode(
491        &self,
492        codec: ::connectrpc::CodecFormat,
493    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
494        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
495    }
496}
497impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetCandlesColumnsResponse>
498for crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsResponseView<'_> {
499    fn encode(
500        &self,
501        codec: ::connectrpc::CodecFormat,
502    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
503        ::connectrpc::__codegen::encode_view_body(self, codec)
504    }
505}
506impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetCandlesColumnsResponse>
507for ::buffa::view::OwnedView<
508    crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsResponseView<'static>,
509> {
510    fn encode(
511        &self,
512        codec: ::connectrpc::CodecFormat,
513    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
514        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
515    }
516}
517impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetSpotConfigResponse>
518for crate::proto::marketdata::v1::__buffa::view::GetSpotConfigResponseView<'_> {
519    fn encode(
520        &self,
521        codec: ::connectrpc::CodecFormat,
522    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
523        ::connectrpc::__codegen::encode_view_body(self, codec)
524    }
525}
526impl ::connectrpc::Encodable<crate::proto::marketdata::v1::GetSpotConfigResponse>
527for ::buffa::view::OwnedView<
528    crate::proto::marketdata::v1::__buffa::view::GetSpotConfigResponseView<'static>,
529> {
530    fn encode(
531        &self,
532        codec: ::connectrpc::CodecFormat,
533    ) -> ::std::result::Result<::buffa::bytes::Bytes, ::connectrpc::ConnectError> {
534        ::connectrpc::__codegen::encode_view_body(self.reborrow(), codec)
535    }
536}
537/// Full service name for this service.
538pub const MARKET_DATA_SERVICE_SERVICE_NAME: &str = "marketdata.v1.MarketDataService";
539/// Static [`Spec`](::connectrpc::Spec) for the server-side `GetTrades` RPC.
540///
541/// The dispatcher surfaces this on
542/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
543pub const MARKET_DATA_SERVICE_GET_TRADES_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
544        "/marketdata.v1.MarketDataService/GetTrades",
545        ::connectrpc::StreamType::Unary,
546    )
547    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
548/// Static [`Spec`](::connectrpc::Spec) for the server-side `GetCandles` RPC.
549///
550/// The dispatcher surfaces this on
551/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
552pub const MARKET_DATA_SERVICE_GET_CANDLES_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
553        "/marketdata.v1.MarketDataService/GetCandles",
554        ::connectrpc::StreamType::Unary,
555    )
556    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
557/// Static [`Spec`](::connectrpc::Spec) for the server-side `GetCandlesColumns` RPC.
558///
559/// The dispatcher surfaces this on
560/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
561pub const MARKET_DATA_SERVICE_GET_CANDLES_COLUMNS_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
562        "/marketdata.v1.MarketDataService/GetCandlesColumns",
563        ::connectrpc::StreamType::Unary,
564    )
565    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
566/// Static [`Spec`](::connectrpc::Spec) for the server-side `GetSpotConfig` RPC.
567///
568/// The dispatcher surfaces this on
569/// [`RequestContext::spec`](::connectrpc::RequestContext::spec).
570pub const MARKET_DATA_SERVICE_GET_SPOT_CONFIG_SPEC: ::connectrpc::Spec = ::connectrpc::Spec::server(
571        "/marketdata.v1.MarketDataService/GetSpotConfig",
572        ::connectrpc::StreamType::Unary,
573    )
574    .with_idempotency_level(::connectrpc::IdempotencyLevel::Unknown);
575/// Server trait for MarketDataService.
576///
577/// # Implementing handlers
578///
579/// Implement methods with plain `async fn`; the returned future satisfies
580/// the `Send` bound automatically.
581///
582/// **Unary and server-streaming requests** arrive as
583/// [`ServiceRequest<'_, Req>`](::connectrpc::ServiceRequest): a zero-copy
584/// view of the request plus its body, valid for the duration of the call.
585/// Fields are read directly (`request.name` is a `&str` into the decoded
586/// buffer) and the borrow may be held across `.await` points. Anything
587/// that must outlive the call — `tokio::spawn`, channels, server state,
588/// or data captured by a returned response stream — takes owned data:
589/// call `request.to_owned_message()` (or copy the specific fields)
590/// first.
591///
592/// **Client-streaming and bidi requests** arrive as
593/// [`InboundStream<Req>`](::connectrpc::InboundStream) — a
594/// `ServiceStream` of [`StreamMessage`](::connectrpc::StreamMessage)s.
595/// Each item owns its decoded buffer and is `Send + 'static`, so items
596/// can be buffered or moved into spawned tasks; read fields zero-copy
597/// through the generated accessor methods (`item.name()`) or `.view()`,
598/// convert with `.to_owned_message()`, or yield an item back unchanged —
599/// `StreamMessage<M>` implements `Encodable<M>`.
600///
601/// Request types resolved through `extern_path` (e.g. well-known types
602/// from another crate) use the same wrappers; the crate that owns the
603/// type must be generated with buffa ≥ 0.8.0 and views enabled so the
604/// backing `HasMessageView` impl exists.
605///
606/// The `impl Encodable<Out>` return bound accepts the owned `Out`, the
607/// generated `OutView<'_>` / `OwnedOutView`,
608/// [`MaybeBorrowed`](::connectrpc::MaybeBorrowed), or
609/// [`PreEncoded`](::connectrpc::PreEncoded) for handlers that encode a
610/// non-`'static` view internally and pass the bytes across the handler
611/// boundary. View bodies are not emitted for output types mapped via
612/// `extern_path` (the impl would be an orphan); return owned for
613/// WKT/extern outputs.
614///
615/// Server-streaming and bidi-streaming methods return
616/// `ServiceStream<impl Encodable<Out> + Send + use<Self>>`. The
617/// `use<Self>` precise-capturing clause excludes `&self`'s lifetime and
618/// the request's lifetime (unary methods use `use<'a, Self>` and may
619/// borrow from `&self`), so stream items must be `'static` and cannot
620/// borrow from the request. To stream view-encoded data, encode each
621/// item inside the stream body and yield
622/// [`PreEncoded`](::connectrpc::PreEncoded) — see its `# Streaming
623/// example` doc.
624#[allow(clippy::type_complexity)]
625pub trait MarketDataService: Send + Sync + 'static {
626    /// Retrieve recent public trades for a spot market.
627    /// Results are ordered newest-first and support optional aggressor side,
628    /// inclusive time-range, and opaque keyset pagination filters.
629    ///
630    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
631    ///
632    /// `request` is borrowed from the request body and is valid for the
633    /// duration of the call; message fields are read directly on it
634    /// (zero-copy). The response cannot borrow from `request` — use
635    /// `.to_owned_message()` (or copy the specific fields) for anything
636    /// returned, stored, or moved into `tokio::spawn`.
637    fn get_trades<'a>(
638        &'a self,
639        ctx: ::connectrpc::RequestContext,
640        request: ::connectrpc::ServiceRequest<
641            '_,
642            crate::proto::marketdata::v1::GetTradesRequest,
643        >,
644    ) -> impl ::std::future::Future<
645        Output = ::connectrpc::ServiceResult<
646            impl ::connectrpc::Encodable<
647                crate::proto::marketdata::v1::GetTradesResponse,
648            > + Send + use<'a, Self>,
649        >,
650    > + Send;
651    /// Retrieve OHLCV candles for a spot market and timeframe.
652    /// Results are ordered newest-first and support inclusive time bounds, optional
653    /// current open candle inclusion, and optional composite reference candles.
654    ///
655    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
656    ///
657    /// `request` is borrowed from the request body and is valid for the
658    /// duration of the call; message fields are read directly on it
659    /// (zero-copy). The response cannot borrow from `request` — use
660    /// `.to_owned_message()` (or copy the specific fields) for anything
661    /// returned, stored, or moved into `tokio::spawn`.
662    fn get_candles<'a>(
663        &'a self,
664        ctx: ::connectrpc::RequestContext,
665        request: ::connectrpc::ServiceRequest<
666            '_,
667            crate::proto::marketdata::v1::GetCandlesRequest,
668        >,
669    ) -> impl ::std::future::Future<
670        Output = ::connectrpc::ServiceResult<
671            impl ::connectrpc::Encodable<
672                crate::proto::marketdata::v1::GetCandlesResponse,
673            > + Send + use<'a, Self>,
674        >,
675    > + Send;
676    /// GetCandlesColumns returns OHLCV candles in a columnar representation optimized for charting.
677    /// This method is intended for ConnectRPC clients and returns scaled integers:
678    /// OHLC prices use 1e6 quote-unit scale, and volumes use base_quantity_scale.
679    ///
680    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
681    ///
682    /// `request` is borrowed from the request body and is valid for the
683    /// duration of the call; message fields are read directly on it
684    /// (zero-copy). The response cannot borrow from `request` — use
685    /// `.to_owned_message()` (or copy the specific fields) for anything
686    /// returned, stored, or moved into `tokio::spawn`.
687    fn get_candles_columns<'a>(
688        &'a self,
689        ctx: ::connectrpc::RequestContext,
690        request: ::connectrpc::ServiceRequest<
691            '_,
692            crate::proto::marketdata::v1::GetCandlesColumnsRequest,
693        >,
694    ) -> impl ::std::future::Future<
695        Output = ::connectrpc::ServiceResult<
696            impl ::connectrpc::Encodable<
697                crate::proto::marketdata::v1::GetCandlesColumnsResponse,
698            > + Send + use<'a, Self>,
699        >,
700    > + Send;
701    /// Retrieve a cacheable snapshot of spot assets and pairs, including precision and trading constraints.
702    ///
703    /// `'a` lets the response body borrow from `&self` (e.g. server-resident state).
704    ///
705    /// `request` is borrowed from the request body and is valid for the
706    /// duration of the call; message fields are read directly on it
707    /// (zero-copy). The response cannot borrow from `request` — use
708    /// `.to_owned_message()` (or copy the specific fields) for anything
709    /// returned, stored, or moved into `tokio::spawn`.
710    fn get_spot_config<'a>(
711        &'a self,
712        ctx: ::connectrpc::RequestContext,
713        request: ::connectrpc::ServiceRequest<
714            '_,
715            crate::proto::marketdata::v1::GetSpotConfigRequest,
716        >,
717    ) -> impl ::std::future::Future<
718        Output = ::connectrpc::ServiceResult<
719            impl ::connectrpc::Encodable<
720                crate::proto::marketdata::v1::GetSpotConfigResponse,
721            > + Send + use<'a, Self>,
722        >,
723    > + Send;
724}
725/// Extension trait for registering a service implementation with a Router.
726///
727/// This trait is automatically implemented for all types that implement the service trait.
728/// Prefer [`Router::add_service`](::connectrpc::Router::add_service) for
729/// top-down registration; `register` remains available for compatibility
730/// and cases where the service-first call shape is more convenient.
731///
732/// # Example
733///
734/// ```rust,ignore
735/// use std::sync::Arc;
736///
737/// let service = Arc::new(MyServiceImpl);
738/// let router = service.register(Router::new());
739/// ```
740pub trait MarketDataServiceExt: MarketDataService {
741    /// Register this service implementation with a Router.
742    ///
743    /// Takes ownership of the `Arc<Self>` and returns a new Router with
744    /// this service's methods registered.
745    fn register(
746        self: ::std::sync::Arc<Self>,
747        router: ::connectrpc::Router,
748    ) -> ::connectrpc::Router;
749}
750impl<S: MarketDataService> MarketDataServiceExt for S {
751    fn register(
752        self: ::std::sync::Arc<Self>,
753        router: ::connectrpc::Router,
754    ) -> ::connectrpc::Router {
755        router
756            .route_view(
757                MARKET_DATA_SERVICE_SERVICE_NAME,
758                "GetTrades",
759                {
760                    let svc = ::std::sync::Arc::clone(&self);
761                    ::connectrpc::view_handler_fn(move |
762                        ctx,
763                        req: ::buffa::view::OwnedView<
764                            crate::proto::marketdata::v1::__buffa::view::GetTradesRequestView<
765                                'static,
766                            >,
767                        >,
768                        format|
769                    {
770                        let svc = ::std::sync::Arc::clone(&svc);
771                        async move {
772                            let sreq = ::connectrpc::ServiceRequest::<
773                                crate::proto::marketdata::v1::GetTradesRequest,
774                            >::from_parts(req.reborrow(), req.bytes());
775                            svc.get_trades(ctx, sreq)
776                                .await?
777                                .encode::<
778                                    crate::proto::marketdata::v1::GetTradesResponse,
779                                >(format)
780                        }
781                    })
782                },
783            )
784            .with_spec(MARKET_DATA_SERVICE_GET_TRADES_SPEC)
785            .route_view(
786                MARKET_DATA_SERVICE_SERVICE_NAME,
787                "GetCandles",
788                {
789                    let svc = ::std::sync::Arc::clone(&self);
790                    ::connectrpc::view_handler_fn(move |
791                        ctx,
792                        req: ::buffa::view::OwnedView<
793                            crate::proto::marketdata::v1::__buffa::view::GetCandlesRequestView<
794                                'static,
795                            >,
796                        >,
797                        format|
798                    {
799                        let svc = ::std::sync::Arc::clone(&svc);
800                        async move {
801                            let sreq = ::connectrpc::ServiceRequest::<
802                                crate::proto::marketdata::v1::GetCandlesRequest,
803                            >::from_parts(req.reborrow(), req.bytes());
804                            svc.get_candles(ctx, sreq)
805                                .await?
806                                .encode::<
807                                    crate::proto::marketdata::v1::GetCandlesResponse,
808                                >(format)
809                        }
810                    })
811                },
812            )
813            .with_spec(MARKET_DATA_SERVICE_GET_CANDLES_SPEC)
814            .route_view(
815                MARKET_DATA_SERVICE_SERVICE_NAME,
816                "GetCandlesColumns",
817                {
818                    let svc = ::std::sync::Arc::clone(&self);
819                    ::connectrpc::view_handler_fn(move |
820                        ctx,
821                        req: ::buffa::view::OwnedView<
822                            crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsRequestView<
823                                'static,
824                            >,
825                        >,
826                        format|
827                    {
828                        let svc = ::std::sync::Arc::clone(&svc);
829                        async move {
830                            let sreq = ::connectrpc::ServiceRequest::<
831                                crate::proto::marketdata::v1::GetCandlesColumnsRequest,
832                            >::from_parts(req.reborrow(), req.bytes());
833                            svc.get_candles_columns(ctx, sreq)
834                                .await?
835                                .encode::<
836                                    crate::proto::marketdata::v1::GetCandlesColumnsResponse,
837                                >(format)
838                        }
839                    })
840                },
841            )
842            .with_spec(MARKET_DATA_SERVICE_GET_CANDLES_COLUMNS_SPEC)
843            .route_view(
844                MARKET_DATA_SERVICE_SERVICE_NAME,
845                "GetSpotConfig",
846                {
847                    let svc = ::std::sync::Arc::clone(&self);
848                    ::connectrpc::view_handler_fn(move |
849                        ctx,
850                        req: ::buffa::view::OwnedView<
851                            crate::proto::marketdata::v1::__buffa::view::GetSpotConfigRequestView<
852                                'static,
853                            >,
854                        >,
855                        format|
856                    {
857                        let svc = ::std::sync::Arc::clone(&svc);
858                        async move {
859                            let sreq = ::connectrpc::ServiceRequest::<
860                                crate::proto::marketdata::v1::GetSpotConfigRequest,
861                            >::from_parts(req.reborrow(), req.bytes());
862                            svc.get_spot_config(ctx, sreq)
863                                .await?
864                                .encode::<
865                                    crate::proto::marketdata::v1::GetSpotConfigResponse,
866                                >(format)
867                        }
868                    })
869                },
870            )
871            .with_spec(MARKET_DATA_SERVICE_GET_SPOT_CONFIG_SPEC)
872    }
873}
874/// Type-inference marker used by [`Router::add_service`](::connectrpc::Router::add_service).
875#[doc(hidden)]
876pub struct MarketDataServiceRegisterMarker;
877impl<S: MarketDataService> ::connectrpc::ServiceRegister<MarketDataServiceRegisterMarker>
878for ::std::sync::Arc<S> {
879    fn register_service(self, router: ::connectrpc::Router) -> ::connectrpc::Router {
880        <S as MarketDataServiceExt>::register(self, router)
881    }
882}
883/// Monomorphic dispatcher for `MarketDataService`.
884///
885/// 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.
886///
887/// # Example
888///
889/// ```rust,ignore
890/// use connectrpc::ConnectRpcService;
891///
892/// let server = MarketDataServiceServer::new(MyImpl);
893/// let service = ConnectRpcService::new(server);
894/// // hand `service` to axum/hyper as a fallback_service
895/// ```
896pub struct MarketDataServiceServer<T> {
897    inner: ::std::sync::Arc<T>,
898}
899impl<T: MarketDataService> MarketDataServiceServer<T> {
900    /// Wrap a service implementation in a monomorphic dispatcher.
901    pub fn new(service: T) -> Self {
902        Self {
903            inner: ::std::sync::Arc::new(service),
904        }
905    }
906    /// Wrap an already-`Arc`'d service implementation.
907    pub fn from_arc(inner: ::std::sync::Arc<T>) -> Self {
908        Self { inner }
909    }
910}
911impl<T> Clone for MarketDataServiceServer<T> {
912    fn clone(&self) -> Self {
913        Self {
914            inner: ::std::sync::Arc::clone(&self.inner),
915        }
916    }
917}
918impl<T: MarketDataService> ::connectrpc::Dispatcher for MarketDataServiceServer<T> {
919    #[inline]
920    fn lookup(
921        &self,
922        path: &str,
923    ) -> Option<::connectrpc::dispatcher::codegen::MethodDescriptor> {
924        let method = path.strip_prefix("marketdata.v1.MarketDataService/")?;
925        match method {
926            "GetTrades" => {
927                Some(
928                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
929                        .with_spec(MARKET_DATA_SERVICE_GET_TRADES_SPEC),
930                )
931            }
932            "GetCandles" => {
933                Some(
934                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
935                        .with_spec(MARKET_DATA_SERVICE_GET_CANDLES_SPEC),
936                )
937            }
938            "GetCandlesColumns" => {
939                Some(
940                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
941                        .with_spec(MARKET_DATA_SERVICE_GET_CANDLES_COLUMNS_SPEC),
942                )
943            }
944            "GetSpotConfig" => {
945                Some(
946                    ::connectrpc::dispatcher::codegen::MethodDescriptor::unary(false)
947                        .with_spec(MARKET_DATA_SERVICE_GET_SPOT_CONFIG_SPEC),
948                )
949            }
950            _ => None,
951        }
952    }
953    fn call_unary(
954        &self,
955        path: &str,
956        ctx: ::connectrpc::RequestContext,
957        request: ::connectrpc::Payload,
958        format: ::connectrpc::CodecFormat,
959    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
960        let Some(method) = path.strip_prefix("marketdata.v1.MarketDataService/") else {
961            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
962        };
963        let _ = (&ctx, &request, &format);
964        match method {
965            "GetTrades" => {
966                let svc = ::std::sync::Arc::clone(&self.inner);
967                Box::pin(async move {
968                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
969                        crate::proto::marketdata::v1::GetTradesRequest,
970                    >(request.encoded()?, format)?;
971                    let req: crate::proto::marketdata::v1::__buffa::view::GetTradesRequestView<
972                        '_,
973                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
974                        &body,
975                    )?;
976                    let req = ::connectrpc::ServiceRequest::<
977                        crate::proto::marketdata::v1::GetTradesRequest,
978                    >::from_parts(&req, &body);
979                    svc.get_trades(ctx, req)
980                        .await?
981                        .encode::<
982                            crate::proto::marketdata::v1::GetTradesResponse,
983                        >(format)
984                })
985            }
986            "GetCandles" => {
987                let svc = ::std::sync::Arc::clone(&self.inner);
988                Box::pin(async move {
989                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
990                        crate::proto::marketdata::v1::GetCandlesRequest,
991                    >(request.encoded()?, format)?;
992                    let req: crate::proto::marketdata::v1::__buffa::view::GetCandlesRequestView<
993                        '_,
994                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
995                        &body,
996                    )?;
997                    let req = ::connectrpc::ServiceRequest::<
998                        crate::proto::marketdata::v1::GetCandlesRequest,
999                    >::from_parts(&req, &body);
1000                    svc.get_candles(ctx, req)
1001                        .await?
1002                        .encode::<
1003                            crate::proto::marketdata::v1::GetCandlesResponse,
1004                        >(format)
1005                })
1006            }
1007            "GetCandlesColumns" => {
1008                let svc = ::std::sync::Arc::clone(&self.inner);
1009                Box::pin(async move {
1010                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
1011                        crate::proto::marketdata::v1::GetCandlesColumnsRequest,
1012                    >(request.encoded()?, format)?;
1013                    let req: crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsRequestView<
1014                        '_,
1015                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
1016                        &body,
1017                    )?;
1018                    let req = ::connectrpc::ServiceRequest::<
1019                        crate::proto::marketdata::v1::GetCandlesColumnsRequest,
1020                    >::from_parts(&req, &body);
1021                    svc.get_candles_columns(ctx, req)
1022                        .await?
1023                        .encode::<
1024                            crate::proto::marketdata::v1::GetCandlesColumnsResponse,
1025                        >(format)
1026                })
1027            }
1028            "GetSpotConfig" => {
1029                let svc = ::std::sync::Arc::clone(&self.inner);
1030                Box::pin(async move {
1031                    let body = ::connectrpc::dispatcher::codegen::request_proto_bytes::<
1032                        crate::proto::marketdata::v1::GetSpotConfigRequest,
1033                    >(request.encoded()?, format)?;
1034                    let req: crate::proto::marketdata::v1::__buffa::view::GetSpotConfigRequestView<
1035                        '_,
1036                    > = ::connectrpc::dispatcher::codegen::decode_borrowed_request_view(
1037                        &body,
1038                    )?;
1039                    let req = ::connectrpc::ServiceRequest::<
1040                        crate::proto::marketdata::v1::GetSpotConfigRequest,
1041                    >::from_parts(&req, &body);
1042                    svc.get_spot_config(ctx, req)
1043                        .await?
1044                        .encode::<
1045                            crate::proto::marketdata::v1::GetSpotConfigResponse,
1046                        >(format)
1047                })
1048            }
1049            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
1050        }
1051    }
1052    fn call_server_streaming(
1053        &self,
1054        path: &str,
1055        ctx: ::connectrpc::RequestContext,
1056        request: ::buffa::bytes::Bytes,
1057        format: ::connectrpc::CodecFormat,
1058    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
1059        let Some(method) = path.strip_prefix("marketdata.v1.MarketDataService/") else {
1060            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
1061        };
1062        let _ = (&ctx, &request, &format);
1063        match method {
1064            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
1065        }
1066    }
1067    fn call_client_streaming(
1068        &self,
1069        path: &str,
1070        ctx: ::connectrpc::RequestContext,
1071        requests: ::connectrpc::dispatcher::codegen::RequestStream,
1072        format: ::connectrpc::CodecFormat,
1073    ) -> ::connectrpc::dispatcher::codegen::UnaryResult {
1074        let Some(method) = path.strip_prefix("marketdata.v1.MarketDataService/") else {
1075            return ::connectrpc::dispatcher::codegen::unimplemented_unary(path);
1076        };
1077        let _ = (&ctx, &requests, &format);
1078        match method {
1079            _ => ::connectrpc::dispatcher::codegen::unimplemented_unary(path),
1080        }
1081    }
1082    fn call_bidi_streaming(
1083        &self,
1084        path: &str,
1085        ctx: ::connectrpc::RequestContext,
1086        requests: ::connectrpc::dispatcher::codegen::RequestStream,
1087        format: ::connectrpc::CodecFormat,
1088    ) -> ::connectrpc::dispatcher::codegen::StreamingResult {
1089        let Some(method) = path.strip_prefix("marketdata.v1.MarketDataService/") else {
1090            return ::connectrpc::dispatcher::codegen::unimplemented_streaming(path);
1091        };
1092        let _ = (&ctx, &requests, &format);
1093        match method {
1094            _ => ::connectrpc::dispatcher::codegen::unimplemented_streaming(path),
1095        }
1096    }
1097}
1098/// Client for this service.
1099///
1100/// Generic over `T: ClientTransport`. For **gRPC** (HTTP/2), use
1101/// `Http2Connection` — it has honest `poll_ready` and composes with
1102/// `tower::balance` for multi-connection load balancing. For **Connect
1103/// over HTTP/1.1** (or unknown protocol), use `HttpClient`.
1104///
1105/// # Working with the response
1106///
1107/// Unary calls return [`UnaryResponse<OwnedView<FooView>>`](::connectrpc::client::UnaryResponse).
1108/// [`view()`](::connectrpc::client::UnaryResponse::view) borrows the response
1109/// message, so field access is zero-copy:
1110///
1111/// ```rust,ignore
1112/// let resp = client.get_trades(request).await?;
1113/// let name: &str = resp.view().name;  // borrow into the response buffer
1114/// ```
1115///
1116/// If you need the owned struct (e.g. to store or pass by value), use
1117/// [`into_owned()`](::connectrpc::client::UnaryResponse::into_owned):
1118///
1119/// ```rust,ignore
1120/// let owned = client.get_trades(request).await?.into_owned();
1121/// ```
1122///
1123/// [`into_view()`](::connectrpc::client::UnaryResponse::into_view) keeps the
1124/// zero-copy decoded body (an `OwnedView`) without copying; field access on it
1125/// goes through `.reborrow()`. Streaming responses yield one
1126/// [`StreamMessage`](::connectrpc::StreamMessage) per received message from
1127/// `.message().await` — read fields zero-copy through the generated accessor
1128/// methods (`msg.name()`) or `.view()`, or convert with `.to_owned_message()`.
1129#[derive(Clone)]
1130pub struct MarketDataServiceClient<T> {
1131    transport: T,
1132    config: ::connectrpc::client::ClientConfig,
1133}
1134impl<T> MarketDataServiceClient<T>
1135where
1136    T: ::connectrpc::client::ClientTransport,
1137    <T::ResponseBody as ::connectrpc::http_body::Body>::Error: ::std::fmt::Display,
1138{
1139    /// Create a new client with the given transport and configuration.
1140    pub fn new(transport: T, config: ::connectrpc::client::ClientConfig) -> Self {
1141        Self { transport, config }
1142    }
1143    /// Get the client configuration.
1144    pub fn config(&self) -> &::connectrpc::client::ClientConfig {
1145        &self.config
1146    }
1147    /// Get a mutable reference to the client configuration.
1148    pub fn config_mut(&mut self) -> &mut ::connectrpc::client::ClientConfig {
1149        &mut self.config
1150    }
1151    /// Call the GetTrades RPC. Sends a request to /marketdata.v1.MarketDataService/GetTrades.
1152    pub async fn get_trades(
1153        &self,
1154        request: crate::proto::marketdata::v1::GetTradesRequest,
1155    ) -> Result<
1156        ::connectrpc::client::UnaryResponse<
1157            ::buffa::view::OwnedView<
1158                crate::proto::marketdata::v1::__buffa::view::GetTradesResponseView<
1159                    'static,
1160                >,
1161            >,
1162        >,
1163        ::connectrpc::ConnectError,
1164    > {
1165        self.get_trades_with_options(
1166                request,
1167                ::connectrpc::client::CallOptions::default(),
1168            )
1169            .await
1170    }
1171    /// Call the GetTrades RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
1172    pub async fn get_trades_with_options(
1173        &self,
1174        request: crate::proto::marketdata::v1::GetTradesRequest,
1175        options: ::connectrpc::client::CallOptions,
1176    ) -> Result<
1177        ::connectrpc::client::UnaryResponse<
1178            ::buffa::view::OwnedView<
1179                crate::proto::marketdata::v1::__buffa::view::GetTradesResponseView<
1180                    'static,
1181                >,
1182            >,
1183        >,
1184        ::connectrpc::ConnectError,
1185    > {
1186        ::connectrpc::client::call_unary(
1187                &self.transport,
1188                &self.config,
1189                MARKET_DATA_SERVICE_SERVICE_NAME,
1190                "GetTrades",
1191                request,
1192                options,
1193            )
1194            .await
1195    }
1196    /// Call the GetCandles RPC. Sends a request to /marketdata.v1.MarketDataService/GetCandles.
1197    pub async fn get_candles(
1198        &self,
1199        request: crate::proto::marketdata::v1::GetCandlesRequest,
1200    ) -> Result<
1201        ::connectrpc::client::UnaryResponse<
1202            ::buffa::view::OwnedView<
1203                crate::proto::marketdata::v1::__buffa::view::GetCandlesResponseView<
1204                    'static,
1205                >,
1206            >,
1207        >,
1208        ::connectrpc::ConnectError,
1209    > {
1210        self.get_candles_with_options(
1211                request,
1212                ::connectrpc::client::CallOptions::default(),
1213            )
1214            .await
1215    }
1216    /// Call the GetCandles RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
1217    pub async fn get_candles_with_options(
1218        &self,
1219        request: crate::proto::marketdata::v1::GetCandlesRequest,
1220        options: ::connectrpc::client::CallOptions,
1221    ) -> Result<
1222        ::connectrpc::client::UnaryResponse<
1223            ::buffa::view::OwnedView<
1224                crate::proto::marketdata::v1::__buffa::view::GetCandlesResponseView<
1225                    'static,
1226                >,
1227            >,
1228        >,
1229        ::connectrpc::ConnectError,
1230    > {
1231        ::connectrpc::client::call_unary(
1232                &self.transport,
1233                &self.config,
1234                MARKET_DATA_SERVICE_SERVICE_NAME,
1235                "GetCandles",
1236                request,
1237                options,
1238            )
1239            .await
1240    }
1241    /// Call the GetCandlesColumns RPC. Sends a request to /marketdata.v1.MarketDataService/GetCandlesColumns.
1242    pub async fn get_candles_columns(
1243        &self,
1244        request: crate::proto::marketdata::v1::GetCandlesColumnsRequest,
1245    ) -> Result<
1246        ::connectrpc::client::UnaryResponse<
1247            ::buffa::view::OwnedView<
1248                crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsResponseView<
1249                    'static,
1250                >,
1251            >,
1252        >,
1253        ::connectrpc::ConnectError,
1254    > {
1255        self.get_candles_columns_with_options(
1256                request,
1257                ::connectrpc::client::CallOptions::default(),
1258            )
1259            .await
1260    }
1261    /// Call the GetCandlesColumns RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
1262    pub async fn get_candles_columns_with_options(
1263        &self,
1264        request: crate::proto::marketdata::v1::GetCandlesColumnsRequest,
1265        options: ::connectrpc::client::CallOptions,
1266    ) -> Result<
1267        ::connectrpc::client::UnaryResponse<
1268            ::buffa::view::OwnedView<
1269                crate::proto::marketdata::v1::__buffa::view::GetCandlesColumnsResponseView<
1270                    'static,
1271                >,
1272            >,
1273        >,
1274        ::connectrpc::ConnectError,
1275    > {
1276        ::connectrpc::client::call_unary(
1277                &self.transport,
1278                &self.config,
1279                MARKET_DATA_SERVICE_SERVICE_NAME,
1280                "GetCandlesColumns",
1281                request,
1282                options,
1283            )
1284            .await
1285    }
1286    /// Call the GetSpotConfig RPC. Sends a request to /marketdata.v1.MarketDataService/GetSpotConfig.
1287    pub async fn get_spot_config(
1288        &self,
1289        request: crate::proto::marketdata::v1::GetSpotConfigRequest,
1290    ) -> Result<
1291        ::connectrpc::client::UnaryResponse<
1292            ::buffa::view::OwnedView<
1293                crate::proto::marketdata::v1::__buffa::view::GetSpotConfigResponseView<
1294                    'static,
1295                >,
1296            >,
1297        >,
1298        ::connectrpc::ConnectError,
1299    > {
1300        self.get_spot_config_with_options(
1301                request,
1302                ::connectrpc::client::CallOptions::default(),
1303            )
1304            .await
1305    }
1306    /// Call the GetSpotConfig RPC with explicit per-call options. Options override [`ClientConfig`](::connectrpc::client::ClientConfig) defaults.
1307    pub async fn get_spot_config_with_options(
1308        &self,
1309        request: crate::proto::marketdata::v1::GetSpotConfigRequest,
1310        options: ::connectrpc::client::CallOptions,
1311    ) -> Result<
1312        ::connectrpc::client::UnaryResponse<
1313            ::buffa::view::OwnedView<
1314                crate::proto::marketdata::v1::__buffa::view::GetSpotConfigResponseView<
1315                    'static,
1316                >,
1317            >,
1318        >,
1319        ::connectrpc::ConnectError,
1320    > {
1321        ::connectrpc::client::call_unary(
1322                &self.transport,
1323                &self.config,
1324                MARKET_DATA_SERVICE_SERVICE_NAME,
1325                "GetSpotConfig",
1326                request,
1327                options,
1328            )
1329            .await
1330    }
1331}