| Crates.io | luminos |
| lib.rs | luminos |
| version | 0.1.1 |
| created_at | 2025-06-02 17:06:44.541784+00 |
| updated_at | 2025-06-02 17:06:44.541784+00 |
| description | A Laravel inspired crate |
| homepage | |
| repository | https://github.com/RaubJo/luminos |
| max_upload_size | |
| id | 1698150 |
| size | 7,741 |
This is a Laravel inspired application framework.
This crate re-exports the following sub crates to provide a unified api.
The goal of this is provide a simple way to build runtime agnostic rust apps.
For the container singleton
use std::collections::HashMap;
use std::sync::OnceLock;
fn hashmap() -> &'static HashMap<u32, &'static str> {
static HASHMAP: OnceLock<HashMap<u32, &str>> = OnceLock::new();
HASHMAP.get_or_init(|| {
let mut m = HashMap::new();
m.insert(0, "foo");
m.insert(1, "bar");
m.insert(2, "baz");
m
})
}
fn main() {
// First access to `HASHMAP` initializes it
println!("The entry for `0` is \"{}\".", hashmap().get(&0).unwrap());
// Any further access to `HASHMAP` just returns the computed value
println!("The entry for `1` is \"{}\".", hashmap().get(&1).unwrap());
}