pub struct LedgerReadServiceClient<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_balance_history(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_balance_history(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> LedgerReadServiceClient<T>
impl<T> LedgerReadServiceClient<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_balance_history(
&self,
request: GetBalanceHistoryRequest,
) -> Result<UnaryResponse<OwnedView<GetBalanceHistoryResponseView<'static>>>, ConnectError>
pub async fn get_balance_history( &self, request: GetBalanceHistoryRequest, ) -> Result<UnaryResponse<OwnedView<GetBalanceHistoryResponseView<'static>>>, ConnectError>
Call the GetBalanceHistory RPC. Sends a request to /ledger.read.v1.LedgerReadService/GetBalanceHistory.
Sourcepub async fn get_balance_history_with_options(
&self,
request: GetBalanceHistoryRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetBalanceHistoryResponseView<'static>>>, ConnectError>
pub async fn get_balance_history_with_options( &self, request: GetBalanceHistoryRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetBalanceHistoryResponseView<'static>>>, ConnectError>
Call the GetBalanceHistory RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_equity_history_series(
&self,
request: GetEquityHistorySeriesRequest,
) -> Result<UnaryResponse<OwnedView<GetEquityHistorySeriesResponseView<'static>>>, ConnectError>
pub async fn get_equity_history_series( &self, request: GetEquityHistorySeriesRequest, ) -> Result<UnaryResponse<OwnedView<GetEquityHistorySeriesResponseView<'static>>>, ConnectError>
Call the GetEquityHistorySeries RPC. Sends a request to /ledger.read.v1.LedgerReadService/GetEquityHistorySeries.
Sourcepub async fn get_equity_history_series_with_options(
&self,
request: GetEquityHistorySeriesRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetEquityHistorySeriesResponseView<'static>>>, ConnectError>
pub async fn get_equity_history_series_with_options( &self, request: GetEquityHistorySeriesRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetEquityHistorySeriesResponseView<'static>>>, ConnectError>
Call the GetEquityHistorySeries RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn list_transfers(
&self,
request: ListTransfersRequest,
) -> Result<UnaryResponse<OwnedView<ListTransfersResponseView<'static>>>, ConnectError>
pub async fn list_transfers( &self, request: ListTransfersRequest, ) -> Result<UnaryResponse<OwnedView<ListTransfersResponseView<'static>>>, ConnectError>
Call the ListTransfers RPC. Sends a request to /ledger.read.v1.LedgerReadService/ListTransfers.
Sourcepub async fn list_transfers_with_options(
&self,
request: ListTransfersRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<ListTransfersResponseView<'static>>>, ConnectError>
pub async fn list_transfers_with_options( &self, request: ListTransfersRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<ListTransfersResponseView<'static>>>, ConnectError>
Call the ListTransfers RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn list_holds(
&self,
request: ListHoldsRequest,
) -> Result<UnaryResponse<OwnedView<ListHoldsResponseView<'static>>>, ConnectError>
pub async fn list_holds( &self, request: ListHoldsRequest, ) -> Result<UnaryResponse<OwnedView<ListHoldsResponseView<'static>>>, ConnectError>
Call the ListHolds RPC. Sends a request to /ledger.read.v1.LedgerReadService/ListHolds.
Sourcepub async fn list_holds_with_options(
&self,
request: ListHoldsRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<ListHoldsResponseView<'static>>>, ConnectError>
pub async fn list_holds_with_options( &self, request: ListHoldsRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<ListHoldsResponseView<'static>>>, ConnectError>
Call the ListHolds RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_balances(
&self,
request: GetBalancesRequest,
) -> Result<UnaryResponse<OwnedView<GetBalancesResponseView<'static>>>, ConnectError>
pub async fn get_balances( &self, request: GetBalancesRequest, ) -> Result<UnaryResponse<OwnedView<GetBalancesResponseView<'static>>>, ConnectError>
Call the GetBalances RPC. Sends a request to /ledger.read.v1.LedgerReadService/GetBalances.
Sourcepub async fn get_balances_with_options(
&self,
request: GetBalancesRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetBalancesResponseView<'static>>>, ConnectError>
pub async fn get_balances_with_options( &self, request: GetBalancesRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetBalancesResponseView<'static>>>, ConnectError>
Call the GetBalances RPC with explicit per-call options. Options override ClientConfig defaults.
Trait Implementations§
Source§impl<T: Clone> Clone for LedgerReadServiceClient<T>
impl<T: Clone> Clone for LedgerReadServiceClient<T>
Source§fn clone(&self) -> LedgerReadServiceClient<T>
fn clone(&self) -> LedgerReadServiceClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more