#pragma once #include #include #include template concept async_awaitable = requires(T a) { // TODO: await_ready and await_suspend { a.await_resume() } -> std::same_as; }; template concept async_source = requires(T a) { { a.async_get() } -> async_awaitable; }; template concept async_sink = requires(T a, U v) { { a.async_put(v) } -> async_awaitable<>; }; template concept async_byte_source = async_source; template concept async_byte_sink = async_sink; template concept async_packet_source = requires(T a, std::span buf) { { a.async_read(buf) } -> async_awaitable>; }; template concept async_packet_sink = requires(T a, std::span buf) { { a.async_write(buf) } -> async_awaitable<>; };