Skip to main content

AsIpAddrs

Trait AsIpAddrs 

Source
pub trait AsIpAddrs {
    // Required method
    fn as_ip_addrs(&self) -> Result<HashSet<IpAddr>>;
}
Expand description

This trait allows for parsing an input into a set of one or multiple Ipv4Addr.

Required Methods§

Trait Implementations§

Implementations on Foreign Types§

Source§

impl AsIpAddrs for &str

Supports one address or multiple addresses separated by ,. For example: “127.0.0.1,127.0.0.2”.

If the string is empty, will return an empty set.

Source§

impl AsIpAddrs for IpAddr

Source§

impl AsIpAddrs for ()

Optimization for zero sized/empty values, as () will never take up any space or evaluate to anything, helpful in contexts where we just want an empty value.

Source§

impl AsIpAddrs for Box<dyn AsIpAddrs>

Source§

impl AsIpAddrs for String

Source§

impl<I: AsIpAddrs> AsIpAddrs for &[I]

Support slice. Example: &[“127.0.0.1”, “127.0.0.2”]

Source§

impl<T: AsIpAddrs> AsIpAddrs for &T

Implementors§