Struct ipaddress::IPAddress
[−]
[src]
pub struct IPAddress { pub ip_bits: IpBits, pub host_address: BigUint, pub prefix: Prefix, pub mapped: Option<Box<IPAddress>>, pub vt_is_private: fn(&IPAddress) -> bool, pub vt_is_loopback: fn(&IPAddress) -> bool, pub vt_to_ipv6: fn(&IPAddress) -> IPAddress, }
Fields
ip_bits: IpBits
host_address: BigUint
prefix: Prefix
mapped: Option<Box<IPAddress>>
vt_is_private: fn(&IPAddress) -> bool
vt_is_loopback: fn(&IPAddress) -> bool
vt_to_ipv6: fn(&IPAddress) -> IPAddress
Methods
impl IPAddress
[src]
fn parse<S: Into<String>>(_str: S) -> Result<IPAddress, String>
fn split_at_slash(str: &String) -> (String, Option<String>)
fn from(&self, addr: &BigUint, prefix: &Prefix) -> IPAddress
fn is_ipv4(&self) -> bool
fn is_ipv6(&self) -> bool
fn is_valid<S: Into<String>>(_addr: S) -> bool
fn parse_ipv4_part(i: &str, addr: &String) -> Result<u32, String>
fn split_to_u32(addr: &String) -> Result<u32, String>
fn is_valid_ipv4<S: Into<String>>(addr: S) -> bool
fn split_on_colon(addr: &String) -> (Result<BigUint, String>, usize)
fn split_to_num(addr: &String) -> Result<BigUint, String>
fn is_valid_ipv6<S: Into<String>>(addr: S) -> bool
fn aggregate(networks: &Vec<IPAddress>) -> Vec<IPAddress>
fn parts(&self) -> Vec<u16>
fn parts_hex_str(&self) -> Vec<String>
fn dns_rev_domains(&self) -> Vec<String>
fn dns_reverse(&self) -> String
fn dns_parts(&self) -> Vec<u8>
fn dns_networks(&self) -> Vec<IPAddress>
fn summarize(networks: &Vec<IPAddress>) -> Vec<IPAddress>
fn summarize_str<S: Into<String>>(netstr: Vec<S>) -> Result<Vec<IPAddress>, String>
fn ip_same_kind(&self, oth: &IPAddress) -> bool
fn is_unspecified(&self) -> bool
fn is_loopback(&self) -> bool
fn is_mapped(&self) -> bool
fn prefix(&self) -> &Prefix
fn is_valid_netmask<S: Into<String>>(addr: S) -> bool
fn netmask_to_prefix(nm: &BigUint, bits: usize) -> Result<usize, String>
fn parse_netmask_to_prefix<S: Into<String>>(_netmask: S) -> Result<usize, String>
fn change_prefix(&self, num: usize) -> Result<IPAddress, String>
fn change_netmask<S: Into<String>>(&self, str: S) -> Result<IPAddress, String>
fn to_string(&self) -> String
fn to_s(&self) -> String
fn to_string_uncompressed(&self) -> String
fn to_s_uncompressed(&self) -> String
fn to_s_mapped(&self) -> String
fn to_string_mapped(&self) -> String
fn bits(&self) -> String
fn to_hex(&self) -> String
fn netmask(&self) -> IPAddress
fn broadcast(&self) -> IPAddress
fn is_network(&self) -> bool
fn network(&self) -> IPAddress
fn to_network(adr: &BigUint, host_prefix: usize) -> BigUint
fn sub(&self, other: &IPAddress) -> BigUint
fn add(&self, other: &IPAddress) -> Vec<IPAddress>
fn to_s_vec(vec: &Vec<IPAddress>) -> Vec<String>
fn to_string_vec(vec: &Vec<IPAddress>) -> Vec<String>
fn to_ipaddress_vec<S: Into<String>>(vec: Vec<S>) -> Result<Vec<IPAddress>, String>
fn first(&self) -> IPAddress
fn last(&self) -> IPAddress
fn each_host<F>(&self, func: F) where F: Fn(&IPAddress)
fn each<F>(&self, func: F) where F: Fn(&IPAddress)
fn size(&self) -> BigUint
fn is_same_kind(&self, oth: &IPAddress) -> bool
fn includes(&self, oth: &IPAddress) -> bool
fn includes_all(&self, oths: &[IPAddress]) -> bool
fn is_private(&self) -> bool
fn split(&self, subnets: usize) -> Result<Vec<IPAddress>, String>
fn supernet(&self, new_prefix: usize) -> Result<IPAddress, String>
fn subnet(&self, subprefix: usize) -> Result<Vec<IPAddress>, String>
fn to_ipv6(&self) -> IPAddress
Trait Implementations
impl Debug for IPAddress
[src]
impl Clone for IPAddress
[src]
fn clone(&self) -> IPAddress
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Ord for IPAddress
[src]
fn cmp(&self, oth: &IPAddress) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialOrd for IPAddress
[src]
fn partial_cmp(&self, other: &IPAddress) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq for IPAddress
[src]
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Self) -> bool
This method tests for !=
.