Skip to main content

NodeMut

Trait NodeMut 

Source
pub trait NodeMut<'graph> {
    type Graph: Graph;

    // Required methods
    fn new(
        id: <Self::Graph as Graph>::NodeId,
        graph: &'graph mut Self::Graph,
    ) -> Self;
    fn id(&self) -> <Self::Graph as Graph>::NodeId;
    fn graph(&mut self) -> &mut Self::Graph;
    fn edge_ids(
        &self,
    ) -> &HashSet<<Self::Graph as Graph>::EdgeId, <Self::Graph as Graph>::Hasher>;
    fn edge_count(&self) -> usize;
    fn add_edge_id(&mut self, edge: <Self::Graph as Graph>::EdgeId);
    fn remove_edge_id(&mut self, edge: <Self::Graph as Graph>::EdgeId);

    // Provided method
    fn as_ref<'a>(&'a mut self) -> <Self::Graph as Graph>::Node<'a>
       where 'graph: 'a { ... }
}

Required Associated Types§

Required Methods§

Source

fn new( id: <Self::Graph as Graph>::NodeId, graph: &'graph mut Self::Graph, ) -> Self

Source

fn id(&self) -> <Self::Graph as Graph>::NodeId

Returns this node identifier.

Source

fn graph(&mut self) -> &mut Self::Graph

Returns the backing graph reference for this node.

Source

fn edge_ids( &self, ) -> &HashSet<<Self::Graph as Graph>::EdgeId, <Self::Graph as Graph>::Hasher>

Retrieve the ids of all edges incident to this node.

Source

fn edge_count(&self) -> usize

Returns the number of incident edges for this node.

Source

fn add_edge_id(&mut self, edge: <Self::Graph as Graph>::EdgeId)

Registers an edge as incident to this node.

Source

fn remove_edge_id(&mut self, edge: <Self::Graph as Graph>::EdgeId)

Removes an edge from this node’s incident edge set.

Provided Methods§

Source

fn as_ref<'a>(&'a mut self) -> <Self::Graph as Graph>::Node<'a>
where 'graph: 'a,

Returns a “weaker” immutable view of this mutable node handle.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'graph, NodeId: Identifier, EdgeId: Identifier, NodeData, EdgeData> NodeMut<'graph> for NodeMutRef<'graph, NodeId, EdgeId, NodeData, EdgeData>

Source§

type Graph = OwningGraph<NodeId, EdgeId, NodeData, EdgeData>