component-docs icon indicating copy to clipboard operation
component-docs copied to clipboard

Can we have more examples that cover resource, record, etc.

Open chaosprint opened this issue 1 year ago • 2 comments

I looked for the repo of wit-bindgen and cargo-component, and there are several examples of designing import, export, and func. But they are basically at the level of helloworld and adder.

But how to create a struct similar to Rust? The docs mention resource, interface, record, etc., but there are no examples to explain how to write wit and bind at the Rust level.

It's basically some expansion to the current tutorial.

chaosprint avatar Jun 02 '24 10:06 chaosprint

I ran into this just the other day! I will try to capture what I did, although it will be Rust-only at this stage.

itowlson avatar Jun 03 '24 21:06 itowlson

@chaosprint It might take us a bit to decide on how we want to organise things, but if you want to know about resources pronto, see #140. I'll have a look at putting something similar together for records, which I hope will be a lot simpler.

itowlson avatar Jun 04 '24 01:06 itowlson