|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
Result of AsyncCommand<R, Args...>::co_execute(...). More...
#include <async_command_result.hpp>
Public Member Functions | |
| operator bool () const noexcept | |
| R & | operator* () &noexcept |
| Direct access to the produced value. | |
| const R & | operator* () const &noexcept |
| R && | operator* () &&noexcept |
| const R && | operator* () const &&noexcept |
| R * | operator-> () noexcept |
| const R * | operator-> () const noexcept |
| template<typename U> | |
| R | value_or (U &&fallback) const & |
| Convenience: extract value or fall back. | |
| template<typename U> | |
| R | value_or (U &&fallback) && |
Static Public Member Functions | |
| static AsyncCommandResult | completed_with (R v) |
| static AsyncCommandResult | dropped_ () |
| static AsyncCommandResult | cancelled_ (::aria::Error e) |
| static AsyncCommandResult | failed_ (::aria::Error e) |
Public Attributes | |
| std::optional< R > | value {} |
Result of AsyncCommand<R, Args...>::co_execute(...).
Conversion to bool is completed() — the most common consumption pattern (if (r) use(*r);). For richer dispatch use the explicit predicates or inspect .status / .error directly.
value is engaged iff status == Completed. Dereferencing (*r / r->) on a non-Completed result is undefined behaviour; guard with if (r) first. This mirrors the std::optional contract and keeps the happy path zero-overhead.
|
inlineexplicitnodiscardnoexcept |
|
inlinenodiscardnoexcept |
Direct access to the produced value.
Precondition: completed(). Defined only for the four standard ref qualifiers so move-out works naturally:
auto v = std::move(*co_await cmd.co_execute(args));
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscard |
Convenience: extract value or fall back.
Does NOT throw on non-completed; pair with explicit status checks if you need to distinguish "no value" from "default value".
|
inlinenodiscard |
|
inlinestaticnodiscard |
|
inlinestaticnodiscard |
|
inlinestaticnodiscard |
|
inlinestaticnodiscard |
| std::optional<R> aria::async::AsyncCommandResult< R >::value {} |