Skip to main content

check_stream_interface

Function check_stream_interface 

Source
pub fn check_stream_interface(
    name: &str,
    version: &str,
    contracts: Option<&WitContracts>,
    level: &WitLevel,
) -> Result<(), RuntimeError>
Expand description

Checks a runtime: driver artifact’s imports against the stream interface of the WIT level this host serves.

Refuses a component importing any murmur:text/* instance, or any murmur:stream/* instance other than exactly murmur:stream/events at the version level lists (for the served level, WIT_STREAM_EVENTS_IFACE): the host serves neither, so the driver would fail to instantiate on its first turn. The imports among those that do not fit level are refused with RuntimeError::WitLevelMismatch; only when every one is at the level’s version of its package, under an interface name that does not exist, is it RuntimeError::DriverStreamInterfaceNotServed. contracts is what murmur_artifact::extract_wit_contracts read out of the driver’s wasm; None, and a component importing neither package, pass.