Struct netaddr::addr::ipv4::IpAddrExperimental [-]  [+] [src]

pub struct IpAddr(pub u8, pub u8, pub u8, pub u8);

Methods

impl IpAddr

fn version(&self) -> IpAddrVersion

Get the corresponding IP address version.

fn max_prefixlen(&self) -> usize

The total number of bits in the address representation for this version: 32 for IPv4, 128 for IPv6.

The prefix defines the number of leading bits in an address that are compared to determine whether or not an address is part of a network.

fn with_prefixlen(n: usize) -> IpAddr

Create an IP mask with the specified prefixlen.

The provided prefixlen must be in the prefixlen-range (0 <= n <= 32).

fn packed(&self) -> [u8, ..4]

The binary representation of this address - a bytes vector of the appropriate length (most significant octet first). This is 4 bytes for IPv4 and 16 bytes for IPv6.

fn from_u32(n: u32) -> IpAddr

Create an IpAddr instance from a 32-bits integer.

fn to_u32(&self) -> u32

Convert an IpAddr instance to a 32-bits integer.

impl IpAddr

Convert operations from/to Rust's standard library IP addresses.

fn from_std(ip: StdIpAddr) -> Option<IpAddr>

Create an ipv4::IpAddr instance from a Rust's standard library IpAddr instance.

fn to_std(&self) -> StdIpAddr

Create a Rust's standard library IpAddr instance from an ipv4::IpAddr instance.

fn into_std(self) -> StdIpAddr

Convert an ipv4::IpAddr instance into a Rust's standard library IpAddr instance.

Trait Implementations

impl Add<u32> for IpAddr

type Output = IpAddr

fn add(self, rhs: u32) -> IpAddr

impl Sub<u32> for IpAddr

type Output = IpAddr

fn sub(self, rhs: u32) -> IpAddr

impl BitXor<IpAddr> for IpAddr

type Output = IpAddr

fn bitxor(self, rhs: IpAddr) -> IpAddr

impl BitOr<IpAddr> for IpAddr

type Output = IpAddr

fn bitor(self, rhs: IpAddr) -> IpAddr

impl BitAnd<IpAddr> for IpAddr

type Output = IpAddr

fn bitand(self, rhs: IpAddr) -> IpAddr

impl Not for IpAddr

type Output = IpAddr

fn not(self) -> IpAddr

impl PartialOrd for IpAddr

fn partial_cmp(&self, other: &IpAddr) -> Option<Ordering>

fn lt(&self, other: &Rhs) -> bool

fn le(&self, other: &Rhs) -> bool

fn gt(&self, other: &Rhs) -> bool

fn ge(&self, other: &Rhs) -> bool

impl Ord for IpAddr

fn cmp(&self, other: &IpAddr) -> Ordering

impl String for IpAddr

fn fmt(&self, f: &mut Formatter) -> Result

impl FromStr for IpAddr

fn from_str(s: &str) -> Option<IpAddr>

Derived Implementations

impl Decodable for IpAddr

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<IpAddr, Error>

impl Encodable for IpAddr

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), Error>

impl<__S: Writer + Hasher> Hash<__S> for IpAddr

fn hash(&self, __arg_0: &mut __S)

impl Eq for IpAddr

fn assert_receiver_is_total_eq(&self)

impl PartialEq for IpAddr

fn eq(&self, __arg_0: &IpAddr) -> bool

fn ne(&self, __arg_0: &IpAddr) -> bool

impl Show for IpAddr

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for IpAddr

fn clone(&self) -> IpAddr

fn clone_from(&mut self, source: &Self)

impl Copy for IpAddr