hlua icon indicating copy to clipboard operation
hlua copied to clipboard

Add a FromIterator wrapper to push a table

Open tomaka opened this issue 8 years ago • 1 comments

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

tomaka avatar Dec 26 '16 14:12 tomaka

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?
    }
}

mkpankov avatar Apr 16 '17 14:04 mkpankov