PythonMonkey   v1.1.1 (dev)
Loading...
Searching...
No Matches
PromiseType Struct Reference

This struct represents the JS Promise type in Python using our custom pythonmonkey.promise type. More...

#include <PromiseType.hh>

Static Public Member Functions

static PyObject * getPyObject (JSContext *cx, JS::HandleObject promise)
 Construct a new PromiseType object from a JS::PromiseObject.
 
static JSObject * toJsPromise (JSContext *cx, PyObject *pyObject)
 Convert a Python awaitable object to JS Promise.
 

Detailed Description

This struct represents the JS Promise type in Python using our custom pythonmonkey.promise type.

Member Function Documentation

◆ getPyObject()

PyObject * PromiseType::getPyObject ( JSContext *  cx,
JS::HandleObject  promise 
)
static

Construct a new PromiseType object from a JS::PromiseObject.

Parameters
cx- javascript context pointer
promise- JS::PromiseObject to be coerced
Returns
PyObject* pointer to the resulting PyObject

◆ toJsPromise()

JSObject * PromiseType::toJsPromise ( JSContext *  cx,
PyObject *  pyObject 
)
static

Convert a Python awaitable object to JS Promise.

Parameters
cx- javascript context pointer
pyObject- the python awaitable to be converted

The documentation for this struct was generated from the following files: