rune
rune copied to clipboard
Allow to iteration over functions available in loaded source
This existed: https://docs.rs/rune/latest/rune/runtime/struct.Unit.html#method.iter_functions but I think was made private.
I'm writing a "wrapper" that allows using public functions as subcommands, I can use lookup_function to check if a function exists, but I cannot print any helpful lists of availible messages.
I don't mind much making it public, but it's being changed heavily now in relation to runedoc, so it might not be suitable for public consumption in its current iteration.
You can also collect function hashes by using a visitor, like rune test and rune bench does it.
Access to doc comments would be the next helpful thing, I'm not pressed on having it ASAP as I'm still very much in the beginning of my scripting tool and the happy path is working great (thanks for rune btw).
You got it!
The best way to access comments consistently right now would be to at some point make doc::Context public. It provides a unified API over compiled sources and the native context.