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§
Required Methods§
Sourcefn all_edges(&self) -> Result<Self::Iter<'_>, StorageError>
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.
Sourcefn edge_count(&self) -> Result<u64, StorageError>
fn edge_count(&self) -> Result<u64, StorageError>
Returns the number of edges.
Provided Methods§
Sourcefn is_empty(&self) -> Result<bool, StorageError>
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.