Skip to content

Commit 6dc6535

Browse files
authored
rust: Flag futures/streams as owned handles (#1210)
This commit updates how bindings work for futures/streams in Rust by ensuring that the type information for them encodes that they behave like `own<T>` handles in that passing the value to an import for examples passes ownership of the value in bindings. This ensures that generates APIs appropriately model relinquishing ownership of the `FutureReader<T>` end, for example.
1 parent 5a253b4 commit 6dc6535

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/core/src/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ impl Types {
198198
// These are all u32 handles regardless of payload type, so no
199199
// need to recurse.
200200
info.has_resource = true;
201+
202+
// Flag these as being onwed handles as lowering these values
203+
// should use the same ownership semantics as `own<T>`
204+
info.has_own_handle = true;
201205
}
202206
TypeDefKind::Unknown => unreachable!(),
203207
}

0 commit comments

Comments
 (0)