pub struct Mesh {
pub nodes: Vec<Node>,
pub links: Vec<Link>,
}Expand description
The mesh: the devices and how they are connected.
Fields§
§nodes: Vec<Node>§links: Vec<Link>Implementations§
Source§impl Mesh
impl Mesh
Sourcepub fn tree(&self) -> Vec<Branch<'_>>
pub fn tree(&self) -> Vec<Branch<'_>>
The mesh as a tree: the node that leads the mesh, the nodes connected to it below, and so on. A node linked to several others hangs below the one closest to the top. Links that are not connected are left out, and so are hosts that only have such links. A mesh node that cannot be reached starts a tree of its own.
Source§impl Mesh
impl Mesh
Sourcepub fn add_addresses(&mut self, hosts: &[Host], router: Option<&str>)
pub fn add_addresses(&mut self, hosts: &[Host], router: Option<&str>)
Adds the IP addresses of the hosts to the nodes, joined by the MAC
addresses of the nodes and their interfaces, in any case and with
any separator. An active host is preferred over an inactive one. The
device that leads the mesh is rarely a host of its own; without a
host it gets the address router.
Trait Implementations§
impl Eq for Mesh
impl StructuralPartialEq for Mesh
Auto Trait Implementations§
impl Forget for Mesh
impl Freeze for Mesh
impl Move for Mesh
impl RefUnwindSafe for Mesh
impl Send for Mesh
impl Sync for Mesh
impl Unpin for Mesh
impl UnsafeUnpin for Mesh
impl UnwindSafe for Mesh
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