[−][src]Enum smoltcp::wire::IpCidr
A specification of a CIDR block, containing an address and a variable-length subnet masking prefix length.
Variants
Ipv4(Ipv4Cidr)
Ipv6(Ipv6Cidr)
Methods
impl Cidr
[src]
pub fn new(addr: Address, prefix_len: u8) -> Cidr
[src]
Create a CIDR block from the given address and prefix length.
Panics
This function panics if the given address is unspecified, or the given prefix length is invalid for the given address.
pub fn address(&self) -> Address
[src]
Return the IP address of this CIDR block.
pub fn prefix_len(&self) -> u8
[src]
Return the prefix length of this CIDR block.
pub fn contains_addr(&self, addr: &Address) -> bool
[src]
Query whether the subnetwork described by this CIDR block contains the given address.
pub fn contains_subnet(&self, subnet: &Cidr) -> bool
[src]
Query whether the subnetwork described by this CIDR block contains the subnetwork described by the given CIDR block.
Trait Implementations
impl Clone for Cidr
[src]
impl Copy for Cidr
[src]
impl Debug for Cidr
[src]
impl Display for Cidr
[src]
impl Eq for Cidr
[src]
impl From<Cidr> for Cidr
[src]
impl From<Cidr> for Cidr
[src]
impl FromStr for IpCidr
[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<IpCidr, ()>
[src]
Parse a string representation of an IP CIDR.
impl Hash for Cidr
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Cidr
[src]
fn cmp(&self, other: &Cidr) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Cidr> for Cidr
[src]
impl PartialOrd<Cidr> for Cidr
[src]
fn partial_cmp(&self, other: &Cidr) -> Option<Ordering>
[src]
fn lt(&self, other: &Cidr) -> bool
[src]
fn le(&self, other: &Cidr) -> bool
[src]
fn gt(&self, other: &Cidr) -> bool
[src]
fn ge(&self, other: &Cidr) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,