If you know all types up front you can use the Sumtype library on code.dlang.org
Thanks, it's a good starting point, the best would be if I only needed to define that the struct would implement void applyTo(ref User user) so that could be run in the loop to update the User entity.
But I'll try the Sumtype library, that takes me forward, thanks for the answer!