#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BarsRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(enumeration = "TimeFrame", tag = "2")]
pub timeframe: i32,
#[prost(message, optional, tag = "3")]
pub interval: ::core::option::Option<
super::super::super::super::google::r#type::Interval,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BarsResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub bars: ::prost::alloc::vec::Vec<Bar>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QuoteRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct QuoteResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub quote: ::core::option::Option<Quote>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OrderBookRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderBookResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub orderbook: ::core::option::Option<OrderBook>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LatestTradesRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LatestTradesResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub trades: ::prost::alloc::vec::Vec<Trade>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SubscribeQuoteRequest {
#[prost(string, repeated, tag = "1")]
pub symbols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeQuoteResponse {
#[prost(message, repeated, tag = "1")]
pub quote: ::prost::alloc::vec::Vec<Quote>,
#[prost(message, optional, tag = "2")]
pub error: ::core::option::Option<StreamError>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SubscribeOrderBookRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeOrderBookResponse {
#[prost(message, repeated, tag = "1")]
pub order_book: ::prost::alloc::vec::Vec<StreamOrderBook>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SubscribeBarsRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(enumeration = "TimeFrame", tag = "2")]
pub timeframe: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeBarsResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub bars: ::prost::alloc::vec::Vec<Bar>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Bar {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub open: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "3")]
pub high: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "4")]
pub low: ::core::option::Option<super::super::super::super::google::r#type::Decimal>,
#[prost(message, optional, tag = "5")]
pub close: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "6")]
pub volume: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Quote {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub ask: ::core::option::Option<super::super::super::super::google::r#type::Decimal>,
#[prost(message, optional, tag = "4")]
pub ask_size: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "5")]
pub bid: ::core::option::Option<super::super::super::super::google::r#type::Decimal>,
#[prost(message, optional, tag = "6")]
pub bid_size: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "7")]
pub last: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "8")]
pub last_size: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "9")]
pub volume: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "10")]
pub turnover: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "11")]
pub open: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "12")]
pub high: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "13")]
pub low: ::core::option::Option<super::super::super::super::google::r#type::Decimal>,
#[prost(message, optional, tag = "14")]
pub close: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "15")]
pub change: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "16")]
pub open_interest: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(oneof = "quote::Additions", tags = "50")]
pub additions: ::core::option::Option<quote::Additions>,
}
pub mod quote {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Option {
#[prost(message, optional, tag = "1")]
pub open_interest: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "2")]
pub implied_volatility: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "3")]
pub theoretical_price: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "4")]
pub delta: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "5")]
pub gamma: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "6")]
pub theta: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "7")]
pub vega: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "8")]
pub rho: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Additions {
#[prost(message, tag = "50")]
Option(Option),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderBook {
#[prost(message, repeated, tag = "1")]
pub rows: ::prost::alloc::vec::Vec<order_book::Row>,
}
pub mod order_book {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Row {
#[prost(message, optional, tag = "1")]
pub price: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(enumeration = "row::Action", tag = "4")]
pub action: i32,
#[prost(string, tag = "5")]
pub mpid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "row::Side", tags = "2, 3")]
pub side: ::core::option::Option<row::Side>,
}
pub mod row {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Action {
Unspecified = 0,
Remove = 1,
Add = 2,
Update = 3,
}
impl Action {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "ACTION_UNSPECIFIED",
Self::Remove => "ACTION_REMOVE",
Self::Add => "ACTION_ADD",
Self::Update => "ACTION_UPDATE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACTION_UNSPECIFIED" => Some(Self::Unspecified),
"ACTION_REMOVE" => Some(Self::Remove),
"ACTION_ADD" => Some(Self::Add),
"ACTION_UPDATE" => Some(Self::Update),
_ => None,
}
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Side {
#[prost(message, tag = "2")]
SellSize(super::super::super::super::super::super::google::r#type::Decimal),
#[prost(message, tag = "3")]
BuySize(super::super::super::super::super::super::google::r#type::Decimal),
}
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Trade {
#[prost(string, tag = "1")]
pub trade_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub mpid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub price: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(message, optional, tag = "5")]
pub size: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
#[prost(enumeration = "super::Side", tag = "6")]
pub side: i32,
#[prost(message, optional, tag = "7")]
pub open_interest: ::core::option::Option<
super::super::super::super::google::r#type::Decimal,
>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StreamError {
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub description: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamOrderBook {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub rows: ::prost::alloc::vec::Vec<stream_order_book::Row>,
}
pub mod stream_order_book {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Row {
#[prost(message, optional, tag = "1")]
pub price: ::core::option::Option<
super::super::super::super::super::google::r#type::Decimal,
>,
#[prost(enumeration = "row::Action", tag = "4")]
pub action: i32,
#[prost(string, tag = "5")]
pub mpid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "row::Side", tags = "2, 3")]
pub side: ::core::option::Option<row::Side>,
}
pub mod row {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Action {
Unspecified = 0,
Remove = 1,
Add = 2,
Update = 3,
}
impl Action {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "ACTION_UNSPECIFIED",
Self::Remove => "ACTION_REMOVE",
Self::Add => "ACTION_ADD",
Self::Update => "ACTION_UPDATE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ACTION_UNSPECIFIED" => Some(Self::Unspecified),
"ACTION_REMOVE" => Some(Self::Remove),
"ACTION_ADD" => Some(Self::Add),
"ACTION_UPDATE" => Some(Self::Update),
_ => None,
}
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Side {
#[prost(message, tag = "2")]
SellSize(super::super::super::super::super::super::google::r#type::Decimal),
#[prost(message, tag = "3")]
BuySize(super::super::super::super::super::super::google::r#type::Decimal),
}
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SubscribeLatestTradesRequest {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubscribeLatestTradesResponse {
#[prost(string, tag = "1")]
pub symbol: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub trades: ::prost::alloc::vec::Vec<Trade>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TimeFrame {
Unspecified = 0,
M1 = 1,
M5 = 5,
M15 = 9,
M30 = 11,
H1 = 12,
H2 = 13,
H4 = 15,
H8 = 17,
D = 19,
W = 20,
Mn = 21,
Qr = 22,
}
impl TimeFrame {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "TIME_FRAME_UNSPECIFIED",
Self::M1 => "TIME_FRAME_M1",
Self::M5 => "TIME_FRAME_M5",
Self::M15 => "TIME_FRAME_M15",
Self::M30 => "TIME_FRAME_M30",
Self::H1 => "TIME_FRAME_H1",
Self::H2 => "TIME_FRAME_H2",
Self::H4 => "TIME_FRAME_H4",
Self::H8 => "TIME_FRAME_H8",
Self::D => "TIME_FRAME_D",
Self::W => "TIME_FRAME_W",
Self::Mn => "TIME_FRAME_MN",
Self::Qr => "TIME_FRAME_QR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TIME_FRAME_UNSPECIFIED" => Some(Self::Unspecified),
"TIME_FRAME_M1" => Some(Self::M1),
"TIME_FRAME_M5" => Some(Self::M5),
"TIME_FRAME_M15" => Some(Self::M15),
"TIME_FRAME_M30" => Some(Self::M30),
"TIME_FRAME_H1" => Some(Self::H1),
"TIME_FRAME_H2" => Some(Self::H2),
"TIME_FRAME_H4" => Some(Self::H4),
"TIME_FRAME_H8" => Some(Self::H8),
"TIME_FRAME_D" => Some(Self::D),
"TIME_FRAME_W" => Some(Self::W),
"TIME_FRAME_MN" => Some(Self::Mn),
"TIME_FRAME_QR" => Some(Self::Qr),
_ => None,
}
}
}
pub mod market_data_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MarketDataServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MarketDataServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MarketDataServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> MarketDataServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
MarketDataServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn bars(
&mut self,
request: impl tonic::IntoRequest<super::BarsRequest>,
) -> std::result::Result<tonic::Response<super::BarsResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/Bars",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"Bars",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn last_quote(
&mut self,
request: impl tonic::IntoRequest<super::QuoteRequest>,
) -> std::result::Result<tonic::Response<super::QuoteResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/LastQuote",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"LastQuote",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn order_book(
&mut self,
request: impl tonic::IntoRequest<super::OrderBookRequest>,
) -> std::result::Result<
tonic::Response<super::OrderBookResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/OrderBook",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"OrderBook",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn latest_trades(
&mut self,
request: impl tonic::IntoRequest<super::LatestTradesRequest>,
) -> std::result::Result<
tonic::Response<super::LatestTradesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/LatestTrades",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"LatestTrades",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn subscribe_quote(
&mut self,
request: impl tonic::IntoRequest<super::SubscribeQuoteRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::SubscribeQuoteResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/SubscribeQuote",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"SubscribeQuote",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn subscribe_order_book(
&mut self,
request: impl tonic::IntoRequest<super::SubscribeOrderBookRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::SubscribeOrderBookResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/SubscribeOrderBook",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"SubscribeOrderBook",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn subscribe_latest_trades(
&mut self,
request: impl tonic::IntoRequest<super::SubscribeLatestTradesRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::SubscribeLatestTradesResponse>,
>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/SubscribeLatestTrades",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"SubscribeLatestTrades",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn subscribe_bars(
&mut self,
request: impl tonic::IntoRequest<super::SubscribeBarsRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::SubscribeBarsResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.tradeapi.v1.marketdata.MarketDataService/SubscribeBars",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"grpc.tradeapi.v1.marketdata.MarketDataService",
"SubscribeBars",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}