Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::async::AsyncCommandResult< void > Struct Reference

Specialisation for void-returning commands. More...

#include <async_command_result.hpp>

Inheritance diagram for aria::async::AsyncCommandResult< void >:
[legend]

Public Member Functions

 operator bool () const noexcept
void & operator* () &noexcept
 Direct access to the produced value.
void * operator-> () noexcept
void value_or (U &&fallback) const &
 Convenience: extract value or fall back.

Static Public Member Functions

static AsyncCommandResult completed_with ()
static AsyncCommandResult dropped_ ()
static AsyncCommandResult cancelled_ (::aria::Error e)
static AsyncCommandResult failed_ (::aria::Error e)

Public Attributes

std::optional< void > value

Detailed Description

Specialisation for void-returning commands.

No payload field; the status alone (plus optional error) carries the full outcome.

Member Function Documentation

◆ operator bool()

aria::async::AsyncCommandResult< void >::operator bool ( ) const
inlineexplicitnodiscardnoexcept

◆ completed_with()

AsyncCommandResult aria::async::AsyncCommandResult< void >::completed_with ( )
inlinestaticnodiscard

◆ dropped_()

AsyncCommandResult aria::async::AsyncCommandResult< void >::dropped_ ( )
inlinestaticnodiscard

◆ cancelled_()

AsyncCommandResult aria::async::AsyncCommandResult< void >::cancelled_ ( ::aria::Error e)
inlinestaticnodiscard

◆ failed_()

AsyncCommandResult aria::async::AsyncCommandResult< void >::failed_ ( ::aria::Error e)
inlinestaticnodiscard

◆ operator*()

void & aria::async::AsyncCommandResult< void >::operator* ( ) &
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)); 

◆ operator->()

void * aria::async::AsyncCommandResult< void >::operator-> ( )
inlinenodiscardnoexcept

◆ value_or()

void aria::async::AsyncCommandResult< void >::value_or ( U && fallback) const &
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".

Member Data Documentation

◆ value

std::optional<void> aria::async::AsyncCommandResult< void >::value

The documentation for this struct was generated from the following file: