bytecodealliance / bytecodealliance/wit-bindgen
Rust: How do I return a list<string>?
- Lingua principale
- Rust
- Stelle
- 1.5k
- Fork
- 288
- Merge medio
- 6h 32m
- PR unite (30g)
- 19
Descrizione
Given .wit like this
```wit
package example:q
world test {
export hello: func() -> list;
}
```
and impl in rs:
```rs
wit_bindgen::generate!({
world: "test",
});
struct Test;
impl Guest for Test {
fn hello() -> Vec {
vec!["hello".to_string(), "world".to_string()]
}
}
export!(test);
```
When I debug, the result is an empty array. Tried basically the same thing as above in this sample https://github.com/microsoft/vscode-extension-samples/tree/main/wasm-component-model w/ the same result.
I feel like I'm missing something fundamental here.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Riproduci il test del world .wit mostrato e l’implementazione Rust di Guest::hello, quindi confronta il comportamento con l’esempio di wasm-component-model indicato. Indaga sul motivo per cui la list restituita diventa vuota; il lavoro è completato quando l’esempio restituisce entrambe le stringhe oppure l’issue contiene una spiegazione chiaramente documentata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust, wasm
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100