pub trait Graph {
// Required methods
fn vertex_count(&self) -> usize;
fn neighbors(&self, vertex: Vertex, emit: impl FnMut(Vertex));
}Expand description
A finite directed graph over vertices 0..vertex_count().
Agents move along edges or wait in place; waits are implicit and must not be reported as self-loops. For undirected graphs, report every edge in both directions.
Required Methods§
Sourcefn vertex_count(&self) -> usize
fn vertex_count(&self) -> usize
The number of vertices. Vertex ids are 0..vertex_count().
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".