Draft specification, RFCs, reference registries and examples, plus the reference-implementation skeleton: build.zig, diagnostic envelope with error-code registry synced to docs, aji CLI, conformance runner with seed tests, CI and contributor docs.
24 lines
428 B
Rust
24 lines
428 B
Rust
module examples.channel_transfer;
|
|
|
|
struct Message {
|
|
id: u64,
|
|
}
|
|
|
|
fn producer(
|
|
tx: ref<Sender<Island<Message>>>,
|
|
alloc: cap<mem.alloc>
|
|
) -> Result<void, ChannelError>
|
|
effects [mem.alloc]
|
|
{
|
|
var message = island.create(alloc, Message { id: 0 })?;
|
|
|
|
borrow message as mut root {
|
|
root.id = 42;
|
|
}
|
|
|
|
channel.send(tx, move message)?;
|
|
|
|
// message is MOVED and cannot be used here.
|
|
return Ok();
|
|
}
|