use crate::entity::entity_impl;
use core::u32;
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct LocalFunctionIndex(u32);
entity_impl!(LocalFunctionIndex);
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
pub struct LocalTableIndex(u32);
entity_impl!(LocalTableIndex);
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
pub struct LocalMemoryIndex(u32);
entity_impl!(LocalMemoryIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct LocalGlobalIndex(u32);
entity_impl!(LocalGlobalIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct FunctionIndex(u32);
entity_impl!(FunctionIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct TableIndex(u32);
entity_impl!(TableIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct GlobalIndex(u32);
entity_impl!(GlobalIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct MemoryIndex(u32);
entity_impl!(MemoryIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct SignatureIndex(u32);
entity_impl!(SignatureIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct DataIndex(u32);
entity_impl!(DataIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct ElemIndex(u32);
entity_impl!(ElemIndex);
#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Debug,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(transparent)]
pub struct CustomSectionIndex(u32);
entity_impl!(CustomSectionIndex);
#[derive(
Clone,
Debug,
Hash,
PartialEq,
Eq,
PartialOrd,
Ord,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(u8)]
pub enum ExportIndex {
Function(FunctionIndex),
Table(TableIndex),
Memory(MemoryIndex),
Global(GlobalIndex),
}
#[derive(
Clone,
Debug,
Hash,
PartialEq,
Eq,
PartialOrd,
Ord,
rkyv::Serialize,
rkyv::Deserialize,
rkyv::Archive,
)]
#[archive(as = "Self")]
#[repr(u8)]
pub enum ImportIndex {
Function(FunctionIndex),
Table(TableIndex),
Memory(MemoryIndex),
Global(GlobalIndex),
}