Struct cidr::Ipv6Inet
[−]
[src]
pub struct Ipv6Inet { /* fields omitted */ }
Inet
type representing an IPv6 host within a network
Derived ordering, i.e. first sort by address, then by network length.
Trait Implementations
impl BitString for Ipv6Inet
[src]
fn get(&self, ndx: usize) -> bool
Get the ndx
th bit. Read more
fn set(&mut self, ndx: usize, bit: bool)
Set the ndx
th bit to bit
. Read more
fn flip(&mut self, ndx: usize)
Flips the ndx
th bit. Read more
fn len(&self) -> usize
Current length of the bit string in bits.
fn clip(&mut self, len: usize)
Set current length to len
. Read more
fn append(&mut self, bit: bool)
Append a bit. Read more
fn null() -> Self
Create a new zero-length bit string. Read more
Length of the longest shared prefix of two bit strings.
Longest shared prefix of two bit strings.
fn subset_cmp(&self, other: &Self) -> Option<Ordering>
Partial ordering on bit strings. Read more
fn lexicographic_cmp(&self, other: &Self) -> Ordering
Lexicographic ordering on bit strings. Read more
impl Inet for Ipv6Inet
[src]
type Address = Ipv6Addr
Type for the underlying address (IpAddr
, Ipv4Addr
or Ipv6Addr
). Read more
type Cidr = Ipv6Cidr
Corresponding Cidr
type (representing only the network)
fn new(addr: Self::Address, len: u8) -> Result<Self, NetworkLengthTooLongError>
Create new host within a network from address and prefix length. If the network length exceeds the address length an error is returned. Read more
fn new_host(addr: Self::Address) -> Self
Create a network containing a single address as host and the network (network length = address length). Read more
fn next(&mut self) -> bool
increments host part (without changing the network part); returns true on wrap around
fn network(&self) -> Self::Cidr
network (i.e. drops the host information)
fn address(&self) -> Self::Address
the host
fn first_address(&self) -> Self::Address
first address in the network as plain address
fn first(&self) -> Self
first address in the network
fn last_address(&self) -> Self::Address
last address in the network as plain address
fn last(&self) -> Self
last address in the network
fn network_length(&self) -> u8
length in bits of the shared prefix of the contained addresses
fn family(&self) -> Family
IP family of the contained address (Ipv4
or Ipv6
).
fn mask(&self) -> Self::Address
network mask: an pseudo address which has the first network length
bits set to 1 and the remaining to 0. Read more
fn contains(&self, addr: &Self::Address) -> bool
check whether an address is contained in the network
impl Debug for Ipv6Inet
[src]
impl Display for Ipv6Inet
[src]
impl FromStr for Ipv6Inet
[src]
type Err = NetworkParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Ipv6Inet, NetworkParseError>
Parses a string s
to return a value of this type. Read more
impl Clone for Ipv6Inet
[src]
fn clone(&self) -> Ipv6Inet
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 PartialEq for Ipv6Inet
[src]
fn eq(&self, __arg_0: &Ipv6Inet) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Ipv6Inet) -> bool
This method tests for !=
.
impl Eq for Ipv6Inet
[src]
impl PartialOrd for Ipv6Inet
[src]
fn partial_cmp(&self, __arg_0: &Ipv6Inet) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Ipv6Inet) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Ipv6Inet) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Ipv6Inet) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Ipv6Inet) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Ipv6Inet
[src]
fn cmp(&self, __arg_0: &Ipv6Inet) -> Ordering
This method returns an Ordering
between self
and other
. Read more