morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::author::MutationHandle< Action > Class Template Reference

A mutation declared by a scope. More...

#include <author.hpp>

Public Types

using Result = ::morph::model::ActionTraits<Action>::Result
 The result's C++ type.

Public Member Functions

 MutationHandle (std::string name)
 A mutation by name.
std::string const & name () const noexcept
 The mutation's name.
ResultHandle< Result > result () const
 The last run's result; bind it with let to read its fields.
Handle< bool > pending () const
 Whether a run is in flight.
Handle< std::string > error () const
 The last run's error text.
Handle< std::string > errorKind () const
 The kind of the last run's error.
Handle< bool > can () const
 Whether the signed-in principal may run the mutation.
 operator MutationRef () const
 The mutation without its action type.

Detailed Description

template<typename Action>
class morph::ui::author::MutationHandle< Action >

A mutation declared by a scope.

Template Parameters
ActionThe action it runs; morph::model::ActionTraits<Action>::Result is the result's type.

Definition at line 1421 of file author.hpp.

Member Typedef Documentation

◆ Result

template<typename Action>
using morph::ui::author::MutationHandle< Action >::Result = ::morph::model::ActionTraits<Action>::Result

The result's C++ type.

Definition at line 1424 of file author.hpp.

Constructor & Destructor Documentation

◆ MutationHandle()

template<typename Action>
morph::ui::author::MutationHandle< Action >::MutationHandle ( std::string name)
inlineexplicit

A mutation by name.

Parameters
nameThe mutation's name.

Definition at line 1428 of file author.hpp.

Member Function Documentation

◆ name()

template<typename Action>
std::string const & morph::ui::author::MutationHandle< Action >::name ( ) const
inlinenodiscardnoexcept

The mutation's name.

Returns
The name.

Definition at line 1432 of file author.hpp.

◆ result()

template<typename Action>
ResultHandle< Result > morph::ui::author::MutationHandle< Action >::result ( ) const
inlinenodiscard

The last run's result; bind it with let to read its fields.

Returns
{"result": name}, with no at.

Definition at line 1436 of file author.hpp.

◆ pending()

template<typename Action>
Handle< bool > morph::ui::author::MutationHandle< Action >::pending ( ) const
inlinenodiscard

Whether a run is in flight.

Returns
{"pending": name}.

Definition at line 1442 of file author.hpp.

◆ error()

template<typename Action>
Handle< std::string > morph::ui::author::MutationHandle< Action >::error ( ) const
inlinenodiscard

The last run's error text.

Returns
{"error": name}.

Definition at line 1446 of file author.hpp.

◆ errorKind()

template<typename Action>
Handle< std::string > morph::ui::author::MutationHandle< Action >::errorKind ( ) const
inlinenodiscard

The kind of the last run's error.

Returns
{"errorKind": name}.

Definition at line 1452 of file author.hpp.

◆ can()

template<typename Action>
Handle< bool > morph::ui::author::MutationHandle< Action >::can ( ) const
inlinenodiscard

Whether the signed-in principal may run the mutation.

Returns
{"can": name}.

Definition at line 1458 of file author.hpp.

◆ operator MutationRef()

template<typename Action>
morph::ui::author::MutationHandle< Action >::operator MutationRef ( ) const
inline

The mutation without its action type.

Returns
The reference.

Definition at line 1462 of file author.hpp.


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