rune-rs / rune

An embeddable dynamic programming language for Rust.
https://rune-rs.github.io
Apache License 2.0
1.7k stars 85 forks source link

Runes `std::collections::HashMap` is not accessible from rust extension types #753

Open VorpalBlade opened 1 month ago

VorpalBlade commented 1 month ago

I want to add a extension function that takes a mapping. So I thought it should take the HashMap from Rune's standard library. Unfortunately that is pub(crate) on the Rust side. What is the best way to do this?

This could either turn into a feature request or a help request (if there is a way to do this and I missed it). I need random access (lookup based on key) into this collection passed by the rune script. I would prefer to not needlessly copy it.