Skip to main content

EdgeRef

Trait EdgeRef 

Source
pub trait EdgeRef {
    type NodeIndex;

    // Required methods
    fn get_edge(
        &self,
        index: usize,
    ) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>;
    fn capacity(&self) -> usize;

    // Provided method
    fn valid_edge(&self, index: usize) -> bool { ... }
}
Expand description

Reference to an edge, represented as a pair of node indices

This trait provides basic access to edge data in edge collections. It’s used to implement iterators and provide a common interface for accessing edge information.

Required Associated Types§

Required Methods§

Source

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Reference to an edge at given index

Source

fn capacity(&self) -> usize

Total capacity of the container

Provided Methods§

Source

fn valid_edge(&self, index: usize) -> bool

Check if edge at index exists

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, V> EdgeRef for &[(NI, NI, V)]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<NI, V> EdgeRef for &mut [(NI, NI, V)]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<NI, const E: usize> EdgeRef for [(NI, NI); E]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

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

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

fn valid_edge(&self, index: usize) -> bool

Source§

impl<NI> EdgeRef for &[(NI, NI)]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<NI> EdgeRef for &[Option<(NI, NI)>]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

fn valid_edge(&self, index: usize) -> bool

Source§

impl<NI> EdgeRef for &mut [(NI, NI)]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<NI> EdgeRef for &mut [Option<(NI, NI)>]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

fn valid_edge(&self, index: usize) -> bool

Source§

impl<NI> EdgeRef for (&[NI], &[NI])

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<NI> EdgeRef for (&mut [NI], &mut [NI])

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<const E: usize, NI, V> EdgeRef for Vec<(NI, NI, V), E>

Available on crate feature heapless only.
Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<const E: usize, NI, V> EdgeRef for [(NI, NI, V); E]

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<const E: usize, NI> EdgeRef for ([NI; E], [NI; E])

Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Source§

impl<const E: usize, NI> EdgeRef for Vec<(NI, NI), E>

Available on crate feature heapless only.
Source§

type NodeIndex = NI

Source§

fn get_edge(&self, index: usize) -> Option<(&Self::NodeIndex, &Self::NodeIndex)>

Source§

fn capacity(&self) -> usize

Implementors§

Source§

impl<const E: usize, NI, V> EdgeRef for EdgeValueStruct<E, NI, V>

Source§

impl<const E: usize, NI, V> EdgeRef for EdgeValueStructOption<E, NI, V>

Source§

impl<const E: usize, NI, V> EdgeRef for TwoArrayEdgeValueStruct<E, NI, V>

Source§

impl<const E: usize, NI> EdgeRef for EdgeStruct<E, NI>
where [(NI, NI); E]: EdgeRef<NodeIndex = NI>,

Source§

impl<const E: usize, NI> EdgeRef for EdgeStructOption<E, NI>
where [Option<(NI, NI)>; E]: EdgeRef<NodeIndex = NI>,

Source§

impl<const E: usize, NI> EdgeRef for TwoArrayEdgeStruct<E, NI>