use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct ChunkId(pub uuid::Uuid);
impl ChunkId {
#[must_use]
pub fn new() -> Self {
Self(uuid::Uuid::new_v4())
}
}
impl Default for ChunkId {
fn default() -> Self {
Self::new()
}
}
impl std::fmt::Display for ChunkId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}