6 releases (2 stable)
✓ Uses Rust 2018 edition
|new 2.0.1||Mar 25, 2020|
|2.0.0||Feb 27, 2020|
|0.1.3||Feb 23, 2020|
|0.1.2||Sep 30, 2019|
#30 in FFI
49 downloads per month
Used in dart
- Provide a path to the dart sdk using a
- If this variable is not available, will look for either a chocolatey install
path, or an entry in the
PATHvariable which contains
dart-sdkin it. This will fall back to the
fluttersdk should it not find a dart sdk, but this is not recommended, as it is more difficult to compile using the flutter sdk and it appears it ships a non-standard dart sdk.
- If this variable is not available, will look for either a chocolatey install path, or an entry in the
Include the following in your
[lib] crate-type = ["cdylib"] [dependencies] dart-sys = "0.1.0"
And follow the guide on the native extensions api page.
Please visit the examples directory for more information. If there should appear more idiomatic bindings, I will try to keep this updated to link to them.
A few things are not mentioned on the native extensions api page:
- You should compile using an x64 compiler (eg.,
- You should place the compiled library in the same directory as the root of your dart
package (I.E. outside of your
- You should make sure these three coincide:
- The shared object/dynamic link library name.
- The NAME in
NAME_Initfunction when writing a sync extension.
- The name of the import in
- When compiling for Linux, name your shared object
This crate does not generate bindings, and instead uses prebuilt ones. The code to build the bindings can be found commented in
To run, uncomment and from there, copy the contents of the
bindings.rsfile under the directory which is reported in the panic into
The bindings were last generated on the 26th of February 2020.
I have manually edited the names under the generated bindings to avoid ugly bindgen names such as
_Dart_CObject__bindgen_ty_1__bindgen_ty_3, and instead replaces them with a more appropriate name
based on their usage in the api. (Such as