1 2 3 4 5 6 7 8 9 10 11 12 13
use depcon::*; use std::sync::Arc; trait Interface {} struct Implementation; #[provide] impl Interface for Implementation {} fn main() { let arc = Arc::new(Implementation); let _: Arc<dyn Interface> = arc.provide(); }