pub trait Algorithm: Send + Sync {
type Config: Default + Clone + Send + 'static;
type Result: Send + 'static;
// Required methods
fn name() -> &'static str;
fn run(graph: &GraphProjection, config: Self::Config) -> Self::Result;
// Provided methods
fn needs_reverse() -> bool { ... }
fn needs_weights() -> bool { ... }
}Expand description
Core trait for all graph algorithms.
Required Associated Types§
Required Methods§
Sourcefn run(graph: &GraphProjection, config: Self::Config) -> Self::Result
fn run(graph: &GraphProjection, config: Self::Config) -> Self::Result
Execute algorithm on a projection.
Provided Methods§
Sourcefn needs_reverse() -> bool
fn needs_reverse() -> bool
Whether this algorithm requires reverse edges.
Sourcefn needs_weights() -> bool
fn needs_weights() -> bool
Whether this algorithm requires edge weights.
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.