Struct tree_sitter_graph::graph::GraphNode
source · pub struct GraphNode {
pub attributes: Attributes,
/* private fields */
}
Expand description
A node in a graph
Fields§
§attributes: Attributes
The set of attributes associated with this graph node
Implementations§
source§impl GraphNode
impl GraphNode
sourcepub fn add_edge(&mut self, sink: GraphNodeRef) -> Result<&mut Edge, &mut Edge>
pub fn add_edge(&mut self, sink: GraphNodeRef) -> Result<&mut Edge, &mut Edge>
Adds an edge to this node. There can be at most one edge connecting any two graph nodes;
the result indicates whether the edge is new (Ok
) or already existed (Err
). In either
case, you also get a mutable reference to the Edge
instance for the edge.
sourcepub fn get_edge(&self, sink: GraphNodeRef) -> Option<&Edge>
pub fn get_edge(&self, sink: GraphNodeRef) -> Option<&Edge>
Returns a reference to an outgoing edge from this node, if it exists.
sourcepub fn get_edge_mut(&mut self, sink: GraphNodeRef) -> Option<&mut Edge>
pub fn get_edge_mut(&mut self, sink: GraphNodeRef) -> Option<&mut Edge>
Returns a mutable reference to an outgoing edge from this node, if it exists.
pub fn iter_edges(&self) -> impl Iterator<Item = (GraphNodeRef, &Edge)> + '_
pub fn edge_count(&self) -> usize
Auto Trait Implementations§
impl RefUnwindSafe for GraphNode
impl Send for GraphNode
impl Sync for GraphNode
impl Unpin for GraphNode
impl UnwindSafe for GraphNode
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