You will need to pass that for synchronous IO as well. All IO in the standard library is moving to the Io interface. Sync and async.
If I want to call a function that does asynchronous IO, I'll use:
foo(io, ...);
If I want to call one that does synchronous IO, I'll write:
foo(io, ...);
If I want to express that either one of the above can be run asynchronously if possible, I'll write:
io.async(foo, .{ io, ... });
If I want to express that it must be run concurrently, then I'll write:
try io.concurrent(foo, .{ io, ... });
Nowhere in the above do I distinguish whether or not foo does synchronous or asynchronous IO. I only mark that it does IO, by passing in a parameter of type std.Io.
You will need to pass that for synchronous IO as well. All IO in the standard library is moving to the Io interface. Sync and async.
If I want to call a function that does asynchronous IO, I'll use:
If I want to call one that does synchronous IO, I'll write: If I want to express that either one of the above can be run asynchronously if possible, I'll write: If I want to express that it must be run concurrently, then I'll write: Nowhere in the above do I distinguish whether or not foo does synchronous or asynchronous IO. I only mark that it does IO, by passing in a parameter of type std.Io.