Skip to main content

SimpleTable

Struct SimpleTable 

Source
pub struct SimpleTable<Node> { /* private fields */ }
Expand description

Simple routing table that doesn’t segregate IPv4 and IPv6 routes.

The prefix 8.0.0.0/8 is treated equivalently to 0800::/8 by this table. You most likely want SplitStackTable if you’re operating in a dual-IP-stack environment.

Implementations§

Source§

impl<Node> SimpleTable<Node>

Source

pub const fn root(&self) -> &Node

Get a handle to the root node.

Source§

impl<T, C> SimpleTable<Node<T, C>>
where C: ?Sized + Storage,

Source

pub const EMPTY: Self

The empty table.

Trait Implementations§

Source§

impl<Node: Clone> Clone for SimpleTable<Node>

Source§

fn clone(&self) -> SimpleTable<Node>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Node: Copy> Copy for SimpleTable<Node>

Source§

impl<Node: Debug> Debug for SimpleTable<Node>

Source§

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

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

impl<Node: Default> Default for SimpleTable<Node>

Source§

fn default() -> SimpleTable<Node>

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

impl<Node: Eq> Eq for SimpleTable<Node>

Source§

impl<Node: Hash> Hash for SimpleTable<Node>

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<Node: PartialEq> PartialEq for SimpleTable<Node>

Source§

fn eq(&self, other: &SimpleTable<Node>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Node> RoutingTable for SimpleTable<Node>
where Node: StrideOps,

Source§

type Value = <Node as StrideBase>::T

The value stored in each route.
Source§

fn contains(&self, ip: IpAddr) -> bool

Report whether ip is covered by a route in the table. Read more
Source§

fn insert(&mut self, prefix: IpNet, val: Node::T) -> Option<Node::T>

Insert a route into the table at prefix. Read more
Source§

fn remove(&mut self, prefix: IpNet) -> Option<Node::T>

Remove the route from the table with the given prefix. Read more
Source§

fn clear(&mut self)

Wipe the whole table.
Source§

fn lookup(&self, ip: IpAddr) -> Option<&Node::T>

Lookup the route that most closely covers ip. Read more
Source§

fn lookup_all(&self, ip: IpAddr) -> LookupIter<'_, Self::Value>

Lookup all matches that cover ip. Read more
Source§

fn lookup_prefix_exact(&self, prefix: IpNet) -> Option<&Node::T>

Lookup a route that exactly matches prefix (supernets do not match). Read more
Source§

fn lookup_prefix(&self, prefix: IpNet) -> Option<&Node::T>

Lookup the route that most closely covers prefix. Read more
Source§

fn lookup_prefix_lpm(&self, prefix: IpNet) -> Option<(IpNet, &Node::T)>

Lookup the route that most closely covers prefix, and return that matching prefix. Read more
Source§

fn size(&self) -> usize

Report the number of routes stored in the table. Read more
Source§

impl<Node> StructuralPartialEq for SimpleTable<Node>

Auto Trait Implementations§

§

impl<Node> Freeze for SimpleTable<Node>
where Node: Freeze,

§

impl<Node> RefUnwindSafe for SimpleTable<Node>
where Node: RefUnwindSafe,

§

impl<Node> Send for SimpleTable<Node>
where Node: Send,

§

impl<Node> Sync for SimpleTable<Node>
where Node: Sync,

§

impl<Node> Unpin for SimpleTable<Node>
where Node: Unpin,

§

impl<Node> UnsafeUnpin for SimpleTable<Node>
where Node: UnsafeUnpin,

§

impl<Node> UnwindSafe for SimpleTable<Node>
where Node: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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<T> RoutingTableExt for T
where T: RoutingTable,

Source§

fn modify( &mut self, prefix: IpNet, modify: impl FnOnce(Option<&mut Self::Value>) -> RouteModification<Self::Value>, ) -> Option<Self::Value>

Modify the route at prefix using the modify closure. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.