1#[macro_export(local_inner_macros)]
2macro_rules! storage_id_type {
4 ($name:ident) => {
5 #[derive(Clone, Hash, PartialEq, Eq)]
6 pub struct $name {
8 id: alloc::sync::Arc<alloc::string::String>,
9 }
10
11 impl $name {
12 pub fn new() -> Self {
14 Self {
15 id: alloc::sync::Arc::new(burn_common::id::IdGenerator::generate()),
16 }
17 }
18 }
19
20 impl Default for $name {
21 fn default() -> Self {
22 Self::new()
23 }
24 }
25 };
26}
27
28#[macro_export(local_inner_macros)]
29macro_rules! memory_id_type {
31 ($name:ident) => {
32 #[derive(Clone, Hash, PartialEq, Eq, Debug)]
33 pub struct $name {
35 id: alloc::sync::Arc<alloc::string::String>,
36 }
37
38 impl $name {
39 pub(crate) fn new() -> Self {
41 Self {
42 id: alloc::sync::Arc::new(burn_common::id::IdGenerator::generate()),
43 }
44 }
45 }
46
47 impl Default for $name {
48 fn default() -> Self {
49 Self::new()
50 }
51 }
52 };
53}