desert_framework 0.1.0

Micro-framework for building backend applications in Rust with Axum
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::any::TypeId;

use crate::service::Service;

#[derive(Debug, Clone)]
pub struct Dependency {
    pub type_id: TypeId,
    pub name: String,
}

pub fn dep<T: ?Sized + 'static + Service>() -> Dependency {
    Dependency {
        type_id: TypeId::of::<T>(),
        name: T::name(),
    }
}

pub type Deps = Vec<Dependency>;