| ... | ... | @@ -58,7 +58,7 @@ pub const VTable = struct { |
| 58 | 58 | /// a unit of concurrency has been assigned to the returned task. |
| 59 | 59 | /// |
| 60 | 60 | /// Thread-safe. |
| 61 | | async: *const fn ( |
| 61 | async: @Restricted(*const fn ( |
| 62 | 62 | /// Corresponds to `Io.userdata`. |
| 63 | 63 | userdata: ?*anyopaque, |
| 64 | 64 | /// The pointer of this slice is an "eager" result value. |
| ... | ... | @@ -69,10 +69,10 @@ pub const VTable = struct { |
| 69 | 69 | /// Copied and then passed to `start`. |
| 70 | 70 | context: []const u8, |
| 71 | 71 | context_alignment: std.mem.Alignment, |
| 72 | | start: *const fn (context: *const anyopaque, result: *anyopaque) void, |
| 73 | | ) ?*AnyFuture, |
| 72 | start: AnyFuture.Start, |
| 73 | ) ?*AnyFuture), |
| 74 | 74 | /// Thread-safe. |
| 75 | | concurrent: *const fn ( |
| 75 | concurrent: @Restricted(*const fn ( |
| 76 | 76 | /// Corresponds to `Io.userdata`. |
| 77 | 77 | userdata: ?*anyopaque, |
| 78 | 78 | result_len: usize, |
| ... | ... | @@ -80,12 +80,12 @@ pub const VTable = struct { |
| 80 | 80 | /// Copied and then passed to `start`. |
| 81 | 81 | context: []const u8, |
| 82 | 82 | context_alignment: std.mem.Alignment, |
| 83 | | start: *const fn (context: *const anyopaque, result: *anyopaque) void, |
| 84 | | ) ConcurrentError!*AnyFuture, |
| 83 | start: AnyFuture.Start, |
| 84 | ) ConcurrentError!*AnyFuture), |
| 85 | 85 | /// This function is only called when `async` returns a non-null value. |
| 86 | 86 | /// |
| 87 | 87 | /// Thread-safe. |
| 88 | | await: *const fn ( |
| 88 | await: @Restricted(*const fn ( |
| 89 | 89 | /// Corresponds to `Io.userdata`. |
| 90 | 90 | userdata: ?*anyopaque, |
| 91 | 91 | /// The same value that was returned from `async`. |
| ... | ... | @@ -94,13 +94,13 @@ pub const VTable = struct { |
| 94 | 94 | /// The length is equal to size in bytes of result type. |
| 95 | 95 | result: []u8, |
| 96 | 96 | result_alignment: std.mem.Alignment, |
| 97 | | ) void, |
| 97 | ) void), |
| 98 | 98 | /// Equivalent to `await` but initiates cancel request. |
| 99 | 99 | /// |
| 100 | 100 | /// This function is only called when `async` returns a non-null value. |
| 101 | 101 | /// |
| 102 | 102 | /// Thread-safe. |
| 103 | | cancel: *const fn ( |
| 103 | cancel: @Restricted(*const fn ( |
| 104 | 104 | /// Corresponds to `Io.userdata`. |
| 105 | 105 | userdata: ?*anyopaque, |
| 106 | 106 | /// The same value that was returned from `async`. |
| ... | ... | @@ -109,14 +109,14 @@ pub const VTable = struct { |
| 109 | 109 | /// The length is equal to size in bytes of result type. |
| 110 | 110 | result: []u8, |
| 111 | 111 | result_alignment: std.mem.Alignment, |
| 112 | | ) void, |
| 112 | ) void), |
| 113 | 113 | |
| 114 | 114 | /// When this function returns, implementation guarantees that `start` has |
| 115 | 115 | /// either already been called, or a unit of concurrency has been assigned |
| 116 | 116 | /// to the task of calling the function. |
| 117 | 117 | /// |
| 118 | 118 | /// Thread-safe. |
| 119 | | groupAsync: *const fn ( |
| 119 | groupAsync: @Restricted(*const fn ( |
| 120 | 120 | /// Corresponds to `Io.userdata`. |
| 121 | 121 | userdata: ?*anyopaque, |
| 122 | 122 | /// Owner of the spawned async task. |
| ... | ... | @@ -124,10 +124,10 @@ pub const VTable = struct { |
| 124 | 124 | /// Copied and then passed to `start`. |
| 125 | 125 | context: []const u8, |
| 126 | 126 | context_alignment: std.mem.Alignment, |
| 127 | | start: *const fn (context: *const anyopaque) void, |
| 128 | | ) void, |
| 127 | start: Group.Start, |
| 128 | ) void), |
| 129 | 129 | /// Thread-safe. |
| 130 | | groupConcurrent: *const fn ( |
| 130 | groupConcurrent: @Restricted(*const fn ( |
| 131 | 131 | /// Corresponds to `Io.userdata`. |
| 132 | 132 | userdata: ?*anyopaque, |
| 133 | 133 | /// Owner of the spawned async task. |
| ... | ... | @@ -135,124 +135,124 @@ pub const VTable = struct { |
| 135 | 135 | /// Copied and then passed to `start`. |
| 136 | 136 | context: []const u8, |
| 137 | 137 | context_alignment: std.mem.Alignment, |
| 138 | | start: *const fn (context: *const anyopaque) void, |
| 139 | | ) ConcurrentError!void, |
| 140 | | groupAwait: *const fn (?*anyopaque, *Group, token: *anyopaque) Cancelable!void, |
| 141 | | groupCancel: *const fn (?*anyopaque, *Group, token: *anyopaque) void, |
| 142 | | |
| 143 | | recancel: *const fn (?*anyopaque) void, |
| 144 | | swapCancelProtection: *const fn (?*anyopaque, new: CancelProtection) CancelProtection, |
| 145 | | checkCancel: *const fn (?*anyopaque) Cancelable!void, |
| 146 | | |
| 147 | | futexWait: *const fn (?*anyopaque, ptr: *const u32, expected: u32, Timeout) Cancelable!void, |
| 148 | | futexWaitUncancelable: *const fn (?*anyopaque, ptr: *const u32, expected: u32) void, |
| 149 | | futexWake: *const fn (?*anyopaque, ptr: *const u32, max_waiters: u32) void, |
| 150 | | |
| 151 | | operate: *const fn (?*anyopaque, Operation) Cancelable!Operation.Result, |
| 152 | | batchAwaitAsync: *const fn (?*anyopaque, *Batch) Cancelable!void, |
| 153 | | batchAwaitConcurrent: *const fn (?*anyopaque, *Batch, Timeout) Batch.AwaitConcurrentError!void, |
| 154 | | batchCancel: *const fn (?*anyopaque, *Batch) void, |
| 155 | | |
| 156 | | dirCreateDir: *const fn (?*anyopaque, Dir, []const u8, Dir.Permissions) Dir.CreateDirError!void, |
| 157 | | dirCreateDirPath: *const fn (?*anyopaque, Dir, []const u8, Dir.Permissions) Dir.CreateDirPathError!Dir.CreatePathStatus, |
| 158 | | dirCreateDirPathOpen: *const fn (?*anyopaque, Dir, []const u8, Dir.Permissions, Dir.OpenOptions) Dir.CreateDirPathOpenError!Dir, |
| 159 | | dirOpenDir: *const fn (?*anyopaque, Dir, []const u8, Dir.OpenOptions) Dir.OpenError!Dir, |
| 160 | | dirStat: *const fn (?*anyopaque, Dir) Dir.StatError!Dir.Stat, |
| 161 | | dirStatFile: *const fn (?*anyopaque, Dir, []const u8, Dir.StatFileOptions) Dir.StatFileError!File.Stat, |
| 162 | | dirAccess: *const fn (?*anyopaque, Dir, []const u8, Dir.AccessOptions) Dir.AccessError!void, |
| 163 | | dirCreateFile: *const fn (?*anyopaque, Dir, []const u8, Dir.CreateFileOptions) File.OpenError!File, |
| 164 | | dirCreateFileAtomic: *const fn (?*anyopaque, Dir, []const u8, Dir.CreateFileAtomicOptions) Dir.CreateFileAtomicError!File.Atomic, |
| 165 | | dirOpenFile: *const fn (?*anyopaque, Dir, []const u8, Dir.OpenFileOptions) File.OpenError!File, |
| 166 | | dirClose: *const fn (?*anyopaque, []const Dir) void, |
| 167 | | dirRead: *const fn (?*anyopaque, *Dir.Reader, []Dir.Entry) Dir.Reader.Error!usize, |
| 168 | | dirRealPath: *const fn (?*anyopaque, Dir, out_buffer: []u8) Dir.RealPathError!usize, |
| 169 | | dirRealPathFile: *const fn (?*anyopaque, Dir, path_name: []const u8, out_buffer: []u8) Dir.RealPathFileError!usize, |
| 170 | | dirDeleteFile: *const fn (?*anyopaque, Dir, []const u8) Dir.DeleteFileError!void, |
| 171 | | dirDeleteDir: *const fn (?*anyopaque, Dir, []const u8) Dir.DeleteDirError!void, |
| 172 | | dirRename: *const fn (?*anyopaque, old_dir: Dir, old_sub_path: []const u8, new_dir: Dir, new_sub_path: []const u8) Dir.RenameError!void, |
| 173 | | dirRenamePreserve: *const fn (?*anyopaque, old_dir: Dir, old_sub_path: []const u8, new_dir: Dir, new_sub_path: []const u8) Dir.RenamePreserveError!void, |
| 174 | | dirSymLink: *const fn (?*anyopaque, Dir, target_path: []const u8, sym_link_path: []const u8, Dir.SymLinkFlags) Dir.SymLinkError!void, |
| 175 | | dirReadLink: *const fn (?*anyopaque, Dir, sub_path: []const u8, buffer: []u8) Dir.ReadLinkError!usize, |
| 176 | | dirSetOwner: *const fn (?*anyopaque, Dir, ?File.Uid, ?File.Gid) Dir.SetOwnerError!void, |
| 177 | | dirSetFileOwner: *const fn (?*anyopaque, Dir, []const u8, ?File.Uid, ?File.Gid, Dir.SetFileOwnerOptions) Dir.SetFileOwnerError!void, |
| 178 | | dirSetPermissions: *const fn (?*anyopaque, Dir, Dir.Permissions) Dir.SetPermissionsError!void, |
| 179 | | dirSetFilePermissions: *const fn (?*anyopaque, Dir, []const u8, File.Permissions, Dir.SetFilePermissionsOptions) Dir.SetFilePermissionsError!void, |
| 180 | | dirSetTimestamps: *const fn (?*anyopaque, Dir, []const u8, Dir.SetTimestampsOptions) Dir.SetTimestampsError!void, |
| 181 | | dirHardLink: *const fn (?*anyopaque, old_dir: Dir, old_sub_path: []const u8, new_dir: Dir, new_sub_path: []const u8, Dir.HardLinkOptions) Dir.HardLinkError!void, |
| 182 | | |
| 183 | | fileStat: *const fn (?*anyopaque, File) File.StatError!File.Stat, |
| 184 | | fileLength: *const fn (?*anyopaque, File) File.LengthError!u64, |
| 185 | | fileClose: *const fn (?*anyopaque, []const File) void, |
| 186 | | fileWritePositional: *const fn (?*anyopaque, File, header: []const u8, data: []const []const u8, splat: usize, offset: u64) File.WritePositionalError!usize, |
| 187 | | fileWriteFileStreaming: *const fn (?*anyopaque, File, header: []const u8, *Io.File.Reader, Io.Limit) File.Writer.WriteFileError!usize, |
| 188 | | fileWriteFilePositional: *const fn (?*anyopaque, File, header: []const u8, *Io.File.Reader, Io.Limit, offset: u64) File.WriteFilePositionalError!usize, |
| 138 | start: Group.Start, |
| 139 | ) ConcurrentError!void), |
| 140 | groupAwait: @Restricted(*const fn (?*anyopaque, *Group, token: *anyopaque) Cancelable!void), |
| 141 | groupCancel: @Restricted(*const fn (?*anyopaque, *Group, token: *anyopaque) void), |
| 142 | |
| 143 | recancel: @Restricted(*const fn (?*anyopaque) void), |
| 144 | swapCancelProtection: @Restricted(*const fn (?*anyopaque, new: CancelProtection) CancelProtection), |
| 145 | checkCancel: @Restricted(*const fn (?*anyopaque) Cancelable!void), |
| 146 | |
| 147 | futexWait: @Restricted(*const fn (?*anyopaque, ptr: *const u32, expected: u32, Timeout) Cancelable!void), |
| 148 | futexWaitUncancelable: @Restricted(*const fn (?*anyopaque, ptr: *const u32, expected: u32) void), |
| 149 | futexWake: @Restricted(*const fn (?*anyopaque, ptr: *const u32, max_waiters: u32) void), |
| 150 | |
| 151 | operate: @Restricted(*const fn (?*anyopaque, Operation) Cancelable!Operation.Result), |
| 152 | batchAwaitAsync: @Restricted(*const fn (?*anyopaque, *Batch) Cancelable!void), |
| 153 | batchAwaitConcurrent: @Restricted(*const fn (?*anyopaque, *Batch, Timeout) Batch.AwaitConcurrentError!void), |
| 154 | batchCancel: @Restricted(*const fn (?*anyopaque, *Batch) void), |
| 155 | |
| 156 | dirCreateDir: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.Permissions) Dir.CreateDirError!void), |
| 157 | dirCreateDirPath: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.Permissions) Dir.CreateDirPathError!Dir.CreatePathStatus), |
| 158 | dirCreateDirPathOpen: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.Permissions, Dir.OpenOptions) Dir.CreateDirPathOpenError!Dir), |
| 159 | dirOpenDir: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.OpenOptions) Dir.OpenError!Dir), |
| 160 | dirStat: @Restricted(*const fn (?*anyopaque, Dir) Dir.StatError!Dir.Stat), |
| 161 | dirStatFile: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.StatFileOptions) Dir.StatFileError!File.Stat), |
| 162 | dirAccess: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.AccessOptions) Dir.AccessError!void), |
| 163 | dirCreateFile: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.CreateFileOptions) File.OpenError!File), |
| 164 | dirCreateFileAtomic: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.CreateFileAtomicOptions) Dir.CreateFileAtomicError!File.Atomic), |
| 165 | dirOpenFile: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.OpenFileOptions) File.OpenError!File), |
| 166 | dirClose: @Restricted(*const fn (?*anyopaque, []const Dir) void), |
| 167 | dirRead: @Restricted(*const fn (?*anyopaque, *Dir.Reader, []Dir.Entry) Dir.Reader.Error!usize), |
| 168 | dirRealPath: @Restricted(*const fn (?*anyopaque, Dir, out_buffer: []u8) Dir.RealPathError!usize), |
| 169 | dirRealPathFile: @Restricted(*const fn (?*anyopaque, Dir, path_name: []const u8, out_buffer: []u8) Dir.RealPathFileError!usize), |
| 170 | dirDeleteFile: @Restricted(*const fn (?*anyopaque, Dir, []const u8) Dir.DeleteFileError!void), |
| 171 | dirDeleteDir: @Restricted(*const fn (?*anyopaque, Dir, []const u8) Dir.DeleteDirError!void), |
| 172 | dirRename: @Restricted(*const fn (?*anyopaque, old_dir: Dir, old_sub_path: []const u8, new_dir: Dir, new_sub_path: []const u8) Dir.RenameError!void), |
| 173 | dirRenamePreserve: @Restricted(*const fn (?*anyopaque, old_dir: Dir, old_sub_path: []const u8, new_dir: Dir, new_sub_path: []const u8) Dir.RenamePreserveError!void), |
| 174 | dirSymLink: @Restricted(*const fn (?*anyopaque, Dir, target_path: []const u8, sym_link_path: []const u8, Dir.SymLinkFlags) Dir.SymLinkError!void), |
| 175 | dirReadLink: @Restricted(*const fn (?*anyopaque, Dir, sub_path: []const u8, buffer: []u8) Dir.ReadLinkError!usize), |
| 176 | dirSetOwner: @Restricted(*const fn (?*anyopaque, Dir, ?File.Uid, ?File.Gid) Dir.SetOwnerError!void), |
| 177 | dirSetFileOwner: @Restricted(*const fn (?*anyopaque, Dir, []const u8, ?File.Uid, ?File.Gid, Dir.SetFileOwnerOptions) Dir.SetFileOwnerError!void), |
| 178 | dirSetPermissions: @Restricted(*const fn (?*anyopaque, Dir, Dir.Permissions) Dir.SetPermissionsError!void), |
| 179 | dirSetFilePermissions: @Restricted(*const fn (?*anyopaque, Dir, []const u8, File.Permissions, Dir.SetFilePermissionsOptions) Dir.SetFilePermissionsError!void), |
| 180 | dirSetTimestamps: @Restricted(*const fn (?*anyopaque, Dir, []const u8, Dir.SetTimestampsOptions) Dir.SetTimestampsError!void), |
| 181 | dirHardLink: @Restricted(*const fn (?*anyopaque, old_dir: Dir, old_sub_path: []const u8, new_dir: Dir, new_sub_path: []const u8, Dir.HardLinkOptions) Dir.HardLinkError!void), |
| 182 | |
| 183 | fileStat: @Restricted(*const fn (?*anyopaque, File) File.StatError!File.Stat), |
| 184 | fileLength: @Restricted(*const fn (?*anyopaque, File) File.LengthError!u64), |
| 185 | fileClose: @Restricted(*const fn (?*anyopaque, []const File) void), |
| 186 | fileWritePositional: @Restricted(*const fn (?*anyopaque, File, header: []const u8, data: []const []const u8, splat: usize, offset: u64) File.WritePositionalError!usize), |
| 187 | fileWriteFileStreaming: @Restricted(*const fn (?*anyopaque, File, header: []const u8, *Io.File.Reader, Io.Limit) File.Writer.WriteFileError!usize), |
| 188 | fileWriteFilePositional: @Restricted(*const fn (?*anyopaque, File, header: []const u8, *Io.File.Reader, Io.Limit, offset: u64) File.WriteFilePositionalError!usize), |
| 189 | 189 | /// Returns 0 if reading at or past the end. |
| 190 | | fileReadPositional: *const fn (?*anyopaque, File, data: []const []u8, offset: u64) File.ReadPositionalError!usize, |
| 191 | | fileSeekBy: *const fn (?*anyopaque, File, relative_offset: i64) File.SeekError!void, |
| 192 | | fileSeekTo: *const fn (?*anyopaque, File, absolute_offset: u64) File.SeekError!void, |
| 193 | | fileSync: *const fn (?*anyopaque, File) File.SyncError!void, |
| 194 | | fileIsTty: *const fn (?*anyopaque, File) Cancelable!bool, |
| 195 | | fileEnableAnsiEscapeCodes: *const fn (?*anyopaque, File) File.EnableAnsiEscapeCodesError!void, |
| 196 | | fileSupportsAnsiEscapeCodes: *const fn (?*anyopaque, File) Cancelable!bool, |
| 197 | | fileSetLength: *const fn (?*anyopaque, File, u64) File.SetLengthError!void, |
| 198 | | fileSetOwner: *const fn (?*anyopaque, File, ?File.Uid, ?File.Gid) File.SetOwnerError!void, |
| 199 | | fileSetPermissions: *const fn (?*anyopaque, File, File.Permissions) File.SetPermissionsError!void, |
| 200 | | fileSetTimestamps: *const fn (?*anyopaque, File, File.SetTimestampsOptions) File.SetTimestampsError!void, |
| 201 | | fileLock: *const fn (?*anyopaque, File, File.Lock) File.LockError!void, |
| 202 | | fileTryLock: *const fn (?*anyopaque, File, File.Lock) File.LockError!bool, |
| 203 | | fileUnlock: *const fn (?*anyopaque, File) void, |
| 204 | | fileDowngradeLock: *const fn (?*anyopaque, File) File.DowngradeLockError!void, |
| 205 | | fileRealPath: *const fn (?*anyopaque, File, out_buffer: []u8) File.RealPathError!usize, |
| 206 | | fileHardLink: *const fn (?*anyopaque, File, Dir, []const u8, File.HardLinkOptions) File.HardLinkError!void, |
| 207 | | |
| 208 | | fileMemoryMapCreate: *const fn (?*anyopaque, File, File.MemoryMap.CreateOptions) File.MemoryMap.CreateError!File.MemoryMap, |
| 209 | | fileMemoryMapDestroy: *const fn (?*anyopaque, *File.MemoryMap) void, |
| 210 | | fileMemoryMapSetLength: *const fn (?*anyopaque, *File.MemoryMap, usize) File.MemoryMap.SetLengthError!void, |
| 211 | | fileMemoryMapRead: *const fn (?*anyopaque, *File.MemoryMap) File.ReadPositionalError!void, |
| 212 | | fileMemoryMapWrite: *const fn (?*anyopaque, *File.MemoryMap) File.WritePositionalError!void, |
| 213 | | |
| 214 | | processExecutableOpen: *const fn (?*anyopaque, Dir.OpenFileOptions) std.process.OpenExecutableError!File, |
| 215 | | processExecutablePath: *const fn (?*anyopaque, buffer: []u8) std.process.ExecutablePathError!usize, |
| 216 | | lockStderr: *const fn (?*anyopaque, ?Terminal.Mode) Cancelable!LockedStderr, |
| 217 | | tryLockStderr: *const fn (?*anyopaque, ?Terminal.Mode) Cancelable!?LockedStderr, |
| 218 | | unlockStderr: *const fn (?*anyopaque) void, |
| 219 | | processCurrentPath: *const fn (?*anyopaque, buffer: []u8) std.process.CurrentPathError!usize, |
| 220 | | processSetCurrentDir: *const fn (?*anyopaque, Dir) std.process.SetCurrentDirError!void, |
| 221 | | processSetCurrentPath: *const fn (?*anyopaque, []const u8) std.process.SetCurrentPathError!void, |
| 222 | | processReplace: *const fn (?*anyopaque, std.process.ReplaceOptions) std.process.ReplaceError, |
| 223 | | processReplacePath: *const fn (?*anyopaque, Dir, std.process.ReplaceOptions) std.process.ReplaceError, |
| 224 | | processSpawn: *const fn (?*anyopaque, std.process.SpawnOptions) std.process.SpawnError!std.process.Child, |
| 225 | | processSpawnPath: *const fn (?*anyopaque, Dir, std.process.SpawnOptions) std.process.SpawnError!std.process.Child, |
| 226 | | childWait: *const fn (?*anyopaque, *std.process.Child) std.process.Child.WaitError!std.process.Child.Term, |
| 227 | | childKill: *const fn (?*anyopaque, *std.process.Child) void, |
| 228 | | |
| 229 | | progressParentFile: *const fn (?*anyopaque) std.Progress.ParentFileError!File, |
| 230 | | |
| 231 | | now: *const fn (?*anyopaque, Clock) Timestamp, |
| 232 | | clockResolution: *const fn (?*anyopaque, Clock) Clock.ResolutionError!Duration, |
| 233 | | sleep: *const fn (?*anyopaque, Timeout) Cancelable!void, |
| 234 | | |
| 235 | | random: *const fn (?*anyopaque, buffer: []u8) void, |
| 236 | | randomSecure: *const fn (?*anyopaque, buffer: []u8) RandomSecureError!void, |
| 237 | | |
| 238 | | netListenIp: *const fn (?*anyopaque, address: *const net.IpAddress, net.IpAddress.ListenOptions) net.IpAddress.ListenError!net.Socket, |
| 239 | | netAccept: *const fn (?*anyopaque, server: net.Socket.Handle, options: net.Server.AcceptOptions) net.Server.AcceptError!net.Socket, |
| 240 | | netBindIp: *const fn (?*anyopaque, address: *const net.IpAddress, options: net.IpAddress.BindOptions) net.IpAddress.BindError!net.Socket, |
| 241 | | netConnectIp: *const fn (?*anyopaque, address: *const net.IpAddress, options: net.IpAddress.ConnectOptions) net.IpAddress.ConnectError!net.Socket, |
| 242 | | netListenUnix: *const fn (?*anyopaque, *const net.UnixAddress, net.UnixAddress.ListenOptions) net.UnixAddress.ListenError!net.Socket.Handle, |
| 243 | | netConnectUnix: *const fn (?*anyopaque, *const net.UnixAddress) net.UnixAddress.ConnectError!net.Socket.Handle, |
| 244 | | netSocketCreatePair: *const fn (?*anyopaque, net.Socket.CreatePairOptions) net.Socket.CreatePairError![2]net.Socket, |
| 245 | | netSend: *const fn (?*anyopaque, net.Socket.Handle, []net.OutgoingMessage, net.SendFlags) struct { ?net.Socket.SendError, usize }, |
| 246 | | netWrite: *const fn (?*anyopaque, dest: net.Socket.Handle, header: []const u8, data: []const []const u8, splat: usize) net.Stream.Writer.Error!usize, |
| 247 | | netWriteFile: *const fn (?*anyopaque, net.Socket.Handle, header: []const u8, *Io.File.Reader, Io.Limit) net.Stream.Writer.WriteFileError!usize, |
| 248 | | netClose: *const fn (?*anyopaque, handle: []const net.Socket.Handle) void, |
| 249 | | netShutdown: *const fn (?*anyopaque, handle: net.Socket.Handle, how: net.ShutdownHow) net.ShutdownError!void, |
| 250 | | netInterfaceNameResolve: *const fn (?*anyopaque, *const net.Interface.Name) net.Interface.Name.ResolveError!net.Interface, |
| 251 | | netInterfaceName: *const fn (?*anyopaque, net.Interface) net.Interface.NameError!net.Interface.Name, |
| 252 | | netLookup: *const fn (?*anyopaque, net.HostName, *Queue(net.HostName.LookupResult), net.HostName.LookupOptions) net.HostName.LookupError!void, |
| 190 | fileReadPositional: @Restricted(*const fn (?*anyopaque, File, data: []const []u8, offset: u64) File.ReadPositionalError!usize), |
| 191 | fileSeekBy: @Restricted(*const fn (?*anyopaque, File, relative_offset: i64) File.SeekError!void), |
| 192 | fileSeekTo: @Restricted(*const fn (?*anyopaque, File, absolute_offset: u64) File.SeekError!void), |
| 193 | fileSync: @Restricted(*const fn (?*anyopaque, File) File.SyncError!void), |
| 194 | fileIsTty: @Restricted(*const fn (?*anyopaque, File) Cancelable!bool), |
| 195 | fileEnableAnsiEscapeCodes: @Restricted(*const fn (?*anyopaque, File) File.EnableAnsiEscapeCodesError!void), |
| 196 | fileSupportsAnsiEscapeCodes: @Restricted(*const fn (?*anyopaque, File) Cancelable!bool), |
| 197 | fileSetLength: @Restricted(*const fn (?*anyopaque, File, u64) File.SetLengthError!void), |
| 198 | fileSetOwner: @Restricted(*const fn (?*anyopaque, File, ?File.Uid, ?File.Gid) File.SetOwnerError!void), |
| 199 | fileSetPermissions: @Restricted(*const fn (?*anyopaque, File, File.Permissions) File.SetPermissionsError!void), |
| 200 | fileSetTimestamps: @Restricted(*const fn (?*anyopaque, File, File.SetTimestampsOptions) File.SetTimestampsError!void), |
| 201 | fileLock: @Restricted(*const fn (?*anyopaque, File, File.Lock) File.LockError!void), |
| 202 | fileTryLock: @Restricted(*const fn (?*anyopaque, File, File.Lock) File.LockError!bool), |
| 203 | fileUnlock: @Restricted(*const fn (?*anyopaque, File) void), |
| 204 | fileDowngradeLock: @Restricted(*const fn (?*anyopaque, File) File.DowngradeLockError!void), |
| 205 | fileRealPath: @Restricted(*const fn (?*anyopaque, File, out_buffer: []u8) File.RealPathError!usize), |
| 206 | fileHardLink: @Restricted(*const fn (?*anyopaque, File, Dir, []const u8, File.HardLinkOptions) File.HardLinkError!void), |
| 207 | |
| 208 | fileMemoryMapCreate: @Restricted(*const fn (?*anyopaque, File, File.MemoryMap.CreateOptions) File.MemoryMap.CreateError!File.MemoryMap), |
| 209 | fileMemoryMapDestroy: @Restricted(*const fn (?*anyopaque, *File.MemoryMap) void), |
| 210 | fileMemoryMapSetLength: @Restricted(*const fn (?*anyopaque, *File.MemoryMap, usize) File.MemoryMap.SetLengthError!void), |
| 211 | fileMemoryMapRead: @Restricted(*const fn (?*anyopaque, *File.MemoryMap) File.ReadPositionalError!void), |
| 212 | fileMemoryMapWrite: @Restricted(*const fn (?*anyopaque, *File.MemoryMap) File.WritePositionalError!void), |
| 213 | |
| 214 | processExecutableOpen: @Restricted(*const fn (?*anyopaque, Dir.OpenFileOptions) std.process.OpenExecutableError!File), |
| 215 | processExecutablePath: @Restricted(*const fn (?*anyopaque, buffer: []u8) std.process.ExecutablePathError!usize), |
| 216 | lockStderr: @Restricted(*const fn (?*anyopaque, ?Terminal.Mode) Cancelable!LockedStderr), |
| 217 | tryLockStderr: @Restricted(*const fn (?*anyopaque, ?Terminal.Mode) Cancelable!?LockedStderr), |
| 218 | unlockStderr: @Restricted(*const fn (?*anyopaque) void), |
| 219 | processCurrentPath: @Restricted(*const fn (?*anyopaque, buffer: []u8) std.process.CurrentPathError!usize), |
| 220 | processSetCurrentDir: @Restricted(*const fn (?*anyopaque, Dir) std.process.SetCurrentDirError!void), |
| 221 | processSetCurrentPath: @Restricted(*const fn (?*anyopaque, []const u8) std.process.SetCurrentPathError!void), |
| 222 | processReplace: @Restricted(*const fn (?*anyopaque, std.process.ReplaceOptions) std.process.ReplaceError), |
| 223 | processReplacePath: @Restricted(*const fn (?*anyopaque, Dir, std.process.ReplaceOptions) std.process.ReplaceError), |
| 224 | processSpawn: @Restricted(*const fn (?*anyopaque, std.process.SpawnOptions) std.process.SpawnError!std.process.Child), |
| 225 | processSpawnPath: @Restricted(*const fn (?*anyopaque, Dir, std.process.SpawnOptions) std.process.SpawnError!std.process.Child), |
| 226 | childWait: @Restricted(*const fn (?*anyopaque, *std.process.Child) std.process.Child.WaitError!std.process.Child.Term), |
| 227 | childKill: @Restricted(*const fn (?*anyopaque, *std.process.Child) void), |
| 228 | |
| 229 | progressParentFile: @Restricted(*const fn (?*anyopaque) std.Progress.ParentFileError!File), |
| 230 | |
| 231 | now: @Restricted(*const fn (?*anyopaque, Clock) Timestamp), |
| 232 | clockResolution: @Restricted(*const fn (?*anyopaque, Clock) Clock.ResolutionError!Duration), |
| 233 | sleep: @Restricted(*const fn (?*anyopaque, Timeout) Cancelable!void), |
| 234 | |
| 235 | random: @Restricted(*const fn (?*anyopaque, buffer: []u8) void), |
| 236 | randomSecure: @Restricted(*const fn (?*anyopaque, buffer: []u8) RandomSecureError!void), |
| 237 | |
| 238 | netListenIp: @Restricted(*const fn (?*anyopaque, address: *const net.IpAddress, net.IpAddress.ListenOptions) net.IpAddress.ListenError!net.Socket), |
| 239 | netAccept: @Restricted(*const fn (?*anyopaque, server: net.Socket.Handle, options: net.Server.AcceptOptions) net.Server.AcceptError!net.Socket), |
| 240 | netBindIp: @Restricted(*const fn (?*anyopaque, address: *const net.IpAddress, options: net.IpAddress.BindOptions) net.IpAddress.BindError!net.Socket), |
| 241 | netConnectIp: @Restricted(*const fn (?*anyopaque, address: *const net.IpAddress, options: net.IpAddress.ConnectOptions) net.IpAddress.ConnectError!net.Socket), |
| 242 | netListenUnix: @Restricted(*const fn (?*anyopaque, *const net.UnixAddress, net.UnixAddress.ListenOptions) net.UnixAddress.ListenError!net.Socket.Handle), |
| 243 | netConnectUnix: @Restricted(*const fn (?*anyopaque, *const net.UnixAddress) net.UnixAddress.ConnectError!net.Socket.Handle), |
| 244 | netSocketCreatePair: @Restricted(*const fn (?*anyopaque, net.Socket.CreatePairOptions) net.Socket.CreatePairError![2]net.Socket), |
| 245 | netSend: @Restricted(*const fn (?*anyopaque, net.Socket.Handle, []net.OutgoingMessage, net.SendFlags) struct { ?net.Socket.SendError, usize }), |
| 246 | netWrite: @Restricted(*const fn (?*anyopaque, dest: net.Socket.Handle, header: []const u8, data: []const []const u8, splat: usize) net.Stream.Writer.Error!usize), |
| 247 | netWriteFile: @Restricted(*const fn (?*anyopaque, net.Socket.Handle, header: []const u8, *Io.File.Reader, Io.Limit) net.Stream.Writer.WriteFileError!usize), |
| 248 | netClose: @Restricted(*const fn (?*anyopaque, handle: []const net.Socket.Handle) void), |
| 249 | netShutdown: @Restricted(*const fn (?*anyopaque, handle: net.Socket.Handle, how: net.ShutdownHow) net.ShutdownError!void), |
| 250 | netInterfaceNameResolve: @Restricted(*const fn (?*anyopaque, *const net.Interface.Name) net.Interface.Name.ResolveError!net.Interface), |
| 251 | netInterfaceName: @Restricted(*const fn (?*anyopaque, net.Interface) net.Interface.NameError!net.Interface.Name), |
| 252 | netLookup: @Restricted(*const fn (?*anyopaque, net.HostName, *Queue(net.HostName.LookupResult), net.HostName.LookupOptions) net.HostName.LookupError!void), |
| 253 | 253 | }; |
| 254 | 254 | |
| 255 | | pub const Operation = union(enum) { |
| 255 | pub const Operation = union(@Restricted(Tag)) { |
| 256 | 256 | file_read_streaming: FileReadStreaming, |
| 257 | 257 | file_write_streaming: FileWriteStreaming, |
| 258 | 258 | /// On Windows this is NtDeviceIoControlFile. On POSIX this is ioctl. On |
| ... | ... | @@ -261,7 +261,13 @@ pub const Operation = union(enum) { |
| 261 | 261 | net_receive: NetReceive, |
| 262 | 262 | net_read: NetRead, |
| 263 | 263 | |
| 264 | | pub const Tag = @typeInfo(Operation).@"union".tag_type.?; |
| 264 | pub const Tag = enum { |
| 265 | file_read_streaming, |
| 266 | file_write_streaming, |
| 267 | device_io_control, |
| 268 | net_receive, |
| 269 | net_read, |
| 270 | }; |
| 265 | 271 | |
| 266 | 272 | /// May return 0 reads which is different than `error.EndOfStream`. |
| 267 | 273 | pub const FileReadStreaming = struct { |
| ... | ... | @@ -1187,7 +1193,9 @@ pub const Timeout = union(enum) { |
| 1187 | 1193 | } |
| 1188 | 1194 | }; |
| 1189 | 1195 | |
| 1190 | | pub const AnyFuture = opaque {}; |
| 1196 | pub const AnyFuture = opaque { |
| 1197 | pub const Start = @Restricted(*const fn (context: *const anyopaque, result: *anyopaque) void); |
| 1198 | }; |
| 1191 | 1199 | |
| 1192 | 1200 | pub fn Future(Result: type) type { |
| 1193 | 1201 | return struct { |
| ... | ... | @@ -1243,6 +1251,8 @@ pub const Group = struct { |
| 1243 | 1251 | |
| 1244 | 1252 | pub const init: Group = .{ .token = .init(null), .state = 0 }; |
| 1245 | 1253 | |
| 1254 | pub const Start = @Restricted(*const fn (context: *const anyopaque) void); |
| 1255 | |
| 1246 | 1256 | /// Equivalent to `Io.async`, except the task is spawned in this `Group` |
| 1247 | 1257 | /// instead of becoming associated with a `Future`. |
| 1248 | 1258 | /// |
| ... | ... | @@ -2711,7 +2721,7 @@ pub fn noCrashHandler(userdata: ?*anyopaque) void { |
| 2711 | 2721 | _ = userdata; |
| 2712 | 2722 | } |
| 2713 | 2723 | |
| 2714 | | pub fn noAsync(userdata: ?*anyopaque, result: []u8, result_alignment: std.mem.Alignment, context: []const u8, context_alignment: std.mem.Alignment, start: *const fn (context: *const anyopaque, result: *anyopaque) void) ?*AnyFuture { |
| 2724 | pub fn noAsync(userdata: ?*anyopaque, result: []u8, result_alignment: std.mem.Alignment, context: []const u8, context_alignment: std.mem.Alignment, start: AnyFuture.Start) ?*AnyFuture { |
| 2715 | 2725 | _ = userdata; |
| 2716 | 2726 | _ = result_alignment; |
| 2717 | 2727 | _ = context_alignment; |
| ... | ... | @@ -2725,7 +2735,7 @@ pub fn failingConcurrent( |
| 2725 | 2735 | result_alignment: std.mem.Alignment, |
| 2726 | 2736 | context: []const u8, |
| 2727 | 2737 | context_alignment: std.mem.Alignment, |
| 2728 | | start: *const fn (context: *const anyopaque, result: *anyopaque) void, |
| 2738 | start: AnyFuture.Start, |
| 2729 | 2739 | ) ConcurrentError!*AnyFuture { |
| 2730 | 2740 | _ = userdata; |
| 2731 | 2741 | _ = result_len; |
| ... | ... | @@ -2767,7 +2777,7 @@ pub fn noGroupAsync( |
| 2767 | 2777 | group: *Group, |
| 2768 | 2778 | context: []const u8, |
| 2769 | 2779 | context_alignment: std.mem.Alignment, |
| 2770 | | start: *const fn (context: *const anyopaque) void, |
| 2780 | start: Group.Start, |
| 2771 | 2781 | ) void { |
| 2772 | 2782 | _ = userdata; |
| 2773 | 2783 | _ = group; |
| ... | ... | @@ -2780,7 +2790,7 @@ pub fn failingGroupConcurrent( |
| 2780 | 2790 | group: *Group, |
| 2781 | 2791 | context: []const u8, |
| 2782 | 2792 | context_alignment: std.mem.Alignment, |
| 2783 | | start: *const fn (context: *const anyopaque) void, |
| 2793 | start: Group.Start, |
| 2784 | 2794 | ) ConcurrentError!void { |
| 2785 | 2795 | _ = userdata; |
| 2786 | 2796 | _ = group; |