pub trait TransportRequest:
Clone
+ Send
+ Sync
+ Debug
+ Mockable {
type Client: TransportClient;
type Response: Mockable + Send + Debug;
const SETTINGS_OVERRIDES: RequestSettings;
// Required methods
fn method_name(&self) -> &'static str;
fn execute_transport<'c>(
self,
client: &'c mut Self::Client,
settings: &AppliedRequestSettings,
) -> BoxFuture<'c, Result<Self::Response, TransportError>>;
// Provided methods
fn request_name(&self) -> &'static str { ... }
fn response_name(&self) -> &'static str { ... }
fn names_nothing(&self) -> Option<&'static str> { ... }
}Expand description
Generic transport layer request. Requires Clone as could be retried and a client in general consumes a request.
Required Associated Constants§
Sourceconst SETTINGS_OVERRIDES: RequestSettings
const SETTINGS_OVERRIDES: RequestSettings
Settings that will override DapiClient’s ones each time the request is executed.
Required Associated Types§
Sourcetype Client: TransportClient
type Client: TransportClient
A client specific to this type of transport.
Required Methods§
Sourcefn method_name(&self) -> &'static str
fn method_name(&self) -> &'static str
gRPC method name
Sourcefn execute_transport<'c>(
self,
client: &'c mut Self::Client,
settings: &AppliedRequestSettings,
) -> BoxFuture<'c, Result<Self::Response, TransportError>>
fn execute_transport<'c>( self, client: &'c mut Self::Client, settings: &AppliedRequestSettings, ) -> BoxFuture<'c, Result<Self::Response, TransportError>>
Perform transport request asynchronously.
Provided Methods§
Sourcefn request_name(&self) -> &'static str
fn request_name(&self) -> &'static str
gRPC request name
Sourcefn response_name(&self) -> &'static str
fn response_name(&self) -> &'static str
gRPC response name
Sourcefn names_nothing(&self) -> Option<&'static str>
fn names_nothing(&self) -> Option<&'static str>
When the request asks a proof of nothing (an empty id list), the INVALID_ARGUMENT message every node refuses it with. DapiClient then refuses it the same way without sending it: a node released before that refusal answers with an internal error, or with a proof of nothing the client cannot verify, and either one gets the node banned and the request sent to the next. Without a proof, nodes answer an empty list with an empty result, so the request is sent.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".