pub struct AccessApiClient<T> { /* private fields */ }
Implementations§
Source§impl<T> AccessApiClient<T>where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + Send + Sync + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> AccessApiClient<T>where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + Send + Sync + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> AccessApiClient<InterceptedService<T, F>>where
F: Interceptor,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_gzip(self) -> Self
pub fn send_gzip(self) -> Self
Compress requests with gzip
.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_gzip(self) -> Self
pub fn accept_gzip(self) -> Self
Enable decompressing responses with gzip
.
Sourcepub async fn ping(
&mut self,
request: impl IntoRequest<PingRequest>,
) -> Result<Response<PingResponse>, Status>
pub async fn ping( &mut self, request: impl IntoRequest<PingRequest>, ) -> Result<Response<PingResponse>, Status>
The following is copied from https://docs.onflow.org/access-api/ You should also reference https://github.com/onflow/flow/blob/master/protobuf/flow/access/access.proto
pub async fn get_latest_block_header( &mut self, request: impl IntoRequest<GetLatestBlockHeaderRequest>, ) -> Result<Response<BlockHeaderResponse>, Status>
pub async fn get_block_header_by_id( &mut self, request: impl IntoRequest<GetBlockHeaderByIdRequest>, ) -> Result<Response<BlockHeaderResponse>, Status>
pub async fn get_block_header_by_height( &mut self, request: impl IntoRequest<GetBlockHeaderByHeightRequest>, ) -> Result<Response<BlockHeaderResponse>, Status>
pub async fn get_latest_block( &mut self, request: impl IntoRequest<GetLatestBlockRequest>, ) -> Result<Response<BlockResponse>, Status>
pub async fn get_block_by_id( &mut self, request: impl IntoRequest<GetBlockByIdRequest>, ) -> Result<Response<BlockResponse>, Status>
pub async fn get_block_by_height( &mut self, request: impl IntoRequest<GetBlockByHeightRequest>, ) -> Result<Response<BlockResponse>, Status>
pub async fn get_collection_by_id( &mut self, request: impl IntoRequest<GetCollectionByIdRequest>, ) -> Result<Response<CollectionResponse>, Status>
pub async fn send_transaction( &mut self, request: impl IntoRequest<SendTransactionRequest>, ) -> Result<Response<SendTransactionResponse>, Status>
pub async fn get_transaction( &mut self, request: impl IntoRequest<GetTransactionRequest>, ) -> Result<Response<TransactionResponse>, Status>
pub async fn get_transaction_result( &mut self, request: impl IntoRequest<GetTransactionRequest>, ) -> Result<Response<TransactionResultResponse>, Status>
pub async fn get_account_at_latest_block( &mut self, request: impl IntoRequest<GetAccountAtLatestBlockRequest>, ) -> Result<Response<AccountResponse>, Status>
pub async fn get_account_at_block_height( &mut self, request: impl IntoRequest<GetAccountAtBlockHeightRequest>, ) -> Result<Response<AccountResponse>, Status>
pub async fn execute_script_at_latest_block( &mut self, request: impl IntoRequest<ExecuteScriptAtLatestBlockRequest>, ) -> Result<Response<ExecuteScriptResponse>, Status>
pub async fn execute_script_at_block_id( &mut self, request: impl IntoRequest<ExecuteScriptAtBlockIdRequest>, ) -> Result<Response<ExecuteScriptResponse>, Status>
pub async fn execute_script_at_block_height( &mut self, request: impl IntoRequest<ExecuteScriptAtBlockHeightRequest>, ) -> Result<Response<ExecuteScriptResponse>, Status>
pub async fn get_events_for_height_range( &mut self, request: impl IntoRequest<GetEventsForHeightRangeRequest>, ) -> Result<Response<EventsResponse>, Status>
pub async fn get_events_for_block_i_ds( &mut self, request: impl IntoRequest<GetEventsForBlockIdsRequest>, ) -> Result<Response<EventsResponse>, Status>
pub async fn get_network_parameters( &mut self, request: impl IntoRequest<GetNetworkParametersRequest>, ) -> Result<Response<GetNetworkParametersResponse>, Status>
pub async fn get_latest_protocol_state_snapshot( &mut self, request: impl IntoRequest<GetLatestProtocolStateSnapshotRequest>, ) -> Result<Response<ProtocolStateSnapshotResponse>, Status>
pub async fn get_execution_result_for_block_id( &mut self, request: impl IntoRequest<GetExecutionResultForBlockIdRequest>, ) -> Result<Response<ExecutionResultForBlockIdResponse>, Status>
Trait Implementations§
Source§impl<T: Clone> Clone for AccessApiClient<T>
impl<T: Clone> Clone for AccessApiClient<T>
Source§fn clone(&self) -> AccessApiClient<T>
fn clone(&self) -> AccessApiClient<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for AccessApiClient<T>where
T: Freeze,
impl<T> RefUnwindSafe for AccessApiClient<T>where
T: RefUnwindSafe,
impl<T> Send for AccessApiClient<T>where
T: Send,
impl<T> Sync for AccessApiClient<T>where
T: Sync,
impl<T> Unpin for AccessApiClient<T>where
T: Unpin,
impl<T> UnwindSafe for AccessApiClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request