pub trait Contract {
type Input: RkyvEncode + Send;
type Output: RkyvEncode + Send;
// Required method
fn to_future(
&self,
caller: &mut Caller<'_, InstanceRegistry>,
input: Self::Input,
) -> impl Future<Output = GuestResult<Self::Output>> + Send + 'static;
}Expand description
Contract is used by kernel drivers to define a consistent method for guest execution.
This allows Operations to expose the driver contract to the guest without having
to know its internal structure.
Required Associated Types§
type Input: RkyvEncode + Send
type Output: RkyvEncode + Send
Required Methods§
fn to_future( &self, caller: &mut Caller<'_, InstanceRegistry>, input: Self::Input, ) -> impl Future<Output = GuestResult<Self::Output>> + Send + 'static
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.