global_registry

Function global_registry 

Source
pub fn global_registry() -> &'static ServiceRegistry
Expand description

Process-wide default service registry singleton.

Initialized once via LazyLock. Use for global lookup of well-known services without passing the registry through call chains.

Register your services into the global registry at startup:

use stygian_graph::application::registry::global_registry;
use stygian_graph::adapters::noop::NoopService;
use std::sync::Arc;

global_registry().register("noop".to_string(), Arc::new(NoopService));