Struct iptrie::Ipv6Prefix120

source ·
pub struct Ipv6Prefix120 { /* private fields */ }
Expand description

An Ipv6 prefix limited to 120 bits and encoded as u128 (EXPERIMENTAL)

In many applications, managed Ipv6 prefixes are never longer than 120 bits. In theses cases, it is possible to save memory space by encoding it in 128 bits with its length encoded in one byte.

The resulting prefix is twice as short as the corresponding Ipv6 generic prefix.

Implementations§

Trait Implementations§

source§

impl Clone for Ipv6Prefix120

source§

fn clone(&self) -> Ipv6Prefix120

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ipv6Prefix120

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Ipv6Prefix120

source§

fn default() -> Ipv6Prefix120

Returns the “default value” for a type. Read more
source§

impl Display for Ipv6Prefix120

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Ipv6Prefix120> for Ipv6Net

source§

fn from(value: Ipv6Prefix120) -> Self

Converts to this type from the input type.
source§

impl From<Ipv6Prefix120> for Ipv6Prefix

source§

fn from(value: Ipv6Prefix120) -> Self

Converts to this type from the input type.
source§

impl From<Ipv6Prefix56> for Ipv6Prefix120

source§

fn from(value: Ipv6Prefix56) -> Self

Converts to this type from the input type.
source§

impl FromStr for Ipv6Prefix120

§

type Err = IpPrefixError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for Ipv6Prefix120

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IpPrefix for Ipv6Prefix120

§

type Slot = u128

The slot manipulated inside this prefix
source§

fn root() -> Self

Root prefix has a length of 0
source§

fn bitslot(&self) -> Self::Slot

The inner slot as is Read more
source§

fn bitslot_trunc(&self) -> Self::Slot

The inner slot with all the masked bits set to 0. Read more
source§

fn len(&self) -> u8

Length of the prefix. Read more
source§

const MAX_LEN: u8 = 120u8

The maximum allowed length for this prefix
§

type Addr = Ipv6Addr

The underlying ip address (usually Ipv4Addr or Ipv6Addr)
source§

fn network(&self) -> Self::Addr

The address of the network defined by the prefixv Read more
source§

fn bitmask(&self) -> Self::Slot

Mask of the prefix. Read more
source§

impl IpPrefixCovering<Ipv6Addr> for Ipv6Prefix120

source§

fn covering(&self, other: &Ipv6Addr) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl IpPrefixCovering<Ipv6Net> for Ipv6Prefix120

source§

fn covering(&self, other: &Ipv6Net) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl IpPrefixCovering<Ipv6Prefix> for Ipv6Prefix120

source§

fn covering(&self, other: &Ipv6Prefix) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl IpPrefixCovering<Ipv6Prefix120> for Ipv6Net

source§

fn covering(&self, other: &Ipv6Prefix120) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl IpPrefixCovering<Ipv6Prefix120> for Ipv6Prefix

source§

fn covering(&self, other: &Ipv6Prefix120) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl IpPrefixCovering<Ipv6Prefix120> for Ipv6Prefix56

source§

fn covering(&self, other: &Ipv6Prefix120) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl IpPrefixCovering<Ipv6Prefix56> for Ipv6Prefix120

source§

fn covering(&self, other: &Ipv6Prefix56) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl PartialEq<Ipv6Prefix120> for Ipv6Prefix120

source§

fn eq(&self, other: &Ipv6Prefix120) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<Ipv6Net> for Ipv6Prefix120

§

type Error = IpPrefixError

The type returned in the event of a conversion error.
source§

fn try_from(value: Ipv6Net) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Ipv6Prefix> for Ipv6Prefix120

§

type Error = IpPrefixError

The type returned in the event of a conversion error.
source§

fn try_from(value: Ipv6Prefix) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Ipv6Prefix120> for Ipv6Prefix56

§

type Error = IpPrefixError

The type returned in the event of a conversion error.
source§

fn try_from(value: Ipv6Prefix120) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for Ipv6Prefix120

source§

impl Eq for Ipv6Prefix120

source§

impl StructuralEq for Ipv6Prefix120

source§

impl StructuralPartialEq for Ipv6Prefix120

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<P> IpPrefixCovering<P> for Pwhere P: IpPrefix,

source§

fn covering(&self, other: &P) -> IpPrefixCoverage

Checks the coverage of this prefix against a set of adress Read more
source§

fn covers(&self, other: &P) -> bool

source§

fn covers_striclty(&self, other: &P) -> bool

source§

fn covers_equally(&self, other: &P) -> bool

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.