eve.aio.windows.io
Async file I/O primitives for Windows.
This module provides the Windows implementation of asynchronous file I/O using IOCP overlapped I/O. Files are opened with FILE_FLAG_OVERLAPPED and associated with the event loop's I/O completion port for true async operation.
Uses overlapped ReadFile() and WriteFile() with file offsets specified in the OVERLAPPED structure.
Types 6
File operation configuration.
size_t bufferSizeBuffer size hint for I/O operations.Callback invoked when a read operation completes.
Callback invoked when a write operation completes.
Callback invoked on error conditions.
Async file handle wrapper.
Wraps a Windows file handle and integrates with the Layer 1 event loop for async read/write operations using IOCP overlapped I/O.
AsyncFileState _stateOpenResult open(ref EventLoop loop, scope const(char)[] path, int flags) @trustedOpen a file for reading and/or writing.AsyncFileState mutableState() @trustedFileConfig _configHANDLE _handleFileState _fileStateEventLoop * _loopToken _prepareTokenReadCallback onReadWriteCallback onWriteErrorCallback onErrorOVERLAPPED _readOverlappedOVERLAPPED _writeOverlappedubyte[] _readBufferubyte[] _writeBufferbool _readInProgressbool _writeInProgressvoid handlePrepare(ref EventLoop loop, Token token) @trusted nothrowHandle prepare phase callback from the event loop.this(FileConfig config)Functions 4
OpenResult mapOpenError(DWORD winError) pure @safe nothrow @nogcMap Windows error codes to OpenResult variants.Variables 11
FILE_SHARE_READ = 0x00000001Windows file share mode.
FILE_SHARE_WRITE = 0x00000002FILE_ATTRIBUTE_NORMAL = 0x00000080FILE_FLAG_OVERLAPPED = 0x40000000O_RDONLY = 0x0000POSIX-like flags for compatibility.
O_WRONLY = 0x0001O_RDWR = 0x0002O_CREAT = 0x0100O_TRUNC = 0x0200O_APPEND = 0x0400int _errnoThread-local errno for Windows compatibility.