From e3be6592b40f622fc2808b30e4b74c3dcb7b8cc6 Mon Sep 17 00:00:00 2001 From: rasul Date: Fri, 3 Apr 2020 18:37:09 -0500 Subject: [PATCH] some comments --- src/id.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/id.rs b/src/id.rs index 126a3f5..30e0415 100644 --- a/src/id.rs +++ b/src/id.rs @@ -1,3 +1,7 @@ +//! Universally unique identifier +//! +//! Wrapper around `Uuid` to store it as text in sql table. + use std::cmp::{Eq, PartialEq}; use std::fmt; use std::hash::{Hash, Hasher}; @@ -6,10 +10,12 @@ use rusqlite::types::{FromSql, FromSqlError, FromSqlResult, ToSql, ToSqlOutput, use serde::{Deserialize, Serialize}; use uuid::Uuid; +/// Universally unique identifier #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub struct Id(Uuid); impl Id { + /// Return a newly generated `Id` pub fn new() -> Self { Self(Uuid::new_v4()) }