[−][src]Enum smoltcp::wire::IpCidr
A specification of a CIDR block, containing an address and a variable-length subnet masking prefix length.
Variants (Non-exhaustive)
Ipv4(Ipv4Cidr)
Ipv6(Ipv6Cidr)
Implementations
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.
pub fn from_str(s: &str) -> Result<IpCidr, ()>
[src]
Parse a string representation of an IP CIDR.
impl Hash for Cidr
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Cidr
[src]
pub fn cmp(&self, other: &Cidr) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Cidr> for Cidr
[src]
impl PartialOrd<Cidr> for Cidr
[src]
pub fn partial_cmp(&self, other: &Cidr) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Cidr) -> bool
[src]
pub fn le(&self, other: &Cidr) -> bool
[src]
pub fn gt(&self, other: &Cidr) -> bool
[src]
pub fn ge(&self, other: &Cidr) -> bool
[src]
impl StructuralEq for Cidr
[src]
impl StructuralPartialEq for Cidr
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cidr
[src]
impl Send for Cidr
[src]
impl Sync for Cidr
[src]
impl Unpin for Cidr
[src]
impl UnwindSafe for Cidr
[src]
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,