v8
6.8.275 (node 10.15.3)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Public Member Functions | |
V8_INLINE bool | IsNothing () const |
V8_INLINE bool | IsJust () const |
V8_INLINE T | ToChecked () const |
V8_WARN_UNUSED_RESULT V8_INLINE bool | To (T *out) const |
V8_INLINE T | FromJust () const |
V8_INLINE T | FromMaybe (const T &default_value) const |
V8_INLINE bool | operator== (const Maybe &other) const |
V8_INLINE bool | operator!= (const Maybe &other) const |
Friends | |
template<class U > | |
Maybe< U > | Nothing () |
template<class U > | |
Maybe< U > | Just (const U &u) |
A simple Maybe type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html.
If an API method returns a Maybe<>, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a TerminateExecution exception was thrown. In that case, a "Nothing" value is returned.
|
inline |
Converts this Maybe<> to a value of type T. If this Maybe<> is nothing (empty), V8 will crash the process.
Definition at line 8497 of file v8.h.
References Maybe< T >::IsJust().
Referenced by Maybe< T >::operator==(), and Maybe< T >::ToChecked().
|
inline |
|
inline |
Definition at line 8477 of file v8.h.
Referenced by Maybe< T >::FromJust(), Maybe< T >::operator==(), and Maybe< T >::To().
Definition at line 8515 of file v8.h.
References Maybe< T >::operator==().
Definition at line 8510 of file v8.h.
References Maybe< T >::FromJust(), and Maybe< T >::IsJust().
Referenced by Maybe< T >::operator!=().
|
inline |
Converts this Maybe<> to a value of type T. If this Maybe<> is nothing (empty), |false| is returned and |out| is left untouched.
Definition at line 8488 of file v8.h.
References Maybe< T >::IsJust().
|
inline |
An alias for |FromJust|. Will crash if the Maybe<> is nothing.
Definition at line 8482 of file v8.h.
References Maybe< T >::FromJust().
|
friend |