#duktape #ducc #low-level #set #duk

bin+lib ducc-sys

Low-level Duktape FFI for the ducc crate

3 releases

Uses old Rust 2015

0.1.2 Oct 11, 2019
0.1.1 Oct 11, 2019
0.1.0 Sep 21, 2019

#2 in #ducc

Download history 24666/week @ 2024-07-24 20244/week @ 2024-07-31 30733/week @ 2024-08-07 24112/week @ 2024-08-14 30735/week @ 2024-08-21 28054/week @ 2024-08-28 25664/week @ 2024-09-04 29064/week @ 2024-09-11 23622/week @ 2024-09-18 28587/week @ 2024-09-25 28924/week @ 2024-10-02 32055/week @ 2024-10-09 25549/week @ 2024-10-16 23991/week @ 2024-10-23 18447/week @ 2024-10-30 18722/week @ 2024-11-06

91,605 downloads per month
Used in 11 crates (via ducc)

MIT license

3.5MB
72K SLoC

C 70K SLoC // 0.2% comments Rust 2K SLoC

ducc-sys

Low-level Duktape FFI for the ducc crate.

Helper extensions

This FFI exposes all of the stock Duktape items (all prefixed with duk_ or DUK_). In addition to these items, the FFI also offers helper extensions specifically for dealing with Duktape from Rust. These are all prefixed with ducc_ and are listed below:

ducc_push_c_function_nothrow

Like duk_push_c_function, but negative values from func are handled differently. Instead of being able to return DUK_RET_xxx, func can return -1 (all negatively values are handled the same currently) to have an error object pushed to the top of the stack be thrown.

When func returns a non-negative integer, this function is handled equivalent to how it is handled with duk_push_c_function.

This function assigns a hidden property named "__NOTHROWFUNC" on the newly created function (DUK_HIDDEN_SYMBOL("__NOTHROWFUNC")).

ducc_set_exec_timeout_function

Sets the global timeout callback. This should be set only once per application, as it is shared between all contexts. See DUK_USE_EXEC_TIMEOUT_CHECK for more information on how this callback should function.

Execution timeout are only enabled if the use-exec-timeout-check Cargo feature is set.

ducc_exec_timeout_function

The callback type for duk_set_exec_timeout_function.

Dependencies