AFAIUI, net::TcpListener::set_only_v6 has to be called before binding a socket. However, with the current API this is not possible.
For TcpStream I'm not sure if this option is meaningful at all. And if it is, it surely has to be set before connecting.
I know the FCP for those is over, but they should still be removed IMO.