pub struct PathDiscovery {
pub network_topology: Vec<NetworkLink>,
pub path_cache: Vec<(u16, Vec<u16>)>,
}Expand description
Network path discovery for finding optimal routes
Fields§
§network_topology: Vec<NetworkLink>Known network topology
path_cache: Vec<(u16, Vec<u16>)>Path cache for faster lookups
Implementations§
Source§impl PathDiscovery
impl PathDiscovery
Sourcepub fn add_link(&mut self, link: NetworkLink)
pub fn add_link(&mut self, link: NetworkLink)
Add a network link
Sourcepub fn find_path(&mut self, source: u16, destination: u16) -> Option<Vec<u16>>
pub fn find_path(&mut self, source: u16, destination: u16) -> Option<Vec<u16>>
Find optimal path to destination network using Dijkstra’s algorithm
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the path cache
Sourcepub fn get_topology(&self) -> &[NetworkLink]
pub fn get_topology(&self) -> &[NetworkLink]
Get network topology
Trait Implementations§
Source§impl Debug for PathDiscovery
impl Debug for PathDiscovery
Auto Trait Implementations§
impl Freeze for PathDiscovery
impl RefUnwindSafe for PathDiscovery
impl Send for PathDiscovery
impl Sync for PathDiscovery
impl Unpin for PathDiscovery
impl UnsafeUnpin for PathDiscovery
impl UnwindSafe for PathDiscovery
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