Git Product home page Git Product logo

rust_lua_ffi's People

Contributors

emilk avatar gardell avatar jim-holmstroem avatar liuchengxu avatar marwes avatar scooter-dangle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rust_lua_ffi's Issues

Example on front-page is broken

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

Only one set of bindings can be reliably used within a single Lua instance

Given Rust libs A and B, they cannot be required 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.

Put on crates.io

Unless there is a reason why can this be put on crates.io it would make use and findability easier.

Allow warnings for generated code

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.