See the first IpAddr example here[1], where you have separate variants, both with string representations. You can't do this with std::variant. You have to use separate types.
[1] https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html
[1] https://doc.rust-lang.org/book/ch06-01-defining-an-enum.html