v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
Maybe< void > Class Reference

#include <v8-maybe.h>

Inheritance diagram for Maybe< void >:
Collaboration diagram for Maybe< void >:

Public Member Functions

V8_INLINE bool IsNothing () const
 
V8_INLINE bool IsJust () const
 
V8_INLINE bool operator== (const Maybe &other) const
 
V8_INLINE bool operator!= (const Maybe &other) const
 
V8_INLINE bool IsNothing () const
 
V8_INLINE bool IsJust () const
 
V8_INLINE void ToChecked () const
 
V8_INLINE void Check () const
 
V8_WARN_UNUSED_RESULT V8_INLINE bool To (void *out) const
 
V8_INLINE void FromJust () const &
 
V8_INLINE void FromJust () &&
 
V8_INLINE void FromMaybe (const void &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 ()
 
Maybe< void > JustVoid ()
 
Maybe< U > Nothing ()
 
Maybe< U > Just (const U &u)
 
Maybe< U > Just (U &&u)
 

Detailed Description

Definition at line 131 of file v8-maybe.h.

Member Function Documentation

◆ Check()

V8_INLINE void Check ( ) const
inline

Short-hand for ToChecked(), which doesn't return a value. To be used, where the actual value of the Maybe is not needed like Object::Set.

Definition at line 47 of file v8-maybe.h.

◆ FromJust() [1/2]

V8_INLINE void FromJust ( ) &&
inline

Converts this Maybe<> to a value of type T. If this Maybe<> is nothing (empty), V8 will crash the process.

Definition at line 73 of file v8-maybe.h.

◆ FromJust() [2/2]

V8_INLINE void FromJust ( ) const &
inline

Converts this Maybe<> to a value of type T. If this Maybe<> is nothing (empty), V8 will crash the process.

Definition at line 64 of file v8-maybe.h.

◆ FromMaybe()

V8_INLINE void FromMaybe ( const void & default_value) const
inline

Converts this Maybe<> to a value of type T, using a default value if this Maybe<> is nothing (empty).

Definition at line 82 of file v8-maybe.h.

◆ IsJust() [1/2]

V8_INLINE bool IsJust ( ) const
inline

Definition at line 36 of file v8-maybe.h.

◆ IsJust() [2/2]

V8_INLINE bool IsJust ( ) const
inline

Definition at line 134 of file v8-maybe.h.

References V8_INLINE.

◆ IsNothing() [1/2]

V8_INLINE bool IsNothing ( ) const
inline

Definition at line 35 of file v8-maybe.h.

◆ IsNothing() [2/2]

V8_INLINE bool IsNothing ( ) const
inline

Definition at line 133 of file v8-maybe.h.

References V8_INLINE.

◆ operator!=() [1/2]

V8_INLINE bool operator!= ( const Maybe< void > & other) const
inline

Definition at line 91 of file v8-maybe.h.

◆ operator!=() [2/2]

V8_INLINE bool operator!= ( const Maybe< void > & other) const
inline

Definition at line 140 of file v8-maybe.h.

References Maybe< T >::operator==(), and V8_INLINE.

◆ operator==() [1/2]

V8_INLINE bool operator== ( const Maybe< void > & other) const
inline

Definition at line 86 of file v8-maybe.h.

◆ operator==() [2/2]

V8_INLINE bool operator== ( const Maybe< void > & other) const
inline

Definition at line 136 of file v8-maybe.h.

References Maybe< T >::IsJust(), and V8_INLINE.

◆ To()

V8_WARN_UNUSED_RESULT V8_INLINE bool To ( void * out) const
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 55 of file v8-maybe.h.

◆ ToChecked()

V8_INLINE void ToChecked ( ) const
inline

An alias for |FromJust|. Will crash if the Maybe<> is nothing.

Definition at line 41 of file v8-maybe.h.

Friends And Related Symbol Documentation

◆ Just [1/2]

Maybe< U > Just ( const U & u)
friend

◆ Just [2/2]

Maybe< U > Just ( U && u)
friend

◆ JustVoid

Maybe< void > JustVoid ( )
friend

Definition at line 157 of file v8-maybe.h.

◆ Nothing [1/2]

Maybe< U > Nothing ( )
friend

Definition at line 104 of file v8-maybe.h.

◆ Nothing [2/2]

template<class U>
Maybe< U > Nothing ( )
friend

Definition at line 112 of file v8-maybe.h.


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