Convert struct to map