ISibboI / evalexpr

A powerful expression evaluation crate 🦀.
GNU Affero General Public License v3.0
325 stars 54 forks source link

Get all variables in a HashMapContext? #108

Closed egel557 closed 2 years ago

egel557 commented 2 years ago

Is there a way to get all the variables in a HashMapContext? I need to be able to save them into a json file. There doesn't seem to be any methods for this outside of calling get_value() for each variable, which isn't possible since I don't know all of the identifiers in this scenario.

ISibboI commented 2 years ago

That's a very good point, I didn't think about this. This should be part of the Context traits.

On Tue, 12 Jul 2022, 16.21 egel557, @.***> wrote:

Is there a way to get all the variables in a HashMapContext? I need to be able to save them into a json file. There doesn't seem to be any methods for this outside of calling get_value() for each variable, which isn't possible since I don't know all of the identifiers in this scenario.

— Reply to this email directly, view it on GitHub https://github.com/ISibboI/evalexpr/issues/108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASATXVN3ECKNK2BC7HMBX3VTV5OTANCNFSM53LG5SVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

ISibboI commented 2 years ago

Can you check the commits I made, if it does what you need?

egel557 commented 2 years ago

Everything looks good! It does exactly what I needed. Thanks!