Skip to main content

EdgeMutationWithValues

Trait EdgeMutationWithValues 

Source
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§

Source

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.

Source

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".

Implementors§

Source§

impl<NI: Idx, NV, EV: Copy> EdgeMutationWithValues<NI, EV> for DirectedALGraph<NI, NV, EV>

Source§

impl<NI: Idx, NV, EV: Copy> EdgeMutationWithValues<NI, EV> for UndirectedALGraph<NI, NV, EV>