diff --git a/rama-net/src/address/host.rs b/rama-net/src/address/host.rs index c708c253..299b2e4f 100644 --- a/rama-net/src/address/host.rs +++ b/rama-net/src/address/host.rs @@ -120,6 +120,18 @@ impl From for Host { } } +impl From for Host { + fn from(ip: Ipv4Addr) -> Self { + Host::Address(IpAddr::V4(ip)) + } +} + +impl From for Host { + fn from(ip: Ipv6Addr) -> Self { + Host::Address(IpAddr::V6(ip)) + } +} + impl fmt::Display for Host { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { match self {