graphlib 0.1.2

Graphlib is a simple and powerful rust library for the graph data-structure that is optimized for high churn environments (where the graph mutates often). It provides a simple api for manipulating and for interacting with graphs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// Copyright 2019 Octavian Oncescu

use rand::Rng;

#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub struct VertexId([u8; 12]);

impl VertexId {
    pub fn random() -> VertexId {
        let bytes = rand::thread_rng().gen::<[u8; 12]>();
        VertexId(bytes)
    }
}