diff --git a/src/models.rs b/src/models.rs index 8de20af..3576374 100644 --- a/src/models.rs +++ b/src/models.rs @@ -2,15 +2,12 @@ #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub struct Vertex(pub usize); -// TODO: Incidence value must not be public. -// TODO: Incidence must not be public. #[derive(Copy, Clone, PartialEq, Eq)] -pub struct Incidence(pub usize); +struct Incidence(usize); -// TODO: VertexIncidenceHeader and its fields must not be public, but without iterators there is currently no other way to access vertex incidences. -pub struct VertexIncidenceHeader { +struct VertexIncidenceHeader { incidence_count: usize, - pub first_incidence: Option, + first_incidence: Option, } pub struct VertexNeighborIterator<'a> { @@ -28,7 +25,6 @@ impl<'a> Iterator for VertexNeighborIterator<'a> { } } -// TODO: Graph fields must not be public. // TODO: Add functions to reserve memory for vertices and edges. // TODO: Graph cannot support deleting vertices because of the external indices "Vertex". They could be made stable with e.g. slotmap or generational arena. // TODO: Add function to delete vertices. @@ -36,9 +32,9 @@ impl<'a> Iterator for VertexNeighborIterator<'a> { // TODO: Add iterator of edges. pub struct Graph { // TODO: Index 'incidence_headers' by a 'Vertex' instead of 'Vertex.0'? - pub incidence_headers: Vec, - pub next_incidences: Vec>, - pub incidence_vertices: Vec, + incidence_headers: Vec, + next_incidences: Vec>, + incidence_vertices: Vec, } impl Graph {