[−][src]Struct rtable::prefix::Prefix
IP Prefix.
Methods
impl<T: AddressLen + FromStr> Prefix<T>
[src]
Abstract IPv4 and IPv6 both.
pub fn new() -> Self
[src]
Construct empty prefix.
pub fn from(address: T, len: u8) -> Self
[src]
Construct a prefix from an address and prefix length.
pub fn from_slice(slice: &[u8], prefix_len: u8) -> Self
[src]
Construct a prefix from address and prefix length.
pub fn from_str(s: &str) -> Result<Prefix<T>, PrefixParseError>
[src]
Construct prefix from string slice.
pub fn address(&self) -> &T
[src]
Return address part of prefix.
impl Prefix<Ipv4Addr>
[src]
Impl IPv4 Prefix.
pub fn apply_mask(&mut self)
[src]
Apply network mask to address part.
impl Prefix<Ipv6Addr>
[src]
Impl IPv6 Prefix.
pub fn apply_mask(&mut self)
[src]
Apply network mask to address part.
Trait Implementations
impl<T: Clone> Clone for Prefix<T>
[src]
impl<T: Copy> Copy for Prefix<T>
[src]
impl<T: Debug> Debug for Prefix<T>
[src]
impl<T: AddressLen + ToString> Display for Prefix<T>
[src]
impl<T: Eq> Eq for Prefix<T>
[src]
impl<T: Ord> Ord for Prefix<T>
[src]
fn cmp(&self, other: &Prefix<T>) -> 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<T: PartialEq> PartialEq<Prefix<T>> for Prefix<T>
[src]
impl<T: PartialOrd> PartialOrd<Prefix<T>> for Prefix<T>
[src]
fn partial_cmp(&self, other: &Prefix<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Prefix<T>) -> bool
[src]
fn le(&self, other: &Prefix<T>) -> bool
[src]
fn gt(&self, other: &Prefix<T>) -> bool
[src]
fn ge(&self, other: &Prefix<T>) -> bool
[src]
impl<T: AddressLen + Clone> Prefixable for Prefix<T>
[src]
fn bytelen(&self) -> u8
[src]
fn from_prefix(p: &Self) -> Self
[src]
Construct a prefix from given prefix.
fn from_common(prefix1: &Self, prefix2: &Self) -> Self
[src]
Construct a prefix from common parts of two prefixes, assuming p1 is shorter than p2.
fn len(&self) -> u8
[src]
Return prefix length.
fn octets(&self) -> &[u8]
[src]
Return reference of slice to address.
fn octets_mut(&mut self) -> &mut [u8]
[src]
Return mutable reference of slice to address.
fn bit_at(&self, index: u8) -> u8
[src]
fn contains(&self, prefix: &Self) -> bool
[src]
impl<T> StructuralEq for Prefix<T>
[src]
impl<T> StructuralPartialEq for Prefix<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Prefix<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Prefix<T> where
T: Send,
T: Send,
impl<T> Sync for Prefix<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Prefix<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Prefix<T> where
T: UnwindSafe,
T: UnwindSafe,
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>,