[−][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_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: AddressLen + Clone> Prefixable for Prefix<T>
[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]
Return 0 or 1 at certain position of bit in the prefix.
fn contains(&self, prefix: &Self) -> bool
[src]
Return true if given prefix is included in this prefix.
impl<T: Clone> Clone for Prefix<T>
[src]
fn clone(&self) -> Prefix<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Prefix<T>
[src]
impl<T: AddressLen + ToString> Display for Prefix<T>
[src]
impl<T: Debug> Debug for Prefix<T>
[src]
Auto Trait Implementations
impl<T> Send for Prefix<T> where
T: Send,
T: Send,
impl<T> Unpin for Prefix<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for Prefix<T> where
T: Sync,
T: Sync,
impl<T> RefUnwindSafe for Prefix<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for Prefix<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,