Struct smoltcp::wire::Ipv4Cidr[][src]

pub struct Ipv4Cidr { /* fields omitted */ }

A specification of an IPv4 CIDR block, containing an address and a variable-length subnet masking prefix length.

Implementations

impl Cidr[src]

pub const fn new(address: Address, prefix_len: u8) -> Cidr[src]

Create an IPv4 CIDR block from the given address and prefix length.

Panics

This function panics if the prefix length is larger than 32.

pub fn from_netmask(addr: Address, netmask: Address) -> Result<Cidr>[src]

Create an IPv4 CIDR block from the given address and network mask.

pub const fn address(&self) -> Address[src]

Return the address of this IPv4 CIDR block.

pub const fn prefix_len(&self) -> u8[src]

Return the prefix length of this IPv4 CIDR block.

pub fn netmask(&self) -> Address[src]

Return the network mask of this IPv4 CIDR.

pub fn broadcast(&self) -> Option<Address>[src]

Return the broadcast address of this IPv4 CIDR.

pub fn network(&self) -> Cidr[src]

Return the network block of this IPv4 CIDR.

pub fn contains_addr(&self, addr: &Address) -> bool[src]

Query whether the subnetwork described by this IPv4 CIDR block contains the given address.

pub fn contains_subnet(&self, subnet: &Cidr) -> bool[src]

Query whether the subnetwork described by this IPv4 CIDR block contains the subnetwork described by the given IPv4 CIDR block.

Trait Implementations

impl Clone for Cidr[src]

impl Copy for Cidr[src]

impl Debug for Cidr[src]

impl Default for Cidr[src]

impl Display for Cidr[src]

impl Eq for Cidr[src]

impl From<Cidr> for Cidr[src]

impl FromStr for Ipv4Cidr[src]

type Err = ()

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Ipv4Cidr, ()>[src]

Parse a string representation of an IPv4 CIDR.

impl Hash for Cidr[src]

impl Ord for Cidr[src]

impl PartialEq<Cidr> for Cidr[src]

impl PartialOrd<Cidr> for Cidr[src]

impl StructuralEq for Cidr[src]

impl StructuralPartialEq for Cidr[src]

Auto Trait Implementations

impl RefUnwindSafe for Cidr

impl Send for Cidr

impl Sync for Cidr

impl Unpin for Cidr

impl UnwindSafe for Cidr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.