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().
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.
Result of file read/write operations.
Used by AsyncFile.read() and AsyncFile.write().
Result of listen/bind operations.
Used by TcpListener.listen(), UnixListener.listen(), and UdpSocket.bind().
Result of connect operations.
Used by TcpConnection.connect() and UnixConnection.connect().
Result of handle adoption operations.
Used by TcpConnection.adopt() and UnixConnection.adopt().
Result of file open operations.
Used by AsyncFile.open().
Result of console input start operation (Windows).
Used by ConsoleInput.start().
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.