| Crates.io | gom |
| lib.rs | gom |
| version | 0.1.7 |
| created_at | 2025-02-04 10:22:45.366693+00 |
| updated_at | 2025-03-04 12:11:14.912514+00 |
| description | A simple Rust global object manager |
| homepage | |
| repository | https://github.com/Anglebase/GOM.git |
| max_upload_size | |
| id | 1541770 |
| size | 19,317 |
This is a simple global object manager that makes it easier for you to use global objects in Rust.
You need to add crate constcat to support macro id!(...).
This is a flaw in Rust.
use gom::*;
const VEC: &str = id!(Vec);
const ID: &str = id!(@VEC.Bar);
fn main() {
Registry::register(ID, vec![1, 2, 3]);
Registry::<Vec<i32>>::apply(ID, |v| {
v.push(4);
});
let v = Registry::<Vec<i32>>::remove(ID);
println!("{:?}", v);
}