tomaka / hlua

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

Add a FromIterator wrapper to push a table #103

Open tomaka opened 7 years ago

tomaka commented 7 years ago

Allow pushing a whole table at once by building it from an iterator.

mkpankov commented 7 years ago

I'm not sure how FromIterator would work, as it needs to create table in Lua end and it needs reference to interpreter for that. However, its' signature is

impl<T, L> FromIterator<T> for LuaTable<L> {
    fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> Self {
         // where do we take Lua from?
    }
}