Struct asyncio::ip::PrefixIpAddrV6
[−]
[src]
pub struct PrefixIpAddrV6 { /* fields omitted */ }
Implements Prefix IP version 6 style addresses.
Methods
impl PrefixIpAddrV6
[src]
fn new(addr: IpAddrV6, netmask: IpAddrV6) -> Option<PrefixIpAddrV6>
Returns new PrefixIpAddrV6.
Examples
use asyncio::ip::{IpAddrV6, PrefixIpAddrV6}; assert!(PrefixIpAddrV6::new(IpAddrV6::loopback(), IpAddrV6::new(0xffff,0xffff,0xffff,0xffff,0,0,0,0)).is_some()); assert!(PrefixIpAddrV6::new(IpAddrV6::loopback(), IpAddrV6::any()).is_none());
fn from(addr: IpAddrV6, len: u8) -> PrefixIpAddrV6
Returns new PrefixIpAddrV6.
Panics
Panics if len == 0 or len > 128
use asyncio::ip::{IpAddrV6, PrefixIpAddrV6}; PrefixIpAddrV6::from(IpAddrV6::loopback(), 0); // panic!
fn prefix(&self) -> IpAddrV6
Returns a prefix address.
Examples
use asyncio::ip::{IpAddrV6, PrefixIpAddrV6}; let lo = PrefixIpAddrV6::from(IpAddrV6::loopback(), 64); assert_eq!(lo.prefix(), IpAddrV6::any());
fn netmask(&self) -> IpAddrV6
Returns a subnet mask.
Examples
use asyncio::ip::{IpAddrV6, PrefixIpAddrV6}; let lo = PrefixIpAddrV6::from(IpAddrV6::loopback(), 64); assert_eq!(lo.netmask(), IpAddrV6::new(0xffff,0xffff,0xffff,0xffff,0,0,0,0));
fn netmask_len(&self) -> u8
Returns a length of subnet mask.