|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <result.hpp>
Public Member Functions | |
| ErrorCode | code () const |
| Get the underlying error code. | |
| bool | ok () const |
| Returns true if the operation succeeded. | |
| operator bool () const | |
Explicit bool conversion — allows if (result) { ... }. | |
| int32_t | raw () const |
| Get the raw integer code (for FFI interop). | |
| constexpr | ResultOf () |
| Default-construct a success. | |
| constexpr | ResultOf (ErrorCode code) |
| Construct from a typed code. | |
| constexpr | ResultOf (int32_t raw) |
Construct from a raw FFI return value (int32_t). | |
Static Public Member Functions | |
| static constexpr ResultOf | success () |
| Named constructors. | |
Result — a fallible operation that produces no value.
NROS_NODISCARD: a discarded result is a failure nobody was told about, which is the one outcome this channel exists to prevent. That attribute is a signal to a reader and to a -Werror consumer, not an enforced gate in this tree (see NROS_NODISCARD's own doc above for the measured warning-vs-error spelling); where a failure must not be ignorable, the refusal has to be at RUNTIME — which is what rclcpp::detail::require_created does for the create_* verbs, and what rclcpp::init(argc, argv) already does for --ros-args.
|
inlineconstexpr |
Default-construct a success.
|
inlineconstexpr |
Construct from a typed code.
|
inlineconstexpr |
Construct from a raw FFI return value (int32_t).
|
inline |
Get the underlying error code.
|
inline |
Returns true if the operation succeeded.
|
inlineexplicit |
Explicit bool conversion — allows if (result) { ... }.
|
inline |
Get the raw integer code (for FFI interop).
|
inlinestaticconstexpr |
Named constructors.