| Crates.io | shellder-macros |
| lib.rs | shellder-macros |
| version | 0.1.5 |
| created_at | 2025-07-05 16:37:57.862294+00 |
| updated_at | 2025-07-27 12:16:06.237218+00 |
| description | A lightweight, type-safe dependency injection and application framework for Rust inspired by Spring. |
| homepage | |
| repository | https://github.com/Kunta-tech/shellder-macros |
| max_upload_size | |
| id | 1739317 |
| size | 23,103 |
A lightweight, Spring-inspired Dependency Injection framework for Rust. "A Crab needs its Shell"
Shellder brings a modular, ergonomic approach to Rust applications by offering:
#[component] and #[derive(App)] macrosstartup, run, cleanup)Arc-based)Built for CLI tools, long-running services, or application backends.
[dependencies]
shellder = "0.2.5"
use std::sync::Arc;
use shellder::{App, Container, Hooks, Lifecycle};
pub struct Logger;
impl Logger {
pub fn log(&self, msg: &str) {
println!("[LOG] {}", msg);
}
}
#[derive(App)]
pub struct HelloApp {
#[component]
logger: Arc<Logger>,
}
impl Hooks for HelloApp {
fn startup(&self) {
self.logger.log("Starting up!");
}
fn run(&self) {
self.logger.log("Running...");
}
fn cleanup(&self) {
self.logger.log("Shutting down.");
}
}
Running this app will automatically inject dependencies and call hooks in order.
โ
#[component] macro for auto-registration
โ
#[derive(App)] macro to auto-generate main()
โ
Lifecycle Hooks trait support
โ
Thread-safe singleton container
โ
Optional custom logger
โ
Works without tokio or async runtime
"db", "logger").toml or .yaml)#[value], #[config], etc.Shellder follows a Rust-first vision:
Licensed under Apache-2.0.
Bug reports, PRs, and feedback are welcome! Open an issue to discuss enhancements or integrations.
Shellder is under active development. Watch the repo for updates on: