How to match on Some(Vec<T>)? : I'm working a network application where I want to iterate over all possible ip addresses for a network interface (IPv4 or IPv6) and only do something with the v4 addresses (in my case print them).


For example, printing with debug I get 

    Some([V6(fe80::6a5b:35ff:fec7:5eeb), V4(10.0.11.241)])


Which is a *Option<Vec<std::net::IpAdd>>* in which I want to iterate and if I encounter a V4 address will write the Display implementation for it.

Note that the type of [std::net::IpAdd][1] is 

    pub enum IpAddr {
        V4(Ipv4Addr),
        V6(Ipv6Addr),
    }


But how do I match the enum on type (V4 only in my case)?





[1]: https://doc.rust-lang.org/nightly/std/net/enum.IpAddr.html