|
Switchboard SDK
|
Represents the result of an operation that can either succeed or fail. More...
#include <Result.hpp>
Public Member Functions | |
| Result (ValueType value) | |
| Result (Error error) | |
| bool | isSuccess () const |
| Returns true if the operation was successful. | |
| bool | isError () const |
| Returns true if the operation failed. | |
| ValueType | value () const |
| Returns the value of the operation if it was successful. | |
| Error | error () const |
| Returns the error of the operation if it failed. | |
| Result< std::any > | toAny () const |
| Converts the result to a std::any type. | |
Represents the result of an operation that can either succeed or fail.
|
inlinenodiscard |
Returns the error of the operation if it failed.
|
inlinenodiscard |
Returns true if the operation failed.
|
inlinenodiscard |
Returns true if the operation was successful.
|
inlinenodiscard |
Converts the result to a std::any type.
If the operation was successful, it returns a Result<std::any> containing the value. If the operation failed, it returns a Result<std::any> containing the error message.
|
inlinenodiscard |
Returns the value of the operation if it was successful.