use crate::{
core::{CoreTableType, IndexType},
ValType,
};
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct TableType {
pub(crate) core: CoreTableType,
}
impl TableType {
pub fn new(element: ValType, min: u32, max: Option<u32>) -> Self {
let core = CoreTableType::new(element, min, max);
Self { core }
}
pub fn new64(element: ValType, min: u64, max: Option<u64>) -> Self {
let core = CoreTableType::new64(element, min, max);
Self { core }
}
pub fn is_64(&self) -> bool {
self.core.is_64()
}
pub(crate) fn index_ty(&self) -> IndexType {
self.core.index_ty()
}
pub fn element(&self) -> ValType {
self.core.element()
}
pub fn minimum(&self) -> u64 {
self.core.minimum()
}
pub fn maximum(&self) -> Option<u64> {
self.core.maximum()
}
pub(crate) fn is_subtype_of(&self, other: &Self) -> bool {
self.core.is_subtype_of(&other.core)
}
}