pub trait RemoteCapabilityInvoker: Send + Sync {
// Required method
fn invoke_remote(
&self,
peer: &PeerRecord,
request: &CapabilityRequest,
) -> CapabilityResult<CapabilityResponse>;
// Provided method
fn invoke_remote_owned(
&self,
peer: &PeerRecord,
request: CapabilityRequest,
) -> CapabilityResult<CapabilityResponse> { ... }
}Expand description
Adapter used to invoke a capability hosted by a remote runtime peer.
Required Methods§
Sourcefn invoke_remote(
&self,
peer: &PeerRecord,
request: &CapabilityRequest,
) -> CapabilityResult<CapabilityResponse>
fn invoke_remote( &self, peer: &PeerRecord, request: &CapabilityRequest, ) -> CapabilityResult<CapabilityResponse>
Sends one request to the selected peer and returns its response.
Provided Methods§
Sourcefn invoke_remote_owned(
&self,
peer: &PeerRecord,
request: CapabilityRequest,
) -> CapabilityResult<CapabilityResponse>
fn invoke_remote_owned( &self, peer: &PeerRecord, request: CapabilityRequest, ) -> CapabilityResult<CapabilityResponse>
Consumes one request when the caller can transfer its payload ownership.
The default preserves compatibility with borrowed-only invokers. An implementation may override this method to move request fields into its transport without copying the opaque payload.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".