|
violet
Simple, cross-platform graphics API
|
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 > | |
| T | unwrap_or (U &&default_value) const |
| template<typename F > | |
| T | unwrap_or_else (F &&f) const |