How can I convert a SocketAddr
into a String
? I know how to do the conversion the other way round.
Asked
Active
Viewed 1,778 times
0

Shepmaster
- 388,571
- 95
- 1,107
- 1,366

CollaborativeLearner
- 51
- 5
1 Answers
4
You convert it to a string by calling to_string
:
fn example(addr: &SocketAddr) -> String {
addr.to_string()
}
See also:

Stargateur
- 24,473
- 8
- 65
- 91

Shepmaster
- 388,571
- 95
- 1,107
- 1,366