/// Returns only the IP/DNS + Port portion of the NetworkAddress
Returns only the IP/DNS + Port portion of the NetworkAddress
Returns only the IP / DNS + Port portion of the NetworkAddress
pub fn strip_address(address: &NetworkAddress) -> NetworkAddress {
    let protocols = address
        .as_slice()
        .iter()
        .filter(|protocol| match protocol {
            Protocol::Dns(_)
            | Protocol::Dns4(_)
            | Protocol::Dns6(_)
            | Protocol::Ip4(_)
            | Protocol::Ip6(_)
            | Protocol::Memory(_)
            | Protocol::Tcp(_) => true,
            _ => false,
        })
        .cloned()
        .collect::<Vec<_>>();
    NetworkAddress::try_from(protocols).unwrap()
}
pub fn strip_address ( address : & NetworkAddress ) -> NetworkAddress { let protocols = address . as_slice ( ) . iter ( ) . filter ( | protocol | match protocol { Protocol :: Dns ( _ ) | Protocol :: Dns4 ( _ ) | Protocol :: Dns6 ( _ ) | Protocol :: Ip4 ( _ ) | Protocol :: Ip6 ( _ ) | Protocol :: Memory ( _ ) | Protocol :: Tcp ( _ ) => true , _ => false , } ) . cloned ( ) . collect :: < Vec < _ > > ( ) ; NetworkAddress :: try_from ( protocols ) . unwrap ( ) }
Returns only the IP/DNS + Port portion of the NetworkAddress
Returns only the IP / DNS + Port portion of the NetworkAddress
address
&NetworkAddress