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§
Sourcefn add_edge(&self, source: NI, target: NI) -> Result<(), Error>
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.
Sourcefn add_edge_mut(&mut self, source: NI, target: NI) -> Result<(), Error>
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.