pub trait ChannelContract:
Clone
+ Send
+ Sync
+ 'static {
type Input: Send + 'static;
type Output: Send + 'static;
type StatusResponse: Send + 'static;
type CancelResponse: Send + 'static;
const TRANSPORT: Transport;
const ID: &'static str = "";
const MODE: &'static str = "rpc";
const SERVICE: &'static str = "";
const METHOD: &'static str = "";
const IDL: &'static str = "";
// Required method
fn invoke(
channel: Channel<Self>,
request: Self::Input,
) -> impl Future<Output = Result<Self::Output>> + Send;
// Provided methods
fn matches_contract(contract: &ContractDescriptor) -> bool { ... }
fn validate_companion(
_contract: &ContractDescriptor,
_status: bool,
) -> Result<()> { ... }
fn validate_input(_request: &Self::Input) -> Result<()> { ... }
fn execution(_response: &Self::Output) -> Result<(bool, String)> { ... }
fn status(
_channel: Channel<Self>,
) -> impl Future<Output = Result<Self::StatusResponse>> + Send { ... }
fn cancel(
_channel: Channel<Self>,
) -> impl Future<Output = Result<Self::CancelResponse>> + Send { ... }
fn status_state(_response: &Self::StatusResponse) -> Result<&str> { ... }
}Expand description
Compile-time message types and communication for one capability contract.
Required Associated Constants§
Provided Associated Constants§
Sourceconst ID: &'static str = ""
const ID: &'static str = ""
Contract ID fixed by the binding; empty when selected at connection time.
const MODE: &'static str = "rpc"
const SERVICE: &'static str = ""
const METHOD: &'static str = ""
const IDL: &'static str = ""
Required Associated Types§
type Input: Send + 'static
type Output: Send + 'static
type StatusResponse: Send + 'static
type CancelResponse: Send + 'static
Required Methods§
fn invoke( channel: Channel<Self>, request: Self::Input, ) -> impl Future<Output = Result<Self::Output>> + Send
Provided Methods§
fn matches_contract(contract: &ContractDescriptor) -> bool
fn validate_companion( _contract: &ContractDescriptor, _status: bool, ) -> Result<()>
fn validate_input(_request: &Self::Input) -> Result<()>
fn execution(_response: &Self::Output) -> Result<(bool, String)>
fn status( _channel: Channel<Self>, ) -> impl Future<Output = Result<Self::StatusResponse>> + Send
fn cancel( _channel: Channel<Self>, ) -> impl Future<Output = Result<Self::CancelResponse>> + Send
fn status_state(_response: &Self::StatusResponse) -> Result<&str>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".