enum status_t The library's only result code.
Values follow errno where one fits, so a failure can be handed to strerror or mapped onto a platform error without a translation table. success_k is zero, which is why the type is scoped and truth-testing goes through succeeded: an implicit conversion would read every success as false. Prefer checking an expected, which already answers this question.
The three conflicts have no errno between them: EBUSY and EAGAIN, the closest, are about a resource being held, while these are about what another transaction published. A retry loop reads them to decide whether retrying can help, which is what conflicted answers.
Statuses fall into five categories. Resources: out_of_memory_heap_k and input_output_k. Input: invalid_argument_k. State: the three conflicts, operation_not_permitted_k, operation_would_block_k, capacity_exhausted_k, key_already_exists_k and key_not_found_k. Interruptions: none, as no verb is cancelled or deferred. Defects: consistency_k and unknown_k. Any verb that allocates, binds a device or touches a file may also return a Resources status. A verb's own block lists only what its contract adds.
Values
success_k | 0 | The operation did what it was asked, and any result it carries is live. |
|---|---|---|
unknown_k | -1 | A failure the library cannot name more precisely, which no caller should branch on. |
consistency_k | -2 | An invariant of the container itself did not hold. |
write_conflict_k | -3 | A key this transaction wrote was published over since its snapshot. |
read_conflict_k | -4 | A key this transaction read was published over since its snapshot. |
phantom_conflict_k | -5 | A window this transaction read gained or lost a member since its snapshot. |
out_of_memory_heap_k | ENOMEM | The heap refused the allocation the operation needed. |
invalid_argument_k | EINVAL | An argument was outside what the call accepts, decided before anything was written. |
operation_not_permitted_k | EPERM | The object is not in a state that admits the call, such as committing what was never staged. |
operation_would_block_k | EWOULDBLOCK | A bounded retry gave up rather than block. |
capacity_exhausted_k | ENOSPC | A probe sequence with no slot left, which a rehash mends rather than more memory. |
input_output_k | EIO | A device or file refused a read or write, which no retry in memory mends. |
key_already_exists_k | EEXIST | A strict insert found the key already taken. |
key_not_found_k | ENOENT | An update or erase found no such key. |