pub struct Ipv6Cidr { /* private fields */ }
Expand description
Cidr
type representing an IPv6 network
Ordering based on lexicographic bitstring representation.
Implementations§
Source§impl Ipv6Cidr
impl Ipv6Cidr
Sourcepub const fn new(addr: Ipv6Addr, len: u8) -> Result<Self, NetworkParseError>
pub const fn new(addr: Ipv6Addr, len: u8) -> Result<Self, NetworkParseError>
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.
Sourcepub const fn new_host(addr: Ipv6Addr) -> Self
pub const fn new_host(addr: Ipv6Addr) -> Self
Create a network containing a single address (network length = address length).
Sourcepub const fn iter(&self) -> InetIterator<Ipv6Addr> ⓘ
pub const fn iter(&self) -> InetIterator<Ipv6Addr> ⓘ
Iterate over all addresses in the range. With IPv6 addresses this can produce really long iterations (up to 2128 addresses).
Sourcepub const fn first_address(&self) -> Ipv6Addr
pub const fn first_address(&self) -> Ipv6Addr
first address in the network as plain address
Sourcepub const fn last_address(&self) -> Ipv6Addr
pub const fn last_address(&self) -> Ipv6Addr
last address in the network as plain address
Sourcepub const fn network_length(&self) -> u8
pub const fn network_length(&self) -> u8
length in bits of the shared prefix of the contained addresses
Sourcepub const fn is_host_address(&self) -> bool
pub const fn is_host_address(&self) -> bool
whether network represents a single host address
Trait Implementations§
Source§impl Cidr for Ipv6Cidr
impl Cidr for Ipv6Cidr
Source§fn new(addr: Ipv6Addr, len: u8) -> Result<Self, NetworkParseError>
fn new(addr: Ipv6Addr, len: u8) -> Result<Self, NetworkParseError>
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.
Source§fn new_host(addr: Ipv6Addr) -> Self
fn new_host(addr: Ipv6Addr) -> Self
Create a network containing a single address (network length =
address length).
Source§fn iter(&self) -> InetIterator<Ipv6Addr> ⓘ
fn iter(&self) -> InetIterator<Ipv6Addr> ⓘ
Iterate over all addresses in the range. With IPv6 addresses
this can produce really long iterations (up to 2128
addresses).
Source§fn first_address(&self) -> Ipv6Addr
fn first_address(&self) -> Ipv6Addr
first address in the network as plain address
Source§fn last_address(&self) -> Ipv6Addr
fn last_address(&self) -> Ipv6Addr
last address in the network as plain address
Source§fn network_length(&self) -> u8
fn network_length(&self) -> u8
length in bits of the shared prefix of the contained addresses
Source§fn is_host_address(&self) -> bool
fn is_host_address(&self) -> bool
whether network represents a single host address
Source§impl IntoIterator for Ipv6Cidr
Iterate over all the addresses in the CIDR.
impl IntoIterator for Ipv6Cidr
Iterate over all the addresses in the CIDR.
Source§impl Ord for Ipv6Cidr
impl Ord for Ipv6Cidr
Source§impl PartialOrd for Ipv6Cidr
impl PartialOrd for Ipv6Cidr
impl Copy for Ipv6Cidr
impl Eq for Ipv6Cidr
impl StructuralPartialEq for Ipv6Cidr
Auto Trait Implementations§
impl Freeze for Ipv6Cidr
impl RefUnwindSafe for Ipv6Cidr
impl Send for Ipv6Cidr
impl Sync for Ipv6Cidr
impl Unpin for Ipv6Cidr
impl UnwindSafe for Ipv6Cidr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more