Skip to content

Commit

Permalink
Fixed documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
octavonce committed Mar 21, 2019
1 parent 597ffda commit e4dad1d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::hash::Hasher;
use std::hash::Hash;

#[derive(Clone, Debug)]
/// Edge internal struct
pub struct Edge {
inbound: Arc<VertexId>,
outbound: Arc<VertexId>,
Expand Down
2 changes: 2 additions & 0 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ use hashbrown::{HashMap, HashSet};
use std::sync::Arc;

#[derive(Clone, Debug, PartialEq)]
/// Graph operation error
pub enum GraphErr {
NoSuchVertex,
CannotAddEdge,
}

#[derive(Clone, Debug)]
/// Graph data-structure
pub struct Graph<T> {
vertices: HashMap<Arc<VertexId>, (T, Arc<VertexId>)>,
edges: HashSet<Edge>,
Expand Down
1 change: 1 addition & 0 deletions src/iterators/bfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::collections::VecDeque;
use std::sync::Arc;

#[derive(Debug)]
/// Breadth-First Iterator
pub struct Bfs<'a, T> {
queue: VecDeque<Arc<VertexId>>,
current_ptr: Option<Arc<VertexId>>,
Expand Down
1 change: 1 addition & 0 deletions src/iterators/dfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use hashbrown::HashMap;
use std::sync::Arc;

#[derive(Debug)]
/// Depth-First Iterator
pub struct Dfs<'a, T> {
recursion_stack: Vec<Arc<VertexId>>,
color_map: HashMap<Arc<VertexId>, Color>,
Expand Down
1 change: 1 addition & 0 deletions src/iterators/vertices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::vertex_id::VertexId;

#[derive(Debug)]
/// Generic Vertex Iterator
pub struct VertexIter<'a> {
current: usize,
iterable: Vec<&'a VertexId>,
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// macro to find minimum of a number
/// Find the minimum of a set of numbers
#[macro_export]
macro_rules! min {
($x: expr) => ($x);
Expand Down
1 change: 1 addition & 0 deletions src/vertex_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use rand::Rng;

#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
/// Id of a vertex
pub struct VertexId([u8; 16]); // 128bit

impl VertexId {
Expand Down

0 comments on commit e4dad1d

Please sign in to comment.