A: ToSocketAddrs, which might resolve to multiple
SocketAddr. It then tries to connect to them in order, returning with the first successful one.
connect_timeout specifically calls out directly why it takes a single
connect_timeout takes a single
SocketAddr since timeout must be applied to individual addresses.
That makes it predictable. Taking
ToSocketAddrs could make it wait arbitrarily long, depending on how many addresses the endpoint resolves too.
If that's the behavior you want it's at least easy enough to implement yourself.