Skip to main content

desert_framework/
dependency.rs

1use std::any::TypeId;
2
3use crate::service::Service;
4
5#[derive(Debug, Clone)]
6pub struct Dependency {
7    pub type_id: TypeId,
8    pub name: String,
9}
10
11pub fn dep<T: ?Sized + 'static + Service>() -> Dependency {
12    Dependency {
13        type_id: TypeId::of::<T>(),
14        name: T::name(),
15    }
16}
17
18pub type Deps = Vec<Dependency>;