Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::EditSession< Row > Class Template Reference

Owning UI-thread-affine current-record editing descriptor; no runtime is created before mount. Field/session operations, including retained inspection and reply admission, require the creating UI thread. Workers receive owning requests and deliver receipts through the existing UI delivery path. More...

#include <ui_model_edit.hpp>

Public Member Functions

template<class Value>
EditField< Row, Value > field (Value Row::*member) const
 Typed field with a process-local member shorthand.
template<class Value>
EditField< Row, Value > field (std::string_view key, Value Row::*member, std::type_identity_t< std::shared_ptr< EditEndpoint< Value > > > endpoint={}) const
 Typed field with an explicit persistent schema key.
EditorCommandResult commit (std::source_location origin=std::source_location::current()) const
EditorCommandResult cancel (std::source_location origin=std::source_location::current()) const
std::shared_ptr< const EditCommitResult > lastResult () const
std::expected< bool, TreeError > applyReply (const EditReceipt &receipt) const

Friends

template<class, class>
class EditField
template<class>
class RowContext
template<class, class>
class RowField
template<class T>
EditSession< T > edit (Navigation< T >, EditOptions)

Detailed Description

template<class Row>
class portals::ui::EditSession< Row >

Owning UI-thread-affine current-record editing descriptor; no runtime is created before mount. Field/session operations, including retained inspection and reply admission, require the creating UI thread. Workers receive owning requests and deliver receipts through the existing UI delivery path.

Member Function Documentation

◆ applyReply()

template<class Row>
std::expected< bool, TreeError > portals::ui::EditSession< Row >::applyReply ( const EditReceipt & receipt) const
inline
Parameters
receiptOriginal owning backend reply.
Returns
True for an admitted final reply, false when stale.

◆ cancel()

template<class Row>
EditorCommandResult portals::ui::EditSession< Row >::cancel ( std::source_location origin = std::source_location::current()) const
inline
Parameters
originCalling location used by managed error reporting.
Returns
Cancel only displayed/current drafts, adopting admitted accepted values. Already admitted backend requests remain in flight; cancellation does not undo backend work.

◆ commit()

template<class Row>
EditorCommandResult portals::ui::EditSession< Row >::commit ( std::source_location origin = std::source_location::current()) const
inline
Parameters
originCalling location used by managed error reporting.
Returns
Checked command admission; pending remains visible in lastResult(), never claimed committed.

◆ field() [1/2]

template<class Row>
template<class Value>
EditField< Row, Value > portals::ui::EditSession< Row >::field ( std::string_view key,
Value Row::* member,
std::type_identity_t< std::shared_ptr< EditEndpoint< Value > > > endpoint = {} ) const
inline

Typed field with an explicit persistent schema key.

Parameters
keyNonempty schema identity copied into owning storage.
memberRecord member selected by this field.
endpointOptional source adapter; omitted for the built-in model field capability.
Returns
Shared field descriptor, or an empty descriptor for an invalid or conflicting key.

◆ field() [2/2]

template<class Row>
template<class Value>
EditField< Row, Value > portals::ui::EditSession< Row >::field ( Value Row::* member) const
inline

Typed field with a process-local member shorthand.

Parameters
memberRecord member selected by this field; its pointer is not a persistent schema key.
Returns
Shared field descriptor retaining the selected record's draft and history.

◆ lastResult()

template<class Row>
std::shared_ptr< const EditCommitResult > portals::ui::EditSession< Row >::lastResult ( ) const
inline
Returns
Owning explicit per-field result; non-atomic partial acceptance remains visible.

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