pub struct OrdersReadServiceClient<T> { /* private fields */ }Expand description
Client for this service.
Generic over T: ClientTransport. For gRPC (HTTP/2), use
Http2Connection — it has honest poll_ready and composes with
tower::balance for multi-connection load balancing. For Connect
over HTTP/1.1 (or unknown protocol), use HttpClient.
§Working with the response
Unary calls return UnaryResponse<OwnedView<FooView>>.
view() borrows the response
message, so field access is zero-copy:
let resp = client.get_open_orders(request).await?;
let name: &str = resp.view().name; // borrow into the response bufferIf you need the owned struct (e.g. to store or pass by value), use
into_owned():
let owned = client.get_open_orders(request).await?.into_owned();into_view() keeps the
zero-copy decoded body (an OwnedView) without copying; field access on it
goes through .reborrow(). Streaming responses yield one
StreamMessage per received message from
.message().await — read fields zero-copy through the generated accessor
methods (msg.name()) or .view(), or convert with .to_owned_message().
Implementations§
Source§impl<T> OrdersReadServiceClient<T>
impl<T> OrdersReadServiceClient<T>
Sourcepub fn new(transport: T, config: ClientConfig) -> Self
pub fn new(transport: T, config: ClientConfig) -> Self
Create a new client with the given transport and configuration.
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
Get the client configuration.
Sourcepub fn config_mut(&mut self) -> &mut ClientConfig
pub fn config_mut(&mut self) -> &mut ClientConfig
Get a mutable reference to the client configuration.
Sourcepub async fn get_open_orders(
&self,
request: GetOpenOrdersRequest,
) -> Result<UnaryResponse<OwnedView<GetOpenOrdersResponseView<'static>>>, ConnectError>
pub async fn get_open_orders( &self, request: GetOpenOrdersRequest, ) -> Result<UnaryResponse<OwnedView<GetOpenOrdersResponseView<'static>>>, ConnectError>
Call the GetOpenOrders RPC. Sends a request to /orders.v1.OrdersReadService/GetOpenOrders.
Sourcepub async fn get_open_orders_with_options(
&self,
request: GetOpenOrdersRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetOpenOrdersResponseView<'static>>>, ConnectError>
pub async fn get_open_orders_with_options( &self, request: GetOpenOrdersRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetOpenOrdersResponseView<'static>>>, ConnectError>
Call the GetOpenOrders RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_order_history(
&self,
request: GetOrderHistoryRequest,
) -> Result<UnaryResponse<OwnedView<GetOrderHistoryResponseView<'static>>>, ConnectError>
pub async fn get_order_history( &self, request: GetOrderHistoryRequest, ) -> Result<UnaryResponse<OwnedView<GetOrderHistoryResponseView<'static>>>, ConnectError>
Call the GetOrderHistory RPC. Sends a request to /orders.v1.OrdersReadService/GetOrderHistory.
Sourcepub async fn get_order_history_with_options(
&self,
request: GetOrderHistoryRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetOrderHistoryResponseView<'static>>>, ConnectError>
pub async fn get_order_history_with_options( &self, request: GetOrderHistoryRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetOrderHistoryResponseView<'static>>>, ConnectError>
Call the GetOrderHistory RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_user_trades(
&self,
request: GetUserTradesRequest,
) -> Result<UnaryResponse<OwnedView<GetUserTradesResponseView<'static>>>, ConnectError>
pub async fn get_user_trades( &self, request: GetUserTradesRequest, ) -> Result<UnaryResponse<OwnedView<GetUserTradesResponseView<'static>>>, ConnectError>
Call the GetUserTrades RPC. Sends a request to /orders.v1.OrdersReadService/GetUserTrades.
Sourcepub async fn get_user_trades_with_options(
&self,
request: GetUserTradesRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetUserTradesResponseView<'static>>>, ConnectError>
pub async fn get_user_trades_with_options( &self, request: GetUserTradesRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetUserTradesResponseView<'static>>>, ConnectError>
Call the GetUserTrades RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_order(
&self,
request: GetOrderRequest,
) -> Result<UnaryResponse<OwnedView<GetOrderResponseView<'static>>>, ConnectError>
pub async fn get_order( &self, request: GetOrderRequest, ) -> Result<UnaryResponse<OwnedView<GetOrderResponseView<'static>>>, ConnectError>
Call the GetOrder RPC. Sends a request to /orders.v1.OrdersReadService/GetOrder.
Sourcepub async fn get_order_with_options(
&self,
request: GetOrderRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetOrderResponseView<'static>>>, ConnectError>
pub async fn get_order_with_options( &self, request: GetOrderRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetOrderResponseView<'static>>>, ConnectError>
Call the GetOrder RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_batch_replace_status(
&self,
request: GetBatchReplaceStatusRequest,
) -> Result<UnaryResponse<OwnedView<GetBatchReplaceStatusResponseView<'static>>>, ConnectError>
pub async fn get_batch_replace_status( &self, request: GetBatchReplaceStatusRequest, ) -> Result<UnaryResponse<OwnedView<GetBatchReplaceStatusResponseView<'static>>>, ConnectError>
Call the GetBatchReplaceStatus RPC. Sends a request to /orders.v1.OrdersReadService/GetBatchReplaceStatus.
Sourcepub async fn get_batch_replace_status_with_options(
&self,
request: GetBatchReplaceStatusRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetBatchReplaceStatusResponseView<'static>>>, ConnectError>
pub async fn get_batch_replace_status_with_options( &self, request: GetBatchReplaceStatusRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetBatchReplaceStatusResponseView<'static>>>, ConnectError>
Call the GetBatchReplaceStatus RPC with explicit per-call options. Options override ClientConfig defaults.
Trait Implementations§
Source§impl<T: Clone> Clone for OrdersReadServiceClient<T>
impl<T: Clone> Clone for OrdersReadServiceClient<T>
Source§fn clone(&self) -> OrdersReadServiceClient<T>
fn clone(&self) -> OrdersReadServiceClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more