tried to do this one myself but don't really know how the tor addresses are meant to be displayed.
ChatGPT gave me this but it's really ugly so didn't want to commit it
use core::fmt;impl fmt::DisplayforNetAddress{fnfmt(&self,f:&mut fmt::Formatter<'_>) -> fmt::Result{matchself{NetAddress::IPv4{ addr, port } => {write!(
f,"{}.{}.{}.{}:{}",
addr[0], addr[1], addr[2], addr[3], port
)}NetAddress::IPv6{ addr, port } => {write!(
f,"{:02x}{:02x}:{:02x}{:02x}:{:02x}{:02x}:{:02x}{:02x}:{:02x}{:02x}:{:02x}{:02x}:{:02x}{:02x}:{:02x}{:02x}:{:02x}{:02x}:%{}",
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], addr[6], addr[7],
addr[8], addr[9], addr[10], addr[11], addr[12], addr[13], addr[14], addr[15],
port
)}NetAddress::OnionV2(addr) => {letmut onion = [0u8;12];
onion.copy_from_slice(addr);letmut base32 = String::new();// Implement your base32 encoding function herewrite!(f,"{}.onion", base32)}NetAddress::OnionV3{ ed25519_pubkey, checksum, version, port } => {// Implement your base32 encoding function hereletmut onion = String::new();write!(f,"{}.onion:{}", onion, port)}NetAddress::Hostname{ hostname, port } => {write!(f,"{}:{}", hostname, port)}}}}
tried to do this one myself but don't really know how the tor addresses are meant to be displayed.
ChatGPT gave me this but it's really ugly so didn't want to commit it