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

enumSendResult : ubyte

Result of stream send operations (TCP, Unix, Pipe).

Used by TcpConnection.send(), UnixConnection.send(), and Pipe.write().

OKData was sent successfully.
PARTIALPartial data was sent; retry with remainder.
PRESSURESend buffer is full; wait for onWritable callback.
CLOSEDConnection has been closed.
ERRORAn error occurred.
enumDatagramResult : ubyte

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.

OKDatagram was sent successfully.
NOT_READYSocket is not bound or not ready.
WOULD_BLOCKSend would block; retry later.
ERRORAn error occurred.
enumFileResult : ubyte

Result of file read/write operations.

Used by AsyncFile.read() and AsyncFile.write().

OKOperation completed successfully.
PENDINGOperation is pending; callback will fire on completion.
ERRORAn error occurred.
CLOSEDFile has been closed.
enumListenResult : ubyte

Result of listen/bind operations.

Used by TcpListener.listen(), UnixListener.listen(), and UdpSocket.bind().

OKServer is now listening.
INVALID_ARGUMENTInvalid host, port, or path argument.
ADDRESS_IN_USEAddress or port is already in use.
PERMISSION_DENIEDPermission denied (e.g., port < 1024 requires root).
ADDRESS_NOT_AVAILABLERequested address is not available on this host.
RESOURCE_LIMITSystem resource limit reached (e.g., file descriptors).
ERRORUnspecified error.
enumConnectResult : ubyte

Result of connect operations.

Used by TcpConnection.connect() and UnixConnection.connect().

OKConnection initiated (async; wait for onConnect callback).
INVALID_ARGUMENTInvalid host, port, or path argument.
CONNECTION_REFUSEDConnection refused by remote host.
NETWORK_UNREACHABLENetwork is unreachable.
HOST_UNREACHABLEHost is unreachable.
TIMED_OUTConnection attempt timed out.
RESOURCE_LIMITSystem resource limit reached.
ERRORUnspecified error.
enumAdoptResult : ubyte

Result of handle adoption operations.

Used by TcpConnection.adopt() and UnixConnection.adopt().

OKHandle was successfully adopted.
INVALID_HANDLEInvalid handle provided.
REGISTRATION_FAILEDFailed to register with event loop.
RESOURCE_LIMITSystem resource limit reached.
ERRORUnspecified error.
enumOpenResult : ubyte

Result of file open operations.

Used by AsyncFile.open().

OKFile was opened successfully.
INVALID_ARGUMENTInvalid path or flags argument.
NOT_FOUNDFile or directory not found.
PERMISSION_DENIEDPermission denied.
IS_DIRECTORYPath is a directory, not a file.
TOO_MANY_FILESToo many open files in system.
ERRORUnspecified error.
enumStartResult : ubyte

Result of console input start operation (Windows).

Used by ConsoleInput.start().

OKConsole input started successfully.
INVALID_STATEInvalid state (already started or disposed).
INVALID_HANDLEFailed to get console handle.
REGISTRATION_FAILEDFailed to register with event loop.
ERRORUnspecified error.
enumSocketState : ubyte

State of a socket (TCP or Unix).

Used by TcpConnection and UnixConnection.

INITInitial state, not yet connected.
CONNECTINGConnection in progress.
CONNECTEDConnected and ready for I/O.
CLOSEDConnection has been closed.
ERRORSocket is in an error state.
enumFileState : ubyte

State of an async file.

Used by AsyncFile.

INITInitial state, not yet opened.
OPENFile is open and ready for operations.
CLOSEDFile has been closed.
ERRORFile is in an error state.
enumPipeState : ubyte

State of a pipe endpoint.

Used by Pipe.

INITInitial state, not yet opened.
OPENPipe is open and ready for I/O.
CLOSEDPipe has been closed.
ERRORPipe is in an error state.
enumConsoleState : ubyte

State of console input (Windows).

Used by ConsoleInput.

INITInitial state, not yet started.
RUNNINGConsole is running and processing input.
STOPPEDConsole has been stopped.
ERRORConsole is in an error state.
enumSocketCloseReason : ubyte

Reason a socket was closed.

Used by TcpConnection and UnixConnection close callbacks.

EOFRemote end closed the connection gracefully.
RESETConnection was reset by remote end.
CLOSEDConnection was closed locally.
ERRORConnection was closed due to an error.
CANCELLEDConnection was cancelled.
enumPipeCloseReason : ubyte

Reason a pipe was closed.

Used by Pipe close callbacks.

EOFRemote end closed the pipe.
CLOSEDPipe was closed locally.
ERRORPipe was closed due to an error.