ICU4X
International Components for Unicode
Loading...
Searching...
No Matches
diplomat::result< T, E > Class Template Reference

#include <diplomat_runtime.hpp>

Public Member Functions

 result (Ok< T > &&v)
 
 result (Err< E > &&v)
 
 result ()=default
 
 result (const result &)=default
 
resultoperator= (const result &)=default
 
resultoperator= (result &&) noexcept=default
 
 result (result &&) noexcept=default
 
 ~result ()=default
 
bool is_ok () const
 
bool is_err () const
 
std::optional< T > ok () &&
 
std::optional< E > err () &&
 
void set_ok (T &&t)
 
void set_err (E &&e)
 
template<typename T2 >
result< T2, E > replace_ok (T2 &&t)
 

Constructor & Destructor Documentation

◆ result() [1/5]

template<class T , class E >
diplomat::result< T, E >::result ( Ok< T > &&  v)
inline

◆ result() [2/5]

template<class T , class E >
diplomat::result< T, E >::result ( Err< E > &&  v)
inline

◆ result() [3/5]

template<class T , class E >
diplomat::result< T, E >::result ( )
default

◆ result() [4/5]

template<class T , class E >
diplomat::result< T, E >::result ( const result< T, E > &  )
default

◆ result() [5/5]

template<class T , class E >
diplomat::result< T, E >::result ( result< T, E > &&  )
defaultnoexcept

◆ ~result()

template<class T , class E >
diplomat::result< T, E >::~result ( )
default

Member Function Documentation

◆ err()

template<class T , class E >
std::optional< E > diplomat::result< T, E >::err ( ) &&
inline

◆ is_err()

template<class T , class E >
bool diplomat::result< T, E >::is_err ( ) const
inline

◆ is_ok()

template<class T , class E >
bool diplomat::result< T, E >::is_ok ( ) const
inline

◆ ok()

template<class T , class E >
std::optional< T > diplomat::result< T, E >::ok ( ) &&
inline

◆ operator=() [1/2]

template<class T , class E >
result & diplomat::result< T, E >::operator= ( const result< T, E > &  )
default

◆ operator=() [2/2]

template<class T , class E >
result & diplomat::result< T, E >::operator= ( result< T, E > &&  )
defaultnoexcept

◆ replace_ok()

template<class T , class E >
template<typename T2 >
result< T2, E > diplomat::result< T, E >::replace_ok ( T2 &&  t)
inline

◆ set_err()

template<class T , class E >
void diplomat::result< T, E >::set_err ( E &&  e)
inline

◆ set_ok()

template<class T , class E >
void diplomat::result< T, E >::set_ok ( T &&  t)
inline

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