class jnc.Promise

class Promise {
    // fields

    variant_t readonly m_result;
    std.Error const* readonly m_error;

    // properties

    bool const property m_isCompleted;

    // construction

    construct();
    destruct();

    // methods

    void async asyncSetScheduler(jnc.Scheduler* scheduler);
    long errorcode wait(void function* handler());
    long errorcode wait(void function* handler(std.Error const* error));
    long errorcode wait(void function* handler(variant_t result, std.Error const* error));
    bool errorcode cancelWait(long handle);
    variant_t blockingWait();
    variant_t async asyncWait();
};