Crates.io | jscjs_sys |
lib.rs | jscjs_sys |
version | 0.0.3 |
source | src |
created_at | 2020-09-01 21:30:42.896878 |
updated_at | 2020-09-22 07:17:49.156787 |
description | System crate providing bindings to the Webkit JavsScript engine, JavaScriptCore |
homepage | |
repository | https://github.com/drtychai/jsc-sys |
max_upload_size | |
id | 283654 |
size | 82,696 |
A *-sys
crate of raw bindings to the JavaScriptCore low-level C API.
Add the following to your Cargo.toml
:
[dependencies]
jscjs_sys = "0.0.3"
All necessary definitions are provided to easily interoperate with the JSC API on all x86_64
*nix
architectures supported by Rust. This crate explicity exports:
libJavaScriptCore | jscjs_sys |
---|---|
JSContextGroupRef |
jscjs_sys::VM |
JSGlobalContextRef |
jscjs_sys::Context |
JSString |
jscjs_sys::Sting |
JSValueRef |
jscjs_sys::Value |
JSObjectref |
jscjs_sys::Object |
These bindings are designed to be a fairly straightforward translation to the low-level C API, while taking advantage of Rust's memory safety. For more about the JavaScriptCore API, see the API source and the documentation.
Provided below are some practical examples of what functionalities this crate allows:
llvm-dev
or clang-dev
)cmake
and make
utilitiescd /path/to/WebKit && Tools/gtk/install-dependencies
Clone crate and WebKit source (included as a submodule):
➜ git clone https://github.com/drtychai/jsc-sys
➜ cd jsc-sys && \
git submodule update --remote --init --recursive
No special caveats to builds:
➜ cargo build [-vv] [--target <TRIPLE>]
[ ... ]
Packaging requires a runtime clone of WebKit unless the SRC_DIR
environment variable is set:
➜ export SRC_DIR=/abs/path/to/webkit && \
cargo package [-vv] [--target <TRIPLE>]
[ ... ]