Enum smoltcp::wire::IpCidr [−][src]
Expand description
A specification of a CIDR block, containing an address and a variable-length subnet masking prefix length.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Ipv4(Ipv4Cidr)
Ipv6(Ipv6Cidr)
Implementations
impl Cidr
[src]
impl Cidr
[src]pub fn new(addr: Address, prefix_len: u8) -> 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 prefix_len(&self) -> u8
[src]
pub fn prefix_len(&self) -> u8
[src]Return the prefix length of this CIDR block.
pub fn contains_addr(&self, addr: &Address) -> bool
[src]
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]
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 Ord for Cidr
[src]
impl Ord for Cidr
[src]impl PartialOrd<Cidr> for Cidr
[src]
impl PartialOrd<Cidr> for Cidr
[src]fn partial_cmp(&self, other: &Cidr) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Cidr) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Cidr
[src]
impl Eq 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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more