Initial setup for results for wasm

This commit is contained in:
2023-04-23 10:10:06 +02:00
parent eb68977290
commit 0d3d5bcbe7
18 changed files with 511 additions and 386 deletions

View File

@@ -573,6 +573,11 @@ impl ScriptContainer {
&self.script
}
/// Whether or not the script is set.
pub fn is_any(&self) -> bool {
self.script.read().is_some()
}
/// Get the underlying script as the downcasted value.
pub fn get_as<T: 'static>(&self) -> Result<MappedRwLockReadGuard<T>> {
let r = RwLockReadGuard::try_map(self.script.read(), |a| unsafe {