Skip to content

Should have the ability to select a world from a wit file with multiple worlds #202

@jsturtevant

Description

@jsturtevant

With a simple wit file like it not possible to select a world. The last one in the file is selected and used. So in the case the bindings are generated for queue-world.

package hyperlight:worlds;

interface http-interface {
    record request {
        params: list<string>
    }

    record response {
        body: string
    }

    handle-request: func(event: request) -> response;
}

interface queue-interface {
    record message {
        data: string
    }

    record output {
        messages: list<string>
    }

    handle-message: func(msg: message) -> output;
}

world http-world {
    export http-interface;
}

world queue-world {
    export queue-interface;
}

For instance, I added queue world after getting bindings working for http-world and now get the following error. If Swap the worlds it works.

error[E0433]: failed to resolve: could not find `HttpWorldExports` in `worlds`
   --> src/main.rs:123:69
    |
123 |                     let instance = bindings::hyperlight::worlds::HttpWorldExports::http_interface(&mut wrapped);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions