#![allow(clippy::bool_comparison)]
macro_rules! create_guarded_uuid {
($this_val:ident) => {
#[derive(PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize, Copy, Clone)]
pub struct $this_val(uuid::Uuid);
impl std::fmt::Debug for $this_val {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{} -- {}", stringify!($this_val), self.0)
}
}
impl $this_val {
pub fn new() -> Self {
Self(uuid::Uuid::new_v4())
}
pub fn with_id(id: uuid::Uuid) -> Self {
Self(id)
}
pub fn with_string(input: &str) -> Self {
Self(uuid::Uuid::parse_str(input).unwrap())
}
pub fn inner(&self) -> uuid::Uuid {
self.0
}
}
impl Default for $this_val {
fn default() -> Self {
Self::new()
}
}
};
}
mod typings;
pub use typings::*;
pub mod utils;