INNER CODE UNIT · Rust
ctx
shawnscode/crayon · modules/world/src/lib.rs:90
pub fn ctx() -> &'static WorldSystem {
unsafe {
debug_assert!(
!CTX.is_null(),
"world system has not been initialized properly."
);
&*CTX
}
}
/// Setup the world system.
pub fn setup() -> Result<(), failure::Error> {
unsafe {
debug_assert!(CTX.is_null(), "duplicated setup of world system.");
let ctx = WorldSystem::new()?;
CTX = Box::into_raw(Box::new(ctx));