Struct cidr::Ipv4Cidr
[−]
[src]
pub struct Ipv4Cidr { /* fields omitted */ }
Cidr
type representing an IPv4 network
Ordering based on lexicographic bitstring representation.
Trait Implementations
impl BitString for Ipv4Cidr
[src]
fn get(&self, ndx: usize) -> bool
[src]
Get the ndx
th bit. Read more
fn set(&mut self, ndx: usize, bit: bool)
[src]
Set the ndx
th bit to bit
. Read more
fn flip(&mut self, ndx: usize)
[src]
Flips the ndx
th bit. Read more
fn len(&self) -> usize
[src]
Current length of the bit string in bits.
fn clip(&mut self, len: usize)
[src]
Set current length to len
. Read more
fn append(&mut self, bit: bool)
[src]
Append a bit. Read more
fn null() -> Self
[src]
Create a new zero-length bit string. Read more
[src]
Length of the longest shared prefix of two bit strings.
[src]
Longest shared prefix of two bit strings.
fn subset_cmp(&self, other: &Self) -> Option<Ordering>
[src]
Partial ordering on bit strings. Read more
fn lexicographic_cmp(&self, other: &Self) -> Ordering
[src]
Lexicographic ordering on bit strings. Read more
impl Cidr for Ipv4Cidr
[src]
type Address = Ipv4Addr
Type for the underlying address (IpAddr
, Ipv4Addr
or Ipv6Addr
). Read more
type Inet = Ipv4Inet
Corresponding Inet
type (representing an address + a network containing it) Read more
fn new(addr: Self::Address, len: u8) -> Result<Self, NetworkParseError>
[src]
Create new network from address and prefix length. If the network length exceeds the address length or the address is not the first address in the network ("host part not zero") an error is returned. Read more
fn new_host(addr: Self::Address) -> Self
[src]
Create a network containing a single address (network length = address length). Read more
fn first_address(&self) -> Self::Address
[src]
first address in the network as plain address
fn first(&self) -> Self::Inet
[src]
first address in the network
fn last_address(&self) -> Self::Address
[src]
last address in the network as plain address
fn last(&self) -> Self::Inet
[src]
last address in the network
fn network_length(&self) -> u8
[src]
length in bits of the shared prefix of the contained addresses
fn family(&self) -> Family
[src]
IP family of the contained address (Ipv4
or Ipv6
).
fn mask(&self) -> Self::Address
[src]
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
[src]
check whether an address is contained in the network
fn iter(&self) -> InetIterator<Self::Inet>
[src]
Iterate over all addresses in the range. With IPv6 addresses this can produce really long iterations (up to 2128 addresses). Read more
impl Debug for Ipv4Cidr
[src]
impl Display for Ipv4Cidr
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl PartialOrd<Ipv4Cidr> for Ipv4Cidr
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
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[src]
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[src]
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[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Ipv4Cidr
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl FromStr for Ipv4Cidr
[src]
type Err = NetworkParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Ipv4Cidr, NetworkParseError>
[src]
Parses a string s
to return a value of this type. Read more
impl Serialize for Ipv4Cidr
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Ipv4Cidr
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Clone for Ipv4Cidr
[src]
fn clone(&self) -> Ipv4Cidr
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Ipv4Cidr
[src]
fn eq(&self, __arg_0: &Ipv4Cidr) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Ipv4Cidr) -> bool
[src]
This method tests for !=
.