pub trait EdgeMutationWithValues<NI: Idx, EV> {
// Required methods
fn add_edge_with_value(
&self,
source: NI,
target: NI,
value: EV,
) -> Result<(), Error>;
fn add_edge_with_value_mut(
&mut self,
source: NI,
target: NI,
value: EV,
) -> Result<(), Error>;
}Expand description
Allows adding new edges to a graph.
Required Methods§
Sourcefn add_edge_with_value(
&self,
source: NI,
target: NI,
value: EV,
) -> Result<(), Error>
fn add_edge_with_value( &self, source: NI, target: NI, value: EV, ) -> Result<(), Error>
Adds a new edge between the given source and target node and assigns the given value to it.
§Errors
If either the source or the target node does not exist,
the method will return Error::MissingNode.
Sourcefn add_edge_with_value_mut(
&mut self,
source: NI,
target: NI,
value: EV,
) -> Result<(), Error>
fn add_edge_with_value_mut( &mut self, source: NI, target: NI, value: EV, ) -> Result<(), Error>
Adds a new edge between the given source and target node and assigns the given value to it.
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".