// Copyright (c) 2022 Marceline Cramer // SPDX-License-Identifier: LGPL-3.0-or-later pub use canary_script::*; use parking_lot::{Mutex, RwLock}; use slab::Slab; use std::collections::HashMap; use std::sync::Arc; pub mod backend; pub mod text; use backend::{Backend, Instance, ScriptAbi}; use text::FontStore; /// The main interface to Canary. pub struct Runtime { backend: Box, font_store: Arc, } impl Runtime { pub fn new(backend: Box) -> anyhow::Result { Ok(Self { backend, font_store: Arc::new(FontStore::new()), }) } pub fn load_module(&self, module: &[u8]) -> anyhow::Result