Skip to main content

Contract

Trait Contract 

Source
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§

Required Methods§

Source

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.

Implementors§

Source§

impl Contract for ChannelAttachDriver

Source§

impl Contract for ChannelDetachDriver

Source§

impl Contract for ChannelExportDriver

Source§

impl Contract for SingletonLookupDriver

Source§

impl Contract for SingletonRegisterDriver

Source§

impl Contract for TimeNowDriver

Source§

impl Contract for TimeSleepDriver

Source§

impl<Impl> Contract for ChannelCreateDriver<Impl>
where Impl: ChannelCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for ChannelDeleteDriver<Impl>
where Impl: ChannelCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for ChannelDowngradeStrongWriterDriver<Impl>
where Impl: ChannelCapability + Send + 'static,

Source§

impl<Impl> Contract for ChannelDrainDriver<Impl>
where Impl: ChannelCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for IoCreateReaderDriver<Impl>
where Impl: IoCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for IoCreateWriterDriver<Impl>
where Impl: IoCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for IoReadDriver<Impl>
where Impl: IoCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for IoWriteDriver<Impl>
where Impl: IoCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for AcceptDriver<Impl>
where Impl: NetCapability + Clone + Send + 'static, Impl::Handle: Send + Unpin, <Impl as NetCapability>::Reader: Send + Unpin, <Impl as NetCapability>::Writer: Send + Unpin,

Source§

impl<Impl> Contract for BindDriver<Impl>
where Impl: NetCapability + Clone + Send + 'static, Impl::Handle: Send + Unpin,

Source§

impl<Impl> Contract for ConnectDriver<Impl>
where Impl: NetCapability + Clone + Send + 'static, <Impl as NetCapability>::Reader: Send + Unpin, <Impl as NetCapability>::Writer: Send + Unpin,

Source§

impl<Impl> Contract for ProcessLogLookupDriver<Impl>
where Impl: ProcessLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for ProcessRegisterLogDriver<Impl>
where Impl: ProcessLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for ProcessStartDriver<Impl>
where Impl: ProcessLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for ProcessStopDriver<Impl>
where Impl: ProcessLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for SessionAddEntitlementDriver<Impl>
where Impl: SessionLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for SessionAddResourceDriver<Impl>
where Impl: SessionLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for SessionCreateDriver<Impl>
where Impl: SessionLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for SessionRemoveDriver<Impl>
where Impl: SessionLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for SessionRemoveEntitlementDriver<Impl>
where Impl: SessionLifecycleCapability + Clone + Send + 'static,

Source§

impl<Impl> Contract for SessionRemoveResourceDriver<Impl>
where Impl: SessionLifecycleCapability + Clone + Send + 'static,