Update documentation for AppendGraph
This commit is contained in:
+11
-11
@@ -1,17 +1,19 @@
|
||||
//! [`AppendGraph`], an undirected graph topology supporting addition only.
|
||||
|
||||
use crate::maps::{EdgeMap, VertexMap};
|
||||
use crate::traits::{GraphTopology, IncidenceCursor};
|
||||
|
||||
/// An opaque handle identifying a vertex in an [`AppendGraph`].
|
||||
///
|
||||
/// Handles are stable for the lifetime of the graph. They can be obtained via graph methods like
|
||||
/// [`GraphTopology::add_vertex`] and [`GraphTopology::vertices`].
|
||||
/// Handles are stable for the lifetime of the graph. Obtain via graph methods like
|
||||
/// [`AppendGraph::add_vertex`] and [`AppendGraph::vertices`].
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
pub struct Vertex(usize);
|
||||
|
||||
/// An opaque handle identifying an edge in an [`AppendGraph`].
|
||||
///
|
||||
/// Handles are stable for the lifetime of the graph. They can be obtained via graph methods like
|
||||
/// [`GraphTopology::add_edge`] and [`GraphTopology::edges`].
|
||||
/// Handles are stable for the lifetime of the graph. Obtain via graph methods like
|
||||
/// [`AppendGraph::add_edge`] and [`AppendGraph::edges`].
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
pub struct Edge(usize);
|
||||
|
||||
@@ -41,8 +43,7 @@ struct IncidenceEntry {
|
||||
|
||||
/// A resumable cursor over the incidences of a single vertex in an [`AppendGraph`].
|
||||
///
|
||||
/// Can be obtained via [`GraphTopology::incidence_cursor`]. See [`IncidenceCursor`] on how to use
|
||||
/// it.
|
||||
/// Obtain via [`AppendGraph::incidence_cursor`]. See [`IncidenceCursor`] on usage guidance.
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct AppendGraphIncidenceCursor {
|
||||
incidence: Option<Edge>,
|
||||
@@ -57,12 +58,11 @@ impl IncidenceCursor<AppendGraph> for AppendGraphIncidenceCursor {
|
||||
/// An undirected graph that supports adding vertices and edges, but not deleting them.
|
||||
///
|
||||
/// `AppendGraph` is optimised for workloads that incrementally build a graph and query it
|
||||
/// repeatedly. [`Vertex`]
|
||||
/// and [`Edge`] handles are never invalidated. Use [`Graph`] instead if you need to remove vertices
|
||||
/// or edges.
|
||||
/// repeatedly. [`Vertex`] and [`Edge`] handles are never invalidated. Use [`Graph`] instead if you
|
||||
/// need to remove vertices or edges.
|
||||
///
|
||||
/// Incidences are stored as interlaced adjacency lists in a single flat [`Vec`]. This means that
|
||||
/// vertex neighborhood traversals in general result in scattered index jumps.
|
||||
/// Incidences are stored as interleaved adjacency lists in a single flat [`Vec`]. In general,
|
||||
/// vertex neighborhood traversals result in scattered index jumps.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user