LiveKit C++ SDK
Real-time audio/video SDK for C++
Loading...
Searching...
No Matches
livekit::Result< void, E > Class Template Reference

#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.
 

Detailed Description

template<typename E>
class livekit::Result< void, E >

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.


The documentation for this class was generated from the following file: