pub trait DapiRequest {
type Response;
// Required method
fn execute<'c, D: DapiRequestExecutor>(
self,
dapi_client: &'c D,
settings: RequestSettings,
) -> BoxFuture<'c, ExecutionResult<Self::Response, DapiClientError>>
where Self: 'c;
}Expand description
A DAPI request could be executed with an initialized DapiClient.
§Examples
Requires the mocks feature.
use rs_dapi_client::{RequestSettings, AddressList, mock::MockDapiClient, DapiClientError, DapiRequest, ExecutionError};
use dapi_grpc::platform::v0::{self as proto};
let mut client = MockDapiClient::new();
let request: proto::GetIdentityRequest = proto::get_identity_request::GetIdentityRequestV0 { id: b"0".to_vec(), prove: true }.into();
let response = request.execute(&mut client, RequestSettings::default()).await?;Required Associated Types§
Required Methods§
Sourcefn execute<'c, D: DapiRequestExecutor>(
self,
dapi_client: &'c D,
settings: RequestSettings,
) -> BoxFuture<'c, ExecutionResult<Self::Response, DapiClientError>>where
Self: 'c,
fn execute<'c, D: DapiRequestExecutor>(
self,
dapi_client: &'c D,
settings: RequestSettings,
) -> BoxFuture<'c, ExecutionResult<Self::Response, DapiClientError>>where
Self: 'c,
Executes the request.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<T: TransportRequest + Send> DapiRequest for T
The trait is intentionally made sealed since it defines what is possible to send to DAPI.
impl<T: TransportRequest + Send> DapiRequest for T
The trait is intentionally made sealed since it defines what is possible to send to DAPI.