JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

no clue what this is

Amber - ⁨1⁩ year ago

parent: tbd commit: ⁨7889bf6

⁨giterated-runtime/src/domain.rs⁩ - ⁨542⁩ bytes
Raw
1 use std::{cell::OnceCell, sync::OnceLock};
2
3 use giterated_abi::state::{DomainState, State, StateItem};
4 use giterated_core::DomainMetadata;
5
6 struct RuntimeDomainState {
7 pub metadata: DomainMetadata,
8 }
9
10 unsafe impl Send for RuntimeDomainState {}
11 unsafe impl Sync for RuntimeDomainState {}
12
13 static RUNTIME_DOMAIN_STATE: OnceLock<State> = OnceLock::new();
14
15 /// Sources a [`DomainState`] state entry for the application hosting the runtime.
16 pub fn runtime_domain_state() -> DomainState {
17 DomainState(RUNTIME_DOMAIN_STATE.get().unwrap())
18 }
19