|
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 | Result () |
| Default-construct a success. | |
| constexpr | Result (ErrorCode code) |
| Construct from a typed code. | |
| constexpr | Result (int32_t raw) |
Construct from a raw FFI return value (int32_t). | |
Static Public Member Functions | |
| static constexpr Result | success () |
| Named constructors. | |
Result type for fallible operations.
This replaces exceptions in freestanding C++. Use the NROS_TRY macro for early return on error.
|
inlineconstexpr |
Default-construct a success.
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).