Convert a nested struct into a nested map

Wouldn’t s/he be able to use

variable_with_struct
|> Enum.each
|> Map.from_struct

Like this?

Also if i am mistaken please correct me(still learning to think in elixir and the language)