pub struct Node<T> {
pub id: NodeID,
pub data: T,
pub connections: Vec<EdgeID>,
}
Expand description
§A struct representing a node/vertex in the graph.
Has a generic data field and a list of EdgeIDs.
A NodeID is a key to the node in the slotmap.
§Why is there no “NodeTrait”?
The Node struct is very simple and doesn’t need a trait. If you want to add more functionality or data to the Node you can probably just add it to the data field, or add a node as a field to your custom type.
Fields§
§id: NodeID
§data: T
§connections: Vec<EdgeID>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Node<T>where
T: Freeze,
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Send for Node<T>where
T: Send,
impl<T> Sync for Node<T>where
T: Sync,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnwindSafe for Node<T>where
T: UnwindSafe,
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