violet
Simple, cross-platform graphics API
Loading...
Searching...
No Matches
violet::Result< T, E > Class Template Reference

Public Member Functions

 Result (const T &value)
 
 Result (T &&value)
 
template<typename U = E, typename = std::enable_if_t<!std::is_same_v<T, U>>>
 Result (const E &error)
 
template<typename U = E, typename = std::enable_if_t<!std::is_same_v<T, U>>>
 Result (E &&error)
 
bool is_ok () const
 
bool is_err () const
 
const T & expect (const std::string &message) const &
 
T && expect (const std::string &message) &&
 
const T & unwrap () const &
 
T && unwrap () &&
 
const T & unwrap_ok () const &
 
T && unwrap_ok () &&
 
const E & unwrap_err () const &
 
E && unwrap_err () &&
 
template<typename F >
auto map (F &&f) const -> Result< decltype(f(std::declval< T >())), E >
 
template<typename F >
auto map_err (F &&f) const -> Result< T, decltype(f(std::declval< E >()))>
 
template<typename F >
auto and_then (F &&f) const
 
template<typename U >
unwrap_or (U &&default_value) const
 
template<typename F >
unwrap_or_else (F &&f) const
 

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