@@ -183,7 +183,7 @@ pub fn complete(self: *@This(), mode: aio.CompletionMode, handler: anytype) aio.
183
183
if (pfd .revents & std .posix .POLL .ERR != 0 ) {
184
184
switch (op_type ) {
185
185
inline else = > | tag | {
186
- if (hasField (Operation . map . getAssertContains ( tag ).Error , "BrokenPipe" )) {
186
+ if (hasField (tag . Type ( ).Error , "BrokenPipe" )) {
187
187
Uringlator .debug ("poll: {}: {} => ERR (BrokenPipe)" , .{ id , op_type });
188
188
self .uringlator .finish (self , id , error .BrokenPipe , .thread_unsafe );
189
189
} else {
@@ -248,7 +248,7 @@ pub fn immediate(pairs: anytype) aio.Error!u16 {
248
248
return num_errors ;
249
249
}
250
250
251
- fn blockingPosixExecutor (self : * @This (), comptime op_type : Operation , op : Operation . map . getAssertContains ( op_type ), id : aio.Id , readiness : posix.Readiness , comptime safety : Uringlator .Safety ) void {
251
+ fn blockingPosixExecutor (self : * @This (), comptime op_type : Operation , op : op_type . Type ( ), id : aio.Id , readiness : posix.Readiness , comptime safety : Uringlator .Safety ) void {
252
252
var failure : Operation.Error = error .Success ;
253
253
while (true ) {
254
254
posix .perform (op_type , op , readiness ) catch | err | {
@@ -260,7 +260,7 @@ fn blockingPosixExecutor(self: *@This(), comptime op_type: Operation, op: Operat
260
260
self .uringlator .finish (self , id , failure , safety );
261
261
}
262
262
263
- fn posixPerform (self : * @This (), comptime op_type : Operation , op : Operation . map . getAssertContains ( op_type ), id : aio.Id , readiness : posix.Readiness , kludge : enum { kludge , normal }) ! void {
263
+ fn posixPerform (self : * @This (), comptime op_type : Operation , op : op_type . Type ( ), id : aio.Id , readiness : posix.Readiness , kludge : enum { kludge , normal }) ! void {
264
264
if (needs_kludge and ! builtin .single_threaded and kludge == .kludge ) {
265
265
if (self .in_flight_threaded == 0 ) {
266
266
self .pfd .add (.{ .fd = self .source .fd , .events = std .posix .POLL .IN , .revents = 0 }) catch unreachable ;
@@ -280,7 +280,7 @@ fn posixPerform(self: *@This(), comptime op_type: Operation, op: Operation.map.g
280
280
}
281
281
}
282
282
283
- fn nonBlockingPosixExecutor (self : * @This (), comptime op_type : Operation , op : Operation . map . getAssertContains ( op_type ), id : aio.Id , readiness : posix .Readiness ) error {WouldBlock }! void {
283
+ fn nonBlockingPosixExecutor (self : * @This (), comptime op_type : Operation , op : op_type . Type ( ), id : aio.Id , readiness : posix .Readiness ) error {WouldBlock }! void {
284
284
var failure : Operation.Error = error .Success ;
285
285
posix .perform (op_type , op , readiness ) catch | err | {
286
286
if (err == error .WouldBlock ) return error .WouldBlock ;
@@ -289,7 +289,7 @@ fn nonBlockingPosixExecutor(self: *@This(), comptime op_type: Operation, op: Ope
289
289
self .uringlator .finish (self , id , failure , .thread_unsafe );
290
290
}
291
291
292
- fn nonBlockingPosixExecutorFcntl (self : * @This (), comptime op_type : Operation , op : Operation . map . getAssertContains ( op_type ), id : aio.Id , readiness : posix .Readiness ) error { WouldBlock , FcntlFailed }! void {
292
+ fn nonBlockingPosixExecutorFcntl (self : * @This (), comptime op_type : Operation , op : op_type . Type ( ), id : aio.Id , readiness : posix .Readiness ) error { WouldBlock , FcntlFailed }! void {
293
293
const NONBLOCK = 1 << @bitOffsetOf (std .posix .O , "NONBLOCK" );
294
294
const old : struct { usize , bool } = blk : {
295
295
if (readiness .fd != posix .invalid_fd ) {
@@ -313,7 +313,7 @@ fn nonBlockingPosixExecutorFcntl(self: *@This(), comptime op_type: Operation, op
313
313
self .uringlator .finish (self , id , failure , .thread_unsafe );
314
314
}
315
315
316
- fn openReadiness (comptime op_type : Operation , op : Operation . map . getAssertContains ( op_type )) ! posix.Readiness {
316
+ fn openReadiness (comptime op_type : Operation , op : op_type . Type ( )) ! posix.Readiness {
317
317
return switch (op_type ) {
318
318
.nop = > .{},
319
319
.fsync = > .{},
@@ -344,7 +344,7 @@ fn openReadiness(comptime op_type: Operation, op: Operation.map.getAssertContain
344
344
};
345
345
}
346
346
347
- pub fn uringlator_queue (self : * @This (), id : aio .Id , comptime op_type : Operation , op : Operation . map . getAssertContains ( op_type )) aio .Error ! PosixOperation {
347
+ pub fn uringlator_queue (self : * @This (), id : aio .Id , comptime op_type : Operation , op : op_type . Type ( )) aio .Error ! PosixOperation {
348
348
comptime {
349
349
if (needs_kludge and builtin .single_threaded and op_type == .read_tty ) {
350
350
@compileError (
@@ -374,7 +374,7 @@ pub fn uringlator_queue(self: *@This(), id: aio.Id, comptime op_type: Operation,
374
374
return .{ .readiness = readiness };
375
375
}
376
376
377
- pub fn uringlator_dequeue (self : * @This (), id : aio .Id , comptime op_type : Operation , op : Operation . map . getAssertContains ( op_type )) void {
377
+ pub fn uringlator_dequeue (self : * @This (), id : aio .Id , comptime op_type : Operation , op : op_type . Type ( )) void {
378
378
switch (op_type ) {
379
379
.child_exit = > {
380
380
const readiness = self .uringlator .ops .getOne (.readiness , id );
0 commit comments