|
LiveKit C++ SDK
Real-time audio/video SDK for C++
|
#include <result.h>
Public Member Functions | |
| bool | ok () const noexcept |
| True when the operation succeeded. | |
| bool | has_error () const noexcept |
| True when the operation failed. | |
| operator bool () const noexcept | |
Allows if (result) style success checks. | |
| void | value () const noexcept |
Validates success in debug builds. Mirrors the value() API shape. | |
| E & | error () &noexcept |
Access the error value. Requires has_error() == true. | |
| const E & | error () const &noexcept |
Access the error value. Requires has_error() == true. | |
| E && | error () &&noexcept |
Move the error value out. Requires has_error() == true. | |
| const E && | error () const &&noexcept |
Move the error value out. Requires has_error() == true. | |
Static Public Member Functions | |
| static Result | success () |
| Construct a successful result with no payload. | |
| template<typename F = E, typename = std::enable_if_t<std::is_constructible<E, F &&>::value>> | |
| static Result | failure (F &&error) |
| Construct a failed result containing an error. | |
void specialization for operations that only report success or failure.
This keeps the same calling style as Result<T, E> without forcing callers to invent a dummy success payload.