15 static tl::expected<std::nullopt_t, ResultCode> ExpectOk(
result_t code);
17 template<
typename T>
static T&& AssertOk(tl::expected<T, ResultCode> &&monad);
21 return code == RESULT_OK;
24 inline bool operator==(
const ResultCode &other)
const {
25 return code == other.code;
34 using Result = tl::expected<T, ResultCode>;
41 virtual const char *what()
const noexcept
override;
45 std::string description;
48 template<
typename T> T&& ResultCode::AssertOk(tl::expected<T, ResultCode> &&monad) {
50 return std::move(*monad);
52 throw ResultError(monad.error());
85 uint32_t foreign_permission;
98 KTransferMemory(
void *backing_buffer,
size_t size, uint32_t permissions,
bool owns_buffer=
false);
105 uint8_t *buffer =
nullptr;
107 uint32_t permissions = 0;
109 bool owns_buffer =
false;
122 Result<std::nullopt_t> ResetSignal();
123 Result<std::nullopt_t> WaitSignal(uint64_t timeout);
130 Result<std::nullopt_t> ResetSignal();
131 Result<std::nullopt_t> WaitSignal(uint64_t timeout);
140 Result<std::nullopt_t> Signal();
handle_t debug_h
Debug handle.
Definition: types.h:46
Definition: types.hpp:149
handle_t shared_memory_h
Shared Memory handle.
Definition: types.h:40
uint32_t result_t
Function result.
Definition: types.h:51
handle_t revent_h
revent handle
Definition: types.h:47
handle_t process_h
Process handle.
Definition: types.h:45
Definition: types.hpp:126
Definition: types.hpp:118
handle_t wevent_h
wevent handle
Definition: types.h:48
handle_t port_h
Port handle.
Definition: types.h:43
uint32_t handle_t
Resource handle.
Definition: types.h:38
handle_t resource_limit_h
Resource limit handle.
Definition: types.h:50
Definition: types.hpp:143
Definition: types.hpp:112
Definition: types.hpp:135
handle_t transfer_memory_h
Transfer Memory handle.
Definition: types.h:41