eve.aio.result
Consolidated Result Enums for EVE AIO Operations.
This module provides all result, state, and close reason enums used across EVE's async I/O subsystem. By centralizing these definitions, we avoid duplicate enum definitions and naming conflicts when importing multiple AIO modules.
The enums are designed to be:
- Portable — same values on all platforms (Linux, Windows, BSD, macOS)
- Type-safe — compiler-checked with
final switch - Self-documenting — named variants instead of magic numbers
- Minimal overhead — all are
ubyte(1 byte)
Example:
final switch (listener.listen(loop, "0.0.0.0", 8080)) {
case ListenResult.OK:
loop.run();
break;
case ListenResult.ADDRESS_IN_USE:
writeln("Port already in use");
break;
// ... compiler ensures all cases handled
}Types 14
Result of stream send operations (TCP, Unix, Pipe).
Used by TcpConnection.send(), UnixConnection.send(), and Pipe.write().
Retryability and Fatality Guide:
OK— Success, no retry neededPARTIAL— Retryable, call again with remaining dataPRESSURE— Retryable, wait for onWritable callback before retryCLOSED— Fatal, connection cannot be reusedERROR— Depends on errno/GetLastError; may be retryable or fatal
Result of datagram send operations (UDP).
Used by UdpSocket.sendTo(). This is separate from SendResult because UDP has different semantics — datagrams are atomic, so there's no PARTIAL.
Retryability and Fatality Guide:
OK— Success, datagram queued for transmissionNOT_READY— Retryable after socket is boundWOULD_BLOCK— Retryable immediately or after brief delayERROR— Depends on errno; may be retryable or fatal
Result of file read/write operations.
Used by AsyncFile.read() and AsyncFile.write().
Retryability and Fatality Guide:
OK— Operation completed synchronouslyPENDING— Not an error; wait for callbackERROR— Depends on errno; may be retryableCLOSED— Fatal, file cannot be reused
Result of listen/bind operations.
Used by TcpListener.listen(), UnixListener.listen(), and UdpSocket.bind().
Retryability and Fatality Guide:
OK— Success, socket is listening/boundINVALID_ARGUMENT— Fatal, fix argumentsADDRESS_IN_USE— Retryable after port is freed or use different portPERMISSION_DENIED— Fatal, requires elevated privileges or different portADDRESS_NOT_AVAILABLE— Fatal, address cannot be bound on this hostRESOURCE_LIMIT— Retryable after resources are freedERROR— Depends on errno
Result of connect operations.
Used by TcpConnection.connect() and UnixConnection.connect().
Retryability and Fatality Guide:
OK— Success, connection initiatedINVALID_ARGUMENT— Fatal, fix argumentsCONNECTION_REFUSED— Retryable with exponential backoffNETWORK_UNREACHABLE— Retryable after network is restoredHOST_UNREACHABLE— Retryable with backoffTIMED_OUT— Retryable with longer timeoutRESOURCE_LIMIT— Retryable after freeing resourcesERROR— Depends on errno
Result of handle adoption operations.
Used by TcpConnection.adopt() and UnixConnection.adopt().
Retryability and Fatality Guide:
OK— Success, handle adoptedINVALID_HANDLE— Fatal, handle is invalidREGISTRATION_FAILED— Retryable after freeing event loop resourcesRESOURCE_LIMIT— Retryable after freeing resourcesERROR— Depends on errno
Result of file open operations.
Used by AsyncFile.open().
Retryability and Fatality Guide:
OK— Success, file openedINVALID_ARGUMENT— Fatal, fix argumentsNOT_FOUND— Fatal for read, retryable for write with O_CREATPERMISSION_DENIED— Fatal, requires permission changesIS_DIRECTORY— Fatal, path points to directoryTOO_MANY_FILES— Retryable after closing filesERROR— Depends on errno
Result of console input start operation (Windows).
Used by ConsoleInput.start().
Retryability and Fatality Guide:
OK— Success, console input startedINVALID_STATE— Fatal, console already started or disposedINVALID_HANDLE— Fatal, cannot get console handleREGISTRATION_FAILED— Retryable after freeing event loop resourcesERROR— Depends on GetLastError
State of a socket (TCP or Unix).
Used by TcpConnection and UnixConnection.
State of an async file.
Used by AsyncFile.
State of a pipe endpoint.
Used by Pipe.
State of console input (Windows).
Used by ConsoleInput.
Reason a socket was closed.
Used by TcpConnection and UnixConnection close callbacks.
Reason a pipe was closed.
Used by Pipe close callbacks.