distil / rust_lua_ffi Goto Github PK
View Code? Open in Web Editor NEWAutomatic Rust and Lua glue code generation for seamless FFI interop
License: Apache License 2.0
Automatic Rust and Lua glue code generation for seamless FFI interop
License: Apache License 2.0
I use skynet with lua 5.3.5 ; This crate looks very nice and clean, easy use better then other lua extension bindings
Example code gives two arguments to generator::generate
but it takes three:
error[E0061]: this function takes 3 parameters but 2 parameters were supplied
--> validate-lua/src/build.rs:8:18
|
8 | let output = generator::generate(
| __________________^
9 | | &env::current_dir().unwrap().as_path().join("src/lib.rs"),
10 | | "example_setup",
11 | | );
| |_____^ expected 3 parameters
error: aborting due to previous error
Given Rust libs A and B, they cannot be require
d in the same Lua instance if any of their type names are the same. Note that it's easy to unintentionally run into this restriction since a number of basic 'composite' types (e.g., Vec<u8>
, Option<T>
, Result<T, E>
) will result in structs of the same name passed to ffi.metatype
even if—in the case of generic types—the generic parameters are primitive C types.
Unless there is a reason why can this be put on crates.io it would make use and findability easier.
When the consuming crate defines #![deny(warnings)]
compilation fails due to warnings in generated code in rust_lua_ffi
:
error: unused import: `std :: collections :: HashSet`
--> /distil/plt_validate/target/release/build/validate-lua-47afa98c8d312284/out/ffi.rs:3:50
|
3 | # [ doc ( hidden ) ] pub mod lua_bootstrap { use std :: collections :: HashSet ; use validate :: validate_postback_str_no_panic ; # [ no_mangle ] pub extern "C" fn __lua_bootstrap ( ) -> * mut :: libc :: c_char { let unique_types : :: lua_marshalling :: Dependencies = [ :: lua_marshalling :: make_dependencies :: < & str > ( ) , :: lua_marshalling :: make_dependencies :: < Vec < i32 > >
( ) , ] . into_iter ( ) . flat_map ( | value | value . into_iter ( ) . map ( | ( k , v ) | ( k . clone ( ) , v . clone ( ) ) ) ) .
collect ( ) ; let sorted_types = :: lua_marshalling :: dependency_sorted_type_descriptions ( & unique_types ) ; :: std :: ffi :: CString :: new ( [ r#"-- Code generated by Rust Lua interface. DO NOT EDIT.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This should be avoidable if the generated code defined #![allow(warnings)]
in each file.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.