Loading...
Searching...
No Matches
terra::util::Result< T, E > Class Template Reference

#include <result.hpp>

Public Member Functions

 Result (T value)
 
 Result (E error)
 
bool is_ok () const
 
bool is_err () const
 
T & unwrap ()
 
const T & unwrap () const
 
E & error ()
 
const E & error () const
 
unwrap_or (T default_value) const
 
template<typename Func >
auto map (Func f) const -> Result< decltype(f(std::declval< T >())), E >
 

Constructor & Destructor Documentation

◆ Result() [1/2]

template<typename T = Ok, typename E = std::string>
terra::util::Result< T, E >::Result ( value)
inline

◆ Result() [2/2]

template<typename T = Ok, typename E = std::string>
terra::util::Result< T, E >::Result ( error)
inline

Member Function Documentation

◆ error() [1/2]

template<typename T = Ok, typename E = std::string>
E & terra::util::Result< T, E >::error ( )
inline

◆ error() [2/2]

template<typename T = Ok, typename E = std::string>
const E & terra::util::Result< T, E >::error ( ) const
inline

◆ is_err()

template<typename T = Ok, typename E = std::string>
bool terra::util::Result< T, E >::is_err ( ) const
inline

◆ is_ok()

template<typename T = Ok, typename E = std::string>
bool terra::util::Result< T, E >::is_ok ( ) const
inline

◆ map()

template<typename T = Ok, typename E = std::string>
template<typename Func >
auto terra::util::Result< T, E >::map ( Func  f) const -> Result< decltype( f( std::declval< T >() ) ), E >
inline

◆ unwrap() [1/2]

template<typename T = Ok, typename E = std::string>
T & terra::util::Result< T, E >::unwrap ( )
inline

◆ unwrap() [2/2]

template<typename T = Ok, typename E = std::string>
const T & terra::util::Result< T, E >::unwrap ( ) const
inline

◆ unwrap_or()

template<typename T = Ok, typename E = std::string>
T terra::util::Result< T, E >::unwrap_or ( default_value) const
inline

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