diff --git a/src/schema/operations.rs b/src/schema/operations.rs index fa1dc820..b12d4ece 100644 --- a/src/schema/operations.rs +++ b/src/schema/operations.rs @@ -41,6 +41,7 @@ use crate::LIB_NAME_RGB_COMMIT; pub struct AssignmentType(u16); impl AssignmentType { pub const fn with(ty: u16) -> Self { Self(ty) } + pub const fn to_u16(&self) -> u16 { self.0 } #[inline] pub fn to_le_bytes(&self) -> [u8; 2] { self.0.to_le_bytes() } } @@ -58,6 +59,7 @@ impl AssignmentType { pub struct ValencyType(u16); impl ValencyType { pub const fn with(ty: u16) -> Self { Self(ty) } + pub const fn to_u16(&self) -> u16 { self.0 } } pub type MetaSchema = TinyOrdSet; diff --git a/src/schema/schema.rs b/src/schema/schema.rs index 974f5007..6fc8640f 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -57,6 +57,7 @@ use crate::{ pub struct MetaType(u16); impl MetaType { pub const fn with(ty: u16) -> Self { Self(ty) } + pub const fn to_u16(&self) -> u16 { self.0 } } #[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From, Display)] @@ -72,6 +73,7 @@ impl MetaType { pub struct GlobalStateType(u16); impl GlobalStateType { pub const fn with(ty: u16) -> Self { Self(ty) } + pub const fn to_u16(&self) -> u16 { self.0 } } #[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From, Display)] @@ -87,6 +89,7 @@ impl GlobalStateType { pub struct ExtensionType(u16); impl ExtensionType { pub const fn with(ty: u16) -> Self { Self(ty) } + pub const fn to_u16(&self) -> u16 { self.0 } } #[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From, Display)] @@ -102,6 +105,7 @@ impl ExtensionType { pub struct TransitionType(u16); impl TransitionType { pub const fn with(ty: u16) -> Self { Self(ty) } + pub const fn to_u16(&self) -> u16 { self.0 } } impl TransitionType {