Crates.io | gato-core |
lib.rs | gato-core |
version | 0.5.7 |
source | src |
created_at | 2020-07-24 17:22:35.641 |
updated_at | 2022-07-30 23:04:58.698055 |
description | Core of Gato Web Framework |
homepage | |
repository | |
max_upload_size | |
id | 269075 |
size | 15,837 |
This repo contains all generics needed to build a modular framework in rust.
Is a trait responsible to modularize the framework, you can register customs ServiceProviders that will be executed during the framework bootstrap, at this moment you can register new drivers or configure the environment, etc.
See SimpleRouter for example:
use crate::SimpleRouter;
use gato_core::kernel::Provider;
use gato_core::kernel::RouterHandler;
pub struct SimpleRouterServiceProvider { }
impl SimpleRouterServiceProvider {
pub fn new() -> Box<Self> { Box::new(SimpleRouterServiceProvider {}) }
}
impl Provider for SimpleRouterServiceProvider {
// This method is executed during boot only one time
fn boot(&self) -> () {
// Register the Router driver
RouterHandler::set_driver(Box::new(SimpleRouter::new()));
}
}