Skip to main content

MutableEdges

Trait MutableEdges 

Source
pub trait MutableEdges<NI: PartialEq> {
    // Required methods
    fn add_edge(&mut self, edge: (NI, NI)) -> Option<usize>;
    fn remove_edge(&mut self, edge: (NI, NI)) -> Option<usize>;
}
Expand description

Trait for edge collections that support adding and removing edges

This trait allows dynamic addition and removal of edges to/from an edge collection, returning the index where the edge was inserted/removed if successful.

Required Methods§

Source

fn add_edge(&mut self, edge: (NI, NI)) -> Option<usize>

Source

fn remove_edge(&mut self, edge: (NI, NI)) -> Option<usize>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<NI: PartialEq> MutableEdges<NI> for &mut [Option<(NI, NI)>]

Source§

fn add_edge(&mut self, edge: (NI, NI)) -> Option<usize>

Source§

fn remove_edge(&mut self, edge: (NI, NI)) -> Option<usize>

Source§

impl<const E: usize, NI: PartialEq> MutableEdges<NI> for [Option<(NI, NI)>; E]

Source§

fn add_edge(&mut self, edge: (NI, NI)) -> Option<usize>

Source§

fn remove_edge(&mut self, edge: (NI, NI)) -> Option<usize>

Implementors§

Source§

impl<const E: usize, NI: PartialEq, V: PartialEq + Default> MutableEdges<NI> for EdgeValueStructOption<E, NI, V>

Source§

impl<const E: usize, NI: PartialEq> MutableEdges<NI> for EdgeStructOption<E, NI>