add core lib id docs

This commit is contained in:
Josh Junon 2024-01-03 20:02:39 +01:00 committed by GitButler
parent e67e1b983f
commit 354afedea2

View File

@ -1,9 +1,16 @@
//! A generic UUID-based wrapper, via a newtype pattern
//! with a few key integrations used throughout the library.
use std::{fmt, hash::Hash, marker::PhantomData, str}; use std::{fmt, hash::Hash, marker::PhantomData, str};
#[cfg(feature = "serde")] #[cfg(feature = "serde")]
use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde::{Deserialize, Deserializer, Serialize, Serializer};
use uuid::Uuid; use uuid::Uuid;
/// A generic UUID-based newtype.
///
/// `Default` is implemented to generate a new UUID
/// via [`Uuid::new_v4`].
pub struct Id<T>(Uuid, PhantomData<T>); pub struct Id<T>(Uuid, PhantomData<T>);
impl<T> Hash for Id<T> { impl<T> Hash for Id<T> {