How to print ip address and port from tcplistener


Im trying to build a tcp server and want to be able to print the port and ip address
I try this:

let listener = TcpListener::bind("").unwrap();
println!(" {:?}", listener); // will print "TcpListener { addr: V4(, fd: 3 }"
println!(" {}", listener.addr); // This one will fail

Why i cannot print the addr from the struct?
the second println! will fail with the following message:
10 | println!(" {}", listener.addr);
| ^^^^ unknown field


Have you looked at the docs for TcpListener?