pub struct ChainAnalyticsServiceClient<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_zipped_asset_supply(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_zipped_asset_supply(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> ChainAnalyticsServiceClient<T>
impl<T> ChainAnalyticsServiceClient<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_zipped_asset_supply(
&self,
request: GetZippedAssetSupplyRequest,
) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyResponseView<'static>>>, ConnectError>
pub async fn get_zipped_asset_supply( &self, request: GetZippedAssetSupplyRequest, ) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyResponseView<'static>>>, ConnectError>
Call the GetZippedAssetSupply RPC. Sends a request to /chain.analytics.v1.ChainAnalyticsService/GetZippedAssetSupply.
Sourcepub async fn get_zipped_asset_supply_with_options(
&self,
request: GetZippedAssetSupplyRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyResponseView<'static>>>, ConnectError>
pub async fn get_zipped_asset_supply_with_options( &self, request: GetZippedAssetSupplyRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyResponseView<'static>>>, ConnectError>
Call the GetZippedAssetSupply RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_zipped_asset_supply_group(
&self,
request: GetZippedAssetSupplyGroupRequest,
) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyGroupResponseView<'static>>>, ConnectError>
pub async fn get_zipped_asset_supply_group( &self, request: GetZippedAssetSupplyGroupRequest, ) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyGroupResponseView<'static>>>, ConnectError>
Call the GetZippedAssetSupplyGroup RPC. Sends a request to /chain.analytics.v1.ChainAnalyticsService/GetZippedAssetSupplyGroup.
Sourcepub async fn get_zipped_asset_supply_group_with_options(
&self,
request: GetZippedAssetSupplyGroupRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyGroupResponseView<'static>>>, ConnectError>
pub async fn get_zipped_asset_supply_group_with_options( &self, request: GetZippedAssetSupplyGroupRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetZippedAssetSupplyGroupResponseView<'static>>>, ConnectError>
Call the GetZippedAssetSupplyGroup RPC with explicit per-call options. Options override ClientConfig defaults.
Sourcepub async fn get_unified_asset_balances(
&self,
request: GetUnifiedAssetBalancesRequest,
) -> Result<UnaryResponse<OwnedView<GetUnifiedAssetBalancesResponseView<'static>>>, ConnectError>
pub async fn get_unified_asset_balances( &self, request: GetUnifiedAssetBalancesRequest, ) -> Result<UnaryResponse<OwnedView<GetUnifiedAssetBalancesResponseView<'static>>>, ConnectError>
Call the GetUnifiedAssetBalances RPC. Sends a request to /chain.analytics.v1.ChainAnalyticsService/GetUnifiedAssetBalances.
Sourcepub async fn get_unified_asset_balances_with_options(
&self,
request: GetUnifiedAssetBalancesRequest,
options: CallOptions,
) -> Result<UnaryResponse<OwnedView<GetUnifiedAssetBalancesResponseView<'static>>>, ConnectError>
pub async fn get_unified_asset_balances_with_options( &self, request: GetUnifiedAssetBalancesRequest, options: CallOptions, ) -> Result<UnaryResponse<OwnedView<GetUnifiedAssetBalancesResponseView<'static>>>, ConnectError>
Call the GetUnifiedAssetBalances RPC with explicit per-call options. Options override ClientConfig defaults.
Trait Implementations§
Source§impl<T: Clone> Clone for ChainAnalyticsServiceClient<T>
impl<T: Clone> Clone for ChainAnalyticsServiceClient<T>
Source§fn clone(&self) -> ChainAnalyticsServiceClient<T>
fn clone(&self) -> ChainAnalyticsServiceClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more