Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
dialog_command_result.hpp
1// Copyright (c) 2026 ttldtor.
2// SPDX-License-Identifier: BSL-1.0
3#pragma once
4
5#include <portals/managed_diagnostics.hpp>
6
7namespace portals::ui {
8namespace detail {
9struct RefAccess;
10struct MessageAccess;
11struct NotificationAccess;
12} // namespace detail
13
20class DialogCommandResult {
21public:
23 explicit operator bool() const {
24 return result_.has_value();
25 }
26
31 return result_.error();
32 }
33
37 std::expected<void, ManagedError> result() const {
38 return result_;
39 }
40
41private:
42 friend struct detail::RefAccess;
43 friend struct detail::MessageAccess;
44 friend struct detail::NotificationAccess;
45
46 explicit DialogCommandResult(std::expected<void, ManagedError> result) : result_(std::move(result)) {
47 }
48
49 std::expected<void, ManagedError> result_;
50};
51} // namespace portals::ui
Owning checked command that also permits the admitted short callback form. This is a narrow facade re...
Definition dialog_command_result.hpp:20
ManagedError error() const
Definition dialog_command_result.hpp:30
std::expected< void, ManagedError > result() const
Definition dialog_command_result.hpp:37
Original error plus independent runner/restoration and cleanup failures.
Definition managed_diagnostics.hpp:62