pub struct RoutingTable {
pub entries: Vec<RouterInfo>,
}Expand description
Basic routing table implementation
Fields§
§entries: Vec<RouterInfo>Router entries
Implementations§
Source§impl RoutingTable
impl RoutingTable
Sourcepub fn add_router(&mut self, router: RouterInfo)
pub fn add_router(&mut self, router: RouterInfo)
Add a router entry
Sourcepub fn find_route(&self, network: u16) -> Option<&RouterInfo>
pub fn find_route(&self, network: u16) -> Option<&RouterInfo>
Find route to network
Sourcepub fn remove_router(&mut self, address: &NetworkAddress)
pub fn remove_router(&mut self, address: &NetworkAddress)
Remove router by address
Trait Implementations§
Source§impl Clone for RoutingTable
impl Clone for RoutingTable
Source§fn clone(&self) -> RoutingTable
fn clone(&self) -> RoutingTable
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoutingTable
impl Debug for RoutingTable
Auto Trait Implementations§
impl Freeze for RoutingTable
impl RefUnwindSafe for RoutingTable
impl Send for RoutingTable
impl Sync for RoutingTable
impl Unpin for RoutingTable
impl UnsafeUnpin for RoutingTable
impl UnwindSafe for RoutingTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more