Skip to content

Rust: Future/Stream-based "spawn" APIs for WIT streams/futures #1387

@alexcrichton

Description

@alexcrichton

@rvolosatovs and @dicej had an idea in a meeting we had today where we should have an API in this crate for converting a Rust Future<Output = T> to a WIT future<T> by sort of "spawning" it, effectively you yield ownership of the future to wit-bindgen crate and that'd give you back a future<T>. That'd then manage polling the original future and then writing the result to the writer half of the channel the runtime provides. Similarly this could work for streams of values (maybe with a bit more finesse to handle chunking)

Metadata

Metadata

Assignees

No one assigned

    Labels

    gen-rustRelated to bindings for Rust-compiled-to-WebAssembly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions