EdgeMutation

Trait EdgeMutation 

Source
pub trait EdgeMutation<NI: Idx> {
    // Required methods
    fn add_edge(&self, source: NI, target: NI) -> Result<(), Error>;
    fn add_edge_mut(&mut self, source: NI, target: NI) -> Result<(), Error>;
}
Expand description

Allows adding new edges to a graph.

Required Methods§

Source

fn add_edge(&self, source: NI, target: NI) -> Result<(), Error>

Adds a new edge between the given source and target node.

§Errors

If either the source or the target node does not exist, the method will return Error::MissingNode.

Source

fn add_edge_mut(&mut self, source: NI, target: NI) -> Result<(), Error>

Adds a new edge between the given source and target node.

Does not require locking the node-local list due to &mut self.

§Errors

If either the source or the target node does not exist, the method will return Error::MissingNode.

Implementors§

Source§

impl<NI: Idx, NV> EdgeMutation<NI> for DirectedALGraph<NI, NV>

Source§

impl<NI: Idx, NV> EdgeMutation<NI> for UndirectedALGraph<NI, NV, ()>