DiskIo
The disk subsystem boundary. This is the Kotlin counterpart of libtorrent's disk_interface (disk_interface.hpp). libtorrent dispatches each operation to a thread pool and hands back the result through a completion callback; here every operation simply suspends, so the caller writes straight-line coroutine code and the implementation is free to run blocking file I/O on an I/O dispatcher.
Implementations live per-platform (a kotlinx-io-backed one for JVM/Android/native); this interface keeps the engine itself storage-agnostic, exactly as libtorrent's does, which is what makes an in-memory test double trivial.
Inheritors
Functions
Which pieces do we already have on disk? Drives the initial resume/recheck.
Hash a fully-downloaded piece for verification against the torrent's hashes.
Move all storage to newSavePath, the counterpart of libtorrent's async_move_storage (storage_utils.cpp move_storage). Open handles are flushed and closed, the on-disk files (and any part-file) are relocated under the new save path, and subsequent reads/writes target the new location. A best-effort, no-op default is provided for backends without on-disk state (e.g. the in-memory double).