EdgeSource

Trait EdgeSource 

Source
pub trait EdgeSource {
    type Iter<'a>: Iterator<Item = Result<Edge, StorageError>>
       where Self: 'a;

    // Required methods
    fn all_edges(&self) -> Result<Self::Iter<'_>, StorageError>;
    fn edge_count(&self) -> Result<u64, StorageError>;

    // Provided method
    fn is_empty(&self) -> Result<bool, StorageError> { ... }
}
Expand description

Trait for edge sources consumable by graph algorithm libraries.

This trait enables external graph algorithm libraries (BFS, DFS, PageRank, etc.) to efficiently iterate over all edges in the graph.

Required Associated Types§

Source

type Iter<'a>: Iterator<Item = Result<Edge, StorageError>> where Self: 'a

Iterator type over edges

Required Methods§

Source

fn all_edges(&self) -> Result<Self::Iter<'_>, StorageError>

Returns an iterator over all edges in the graph.

The iterator provides access to all edges with their properties.

Source

fn edge_count(&self) -> Result<u64, StorageError>

Returns the number of edges.

Provided Methods§

Source

fn is_empty(&self) -> Result<bool, StorageError>

Returns true if empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl EdgeSource for GraphTableRead

Source§

type Iter<'a> = AllEdgesIter<'a> where Self: 'a