tomaka / hlua

Rust library to interface with Lua
MIT License
510 stars 48 forks source link

not able to write a rust function accepting Vec as paramater #198

Open surajprak opened 6 years ago

surajprak commented 6 years ago

I want to write a rust function which accepts Vec as an input and should be callable from lua. fn get_data_sql(query: String, param_value: Vec){ println!("Inside get_data_sql"); let (txi, rxi) = futures::sync::mpsc::channel::(1); ............ }

error[E0277]: the trait bound for<'a, 'p> std::vec::Vec<i32>: hlua::LuaRead<&'a mut &'p mut hlua::InsideCallback> is not satisfied --> src/main.rs:2021:9 2021 lua.set("get_data_sql", hlua::function2(get_data_sql)); ^^^ the trait for<'a, 'p> hlua::LuaRead<&'a mut &'p mut hlua::InsideCallback> is not implemented for std::vec::Vec<i32>
tpdickso commented 6 years ago

https://github.com/tomaka/hlua/pull/183 solves this issue; you can use that branch locally if it will help.