Struct ipaddress::prefix::Prefix [] [src]

pub struct Prefix {
    pub num: usize,
    pub ip_bits: IpBits,
    pub net_mask: BigUint,
    pub vt_from: fn(&Prefix, usize) -> Result<PrefixString>,
}

Fields

num: usize ip_bits: IpBits net_mask: BigUint vt_from: fn(&Prefix, usize) -> Result<PrefixString>

Methods

impl Prefix
[src]

fn from(&self, num: usize) -> Result<PrefixString>

fn to_ip_str(&self) -> String

fn size(&self) -> BigUint

fn new_netmask(prefix: usize, bits: usize) -> BigUint

fn netmask(&self) -> BigUint

fn get_prefix(&self) -> usize

fn host_mask(&self) -> BigUint

fn host_prefix(&self) -> usize

fn bits(&self) -> String

fn to_s(&self) -> String

fn to_i(&self) -> usize

fn add_prefix(&self, other: &Prefix) -> Result<PrefixString>

fn add(&self, other: usize) -> Result<PrefixString>

fn sub_prefix(&self, other: &Prefix) -> Result<PrefixString>

fn sub(&self, other: usize) -> Result<PrefixString>

Trait Implementations

impl Clone for Prefix
[src]

fn clone(&self) -> Prefix

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 Prefix
[src]

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Self) -> bool

This method tests for !=.

impl Debug for Prefix
[src]

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

Formats the value using the given formatter.

impl Eq for Prefix
[src]

impl Ord for Prefix
[src]

fn cmp(&self, oth: &Prefix) -> Ordering

This method returns an Ordering between self and other. Read more

impl PartialOrd for Prefix
[src]

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

This method returns an ordering between self and other values if one exists. Read more

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

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

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

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more