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 { ... }
}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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".