I have a struct:
my_struct = %MyStruct{a: 1, b: 2}
how do I make it enumerable, so I can use the Enum
methods on it?
You can use Map.to_list(struct)
instead of Enum.to_list
, since structs are just maps with a __struct__
key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With