pub fn new(services: Vec<Box<dyn Service>>) -> Self {
        let mut inner = BTreeMap::new();

        inner.insert("system".to_owned(), Self::system_api());

        let mut service_names: Vec<String> = vec![];

        inner.extend(services.iter().map(|service| {
            let prefix = service.name().to_string();

            if service_names.contains(&prefix) {
                panic!("Service with name `{}` already exists.", prefix);
            }

            let mut builder = ServiceApiBuilder::new();

            service.wire_api(&mut builder);

            service_names.push(prefix.to_owned());

            (prefix, builder)
        }));

        Self { inner }
    }
/// Create new `ApiAggregator` instance
Create new `ApiAggregator` instance
Create new ` ApiAggregator ` instance
pub fn new(services: Vec<Box<dyn Service>>) -> Self {
        let mut inner = BTreeMap::new();
        inner.insert("system".to_owned(), Self::system_api());
        let mut service_names: Vec<String> = vec![];
        inner.extend(services.iter().map(|service| {
            let prefix = service.name().to_string();
            if service_names.contains(&prefix) {
                panic!("Service with name `{}` already exists.", prefix);
            }
            let mut builder = ServiceApiBuilder::new();
            service.wire_api(&mut builder);
            service_names.push(prefix.to_owned());
            (prefix, builder)
        }));
        Self { inner }
    }
pub fn new ( services : Vec < Box < dyn Service > > ) -> Self { let mut inner = BTreeMap :: new ( ) ; inner . insert ( " " . to_owned ( ) , Self :: system_api ( ) ) ; let mut service_names : Vec < String > = vec ! [ ] ; inner . extend ( services . iter ( ) . map ( | service | { let prefix = service . name ( ) . to_string ( ) ; if service_names . contains ( & prefix ) { panic ! ( " " prefix ) ; } let mut builder = ServiceApiBuilder :: new ( ) ; service . wire_api ( & mut builder ) ; service_names . push ( prefix . to_owned ( ) ) ; ( prefix , builder ) } ) ) ; Self { inner } }
Create new `ApiAggregator` instance
Create new ` ApiAggregator ` instance
services
Vec<Box<dyn Service>>
services
Vec<Box<dyn Service>>