| ▲ | tcfhgj 5 hours ago | ||||||||||||||||
just pass around handles like you do in zig, alright? also: spawn_blocking for blocking code | |||||||||||||||||
| ▲ | whytevuhuni 4 hours ago | parent [-] | ||||||||||||||||
But that's the thing, idiomatic Rust sync code almost never passes around handles, even when they need to do I/O. You might be different, and you might start doing that in your code, but almost none of either std or 3rd party libraries will cooperate with you. The difference with Zig is not in its capabilities, but rather in how the ecosystem around its stdlib is built. The equivalent in Rust would be if almost all I/O functions in std would be async; granted that would be far too expensive and disruptive given how async works. | |||||||||||||||||
| |||||||||||||||||