extern "C" fn jsaas_duk_exec_timeout_check(udata: *mut c_void) -> duktape::duk_bool_t {
    let ctx = udata as *const Vec<EvaluateContext>;

    let cont = unsafe {
        if (*ctx).len() == 1 {
            (*(ctx))[0].start.elapsed() <= (*(ctx))[0].limit
        } else {
            false
        }
    };

    if cont {
        0
    } else {
        1
    }
}
/// Upon setup, this library configures each Duktape heap with a udata pointing to
/// a `Vec<EvaluateContext>`. This vector will only ever have one entry in it, which
/// contains the data for the latest call for this context.
///
/// The Duktape source is configured to call into this function (see build.rs)
/// occasionally to allow our library to determine if execution should be stopped
/// due to timeout.
///
/// In essence, this mechanism guards against infinite loops by bounding their
/// execution time against a "wall clock" (ish -- time cannot go backwards).
Upon setup, this library configures each Duktape heap with a udata pointing to
a `Vec`. This vector will only ever have one entry in it, which
contains the data for the latest call for this context.

The Duktape source is configured to call into this function
occasionally to allow our library to determine if execution should be stopped
due to timeout.

In essence, this mechanism guards against infinite loops by bounding their
execution time against a "wall clock" (ish -- time cannot go backwards).
Upon setup this library configures each Duktape heap with a udata pointing to a ` Vec ` . This vector will only ever have one entry in it which contains the data for the latest call for this context . The Duktape source is configured to call into this function occasionally to allow our library to determine if execution should be stopped due to timeout . In essence this mechanism guards against infinite loops by bounding their execution time against a " wall clock " ( ish -- time cannot go backwards ) .
extern "C" fn jsaas_duk_exec_timeout_check(udata: *mut c_void) -> duktape::duk_bool_t {
    let ctx = udata as *const Vec<EvaluateContext>;
    let cont = unsafe {
        if (*ctx).len() == 1 {
            (*(ctx))[0].start.elapsed() <= (*(ctx))[0].limit
        } else {
            false
        }
    };
    if cont {
        0
    } else {
        1
    }
}
extern " " fn jsaas_duk_exec_timeout_check ( udata : * mut c_void ) -> duktape :: duk_bool_t { let ctx = udata as * const Vec < EvaluateContext > ; let cont = unsafe { if ( * ctx ) . len ( ) == 1 { ( * ( ctx ) ) [ 0 ] . start . elapsed ( ) <= ( * ( ctx ) ) [ 0 ] . limit } else { false } } ; if cont { 0 } else { 1 } }
Upon setup, this library configures each Duktape heap with a udata pointing to
a `Vec<EvaluateContext>`.
Upon setup this library configures each Duktape heap with a udata pointing to a ` Vec<EvaluateContext > ` .
udata
*mut c_void