lumina-framework 1.1.0

A beautiful, fast, and elegant web framework for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::any::Any;
use std::collections::HashMap;

pub struct Container {
    bindings: HashMap<String, Box<dyn Any>>,
}

impl Container {
    pub fn new() -> Self {
        Self {
            bindings: HashMap::new(),
        }
    }

    pub fn bind<T: 'static>(&mut self, key: String, value: T) {
        self.bindings.insert(key, Box::new(value));
    }
}