pub struct GraphData {
pub nodes: Vec<GraphNode>,
pub edges: Vec<GraphEdge>,
}Expand description
Complete graph data structure
Contains all nodes and edges for rendering.
Fields§
§nodes: Vec<GraphNode>All nodes in the graph
edges: Vec<GraphEdge>All edges in the graph
Implementations§
Source§impl GraphData
impl GraphData
Sourcepub fn with_data(nodes: Vec<GraphNode>, edges: Vec<GraphEdge>) -> Self
pub fn with_data(nodes: Vec<GraphNode>, edges: Vec<GraphEdge>) -> Self
Create a graph with nodes and edges
Sourcepub fn find_node_mut(&mut self, id: &str) -> Option<&mut GraphNode>
pub fn find_node_mut(&mut self, id: &str) -> Option<&mut GraphNode>
Find a mutable node by ID
Sourcepub fn edges_from(&self, node_id: &str) -> Vec<&GraphEdge>
pub fn edges_from(&self, node_id: &str) -> Vec<&GraphEdge>
Get all edges from a specific node
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphData
impl RefUnwindSafe for GraphData
impl Send for GraphData
impl Sync for GraphData
impl Unpin for GraphData
impl UnwindSafe for GraphData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more