sdi

Macro inject

Source
inject!() { /* proc-macro */ }
Expand description

Get an statically resolved service expression by key

ยงExample

use sdi::{inject, provide};

#[derive(Debug, PartialEq)]
struct A;

impl A {
    pub fn new() -> A { A }
    provide!(A <- A::new());
}

assert_eq!(A::new(), inject!(A))