Relative Content

Tag Archive for rustvectortypes

Workaround for a vector of types in rust?

pub trait Props { // … } // One, Two and Three implement Props pub type One = LengthyServiceDefWithGenerics<…>; pub type Two = AnotherServiceDefWithGenerics<…>; pub type Three = YetAnother<…>; impl Builder { pub fn build_it<P: Props>(&self) -> Elem<P> { Elem::new(self); } } // somewhere else in the codebase // there might be more instances to […]