Skip to content

API Overview

Ilias can be understood in six layers: runtime, tasks, I/O, networking, synchronization, and optional extensions. In day-to-day development, you usually only need a small subset of headers.

Recommended entry headers

  • #include <ilias.hpp>
  • #include <ilias/platform.hpp>
  • #include <ilias/task.hpp>
  • #include <ilias/io.hpp>
  • #include <ilias/net.hpp>
  • #include <ilias/fs.hpp>
  • #include <ilias/sync.hpp>
  • #include <ilias/tls.hpp>
  • #include <ilias/process.hpp>
  • #include <ilias/signal.hpp>

Module summary

ModuleMain APIsPurpose
platformPlatformContext, ilias_mainInstall the current-thread executor and start async programs
taskTask<T>, spawn, whenAll, whenAny, TaskScope, TaskGroup<T>, ThreadWrite and organize coroutines
runtimeExecutor, stop token, this_coro::*Execution, cancellation, coroutine context access
ioBufReader, BufWriter, BufStream, readAll, writeAll, getlineUniform stream-oriented I/O
netTcpStream, TcpListener, UdpSocket, AddressInfoNetworking
fsFile, OpenOptionsFile I/O
syncMutex, Event, Semaphore, oneshot::channel<T>, mpsc::channel<T>()Synchronization and messaging
tlsTlsContext, TlsStream<T>TLS client/server support
processProcess::Builder, ProcessAsync child processes
signalsignal::ctrlC()Graceful console shutdown

Key public concepts

Task<T> and IoTask<T>

  • Task<T>: regular async result
  • IoTask<T>: I/O result, effectively Task<Result<T, std::error_code>>

Unified stream model

Many types expose similar operations:

  • read(MutableBuffer)
  • write(Buffer)
  • flush()
  • shutdown()
  • close() / cancel()

That makes protocol code reusable across TcpStream, TlsStream<T>, File, and BufStream<T>.

Structured concurrency

  • TaskScope: parent-child lifetime management
  • TaskGroup<T>: batch task result collection

Cancellation model

Ilias uses stop tokens rather than making cancellation exception-only.

Common APIs:

  • this_coro::stopToken()
  • this_coro::isStopRequested()
  • this_coro::stopped()
  • handle.stop()

Suggested reading order

  1. Quick Start
  2. What is ilias
  3. The public headers under include/ilias/