Rust

Crate root

Module
What utopia_registry defines at its root.

Contents

use utopia_registry::Registry;
Rust
pub struct Registry

Named factories, and the instances they created in each context.

Rust
use utopia_registry::Registry;

let mut registry = Registry::new();
registry.set("list", || vec![String::from("test")]);

registry.get::<Vec<String>>("list")?.push("Hello World".into());
assert_eq!(registry.get::<Vec<String>>("list")?.len(), 2);
Also implements Default, Debug.
use utopia_registry::Error;
Rust
pub enum Error

Why a resource could not be read.