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

void specialization for operations that only report success or failure. More...

#include <result.h>

Public Member Functions

bool ok () const noexcept
 True when the operation succeeded.
 
bool hasError () const noexcept
 True when the operation failed.
 
 operator bool () const noexcept
 Allows if (result) style success checks.
 
void value () const
 Validates success.
 
E & error () &
 Access the error value.
 
const E & error () const &
 Access the error value.
 
E && error () &&
 Move the error value out.
 
const E && error () const &&
 Move the error value out.
 

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.

Member Function Documentation

◆ error() [1/4]

template<typename E >
E & livekit::Result< void, E >::error ( ) &
inline

Access the error value.

Exceptions
std::logic_errorif hasError() == false.

◆ error() [2/4]

template<typename E >
E && livekit::Result< void, E >::error ( ) &&
inline

Move the error value out.

Exceptions
std::logic_errorif hasError() == false.

◆ error() [3/4]

template<typename E >
const E & livekit::Result< void, E >::error ( ) const &
inline

Access the error value.

Exceptions
std::logic_errorif hasError() == false.

◆ error() [4/4]

template<typename E >
const E && livekit::Result< void, E >::error ( ) const &&
inline

Move the error value out.

Exceptions
std::logic_errorif hasError() == false.

◆ value()

template<typename E >
void livekit::Result< void, E >::value ( ) const
inline

Validates success.

Mirrors the value() API shape on the primary template so generic code can use the same form for both.

Exceptions
std::logic_errorif ok() == false.

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