Io module

This module provides base class for io objects and corresponding read / write functions.

Contents

The read / write functions were provided in three flavors, under three namespaces:

The async io functions takes an additional ark::callback which was invoked by ark::async_context on completion. The coro io functions are Awaitables, which could be used with co_await, and will be resumed in ark::async_context on completion.

The io objects can be bundled with an ark::async_context (by inheriting ark::with_async_context), which is necessary for usage with async or coro variants of io functions.

Namespaces

namespace ark::coro
contains apis that returns an Awaitable
namespace ark::async
contains apis that invokes a given ark::callback on completion
namespace ark::sync
contains apis that blocks until completion

Classes

class ark::nonseekable_fd
An io object, denotes a non lseek()-able fd as defined in kernel.
class ark::seekable_fd
An io object, denotes a lseek()-able fd as defined in kernel.

Functions

auto transfer_all() -> auto constexpr noexcept
returns a CompletionCondition which denotes transfering until all bytes in provided buffer is done.
auto transfer_at_least(size_t n) -> auto noexcept
returns a CompletionCondition which denotes transfering at least n bytes, or until all bytes in provided buffer is done.
auto transfer_exactly(size_t n) -> auto noexcept
returns a CompletionCondition which denotes transfering exactly n bytes, or until all bytes in provided buffer is done.

Function documentation

auto transfer_all() constexpr noexcept

returns a CompletionCondition which denotes transfering until all bytes in provided buffer is done.

auto transfer_at_least(size_t n) noexcept

returns a CompletionCondition which denotes transfering at least n bytes, or until all bytes in provided buffer is done.

auto transfer_exactly(size_t n) noexcept

returns a CompletionCondition which denotes transfering exactly n bytes, or until all bytes in provided buffer is done.