/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin */ use std::any::TypeId; pub mod types { use crate::Object; use std::any::TypeId; pub const OBJECT: TypeId = TypeId::of::(); pub const STR: TypeId = TypeId::of::<&str>(); pub const BINARY: TypeId = TypeId::of::<&[u8]>(); pub const U32: TypeId = TypeId::of::(); pub const U64: TypeId = TypeId::of::(); pub const I64: TypeId = TypeId::of::(); pub const F64: TypeId = TypeId::of::(); } #[derive(Clone)] pub struct TagInfo { pub name: &'static str, pub r#type: Option, } #[macro_export] macro_rules! fields { ($($id:ident: $type:ty = $tag:literal;)*) => { $(pub const $id: $crate::TypedTag<$type> = $crate::TypedTag($crate::Tag::new($tag), std::marker::PhantomData);)* }; } #[macro_export] macro_rules! enums { ($($id:ident = $tag:literal;)*) => { $(pub const $id: $crate::Tag = $crate::Tag::new($tag);)* }; }