use std::{cell::OnceCell, sync::OnceLock}; use giterated_abi::state::{DomainState, State, StateItem}; use giterated_core::DomainMetadata; struct RuntimeDomainState { pub metadata: DomainMetadata, } unsafe impl Send for RuntimeDomainState {} unsafe impl Sync for RuntimeDomainState {} static RUNTIME_DOMAIN_STATE: OnceLock = OnceLock::new(); /// Sources a [`DomainState`] state entry for the application hosting the runtime. pub fn runtime_domain_state() -> DomainState { DomainState(RUNTIME_DOMAIN_STATE.get().unwrap()) }