Compare commits
1 Commits
feat/rende
...
main
Author | SHA1 | Date |
---|---|---|
SeanOMik | 62adcf2b50 |
|
@ -42,13 +42,20 @@ impl DynTypeId {
|
|||
*self == id
|
||||
}
|
||||
|
||||
/// Force self into a rust TypeId, will panic if this type is not a Rust type.
|
||||
/// Force self into a rust TypeId, will panic if this type is not a Rust type.
|
||||
pub fn as_rust(&self) -> TypeId {
|
||||
match self {
|
||||
DynTypeId::Rust(t) => *t,
|
||||
DynTypeId::Unknown(_) => panic!("This type is unknown to rust, cannot construct a TypeId from it!"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_unknown(&self) -> Option<u128> {
|
||||
match self {
|
||||
DynTypeId::Rust(_) => None,
|
||||
DynTypeId::Unknown(id) => Some(*id),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Some information about a component.
|
||||
|
|
Loading…
Reference in New Issue