pub fn add_provider(&self) -> Closure {
        let provider_map = self.providers.clone();
        closure_opt(move |mut args| {
            let key: String = Args::next("key", &mut args)?;
            let provider: Provider = Args::next("provider", &mut args)?;

            // check if there are providers for that key
            let empty = {
                let provider_map = map_ref(&provider_map)?;
                provider_map.get(&key).is_none()
            };

            // if there's no providers for that key, insert empty collection into the map
            if empty {
                let mut provider_map = map_ref_mut(&provider_map)?;
                let provider_set = <_>::default();
                provider_map.insert(key.to_string(), provider_set);
            }

            let provider_map = map_ref(&provider_map)?;
            let provider_set = ok_get!(provider_map.get(&key));
            let mut provider_set = set_ref_mut(&provider_set, &key)?;
            provider_set.insert(provider);

            Ok(None)
        })
    }
/// Creates a closure that
/// takes a `Provider` instance as an argument, adds it to the `ProviderRepository`,
/// and returns nothing
Creates a closure that
takes a `Provider` instance as an argument, adds it to the `ProviderRepository`,
and returns nothing
Creates a closure that takes a ` Provider ` instance as an argument adds it to the ` ProviderRepository ` and returns nothing
pub fn add_provider(&self) -> Closure {
        let provider_map = self.providers.clone();
        closure_opt(move |mut args| {
            let key: String = Args::next("key", &mut args)?;
            let provider: Provider = Args::next("provider", &mut args)?;
            // check if there are providers for that key
            let empty = {
                let provider_map = map_ref(&provider_map)?;
                provider_map.get(&key).is_none()
            };
            // if there's no providers for that key, insert empty collection into the map
            if empty {
                let mut provider_map = map_ref_mut(&provider_map)?;
                let provider_set = <_>::default();
                provider_map.insert(key.to_string(), provider_set);
            }
            let provider_map = map_ref(&provider_map)?;
            let provider_set = ok_get!(provider_map.get(&key));
            let mut provider_set = set_ref_mut(&provider_set, &key)?;
            provider_set.insert(provider);
            Ok(None)
        })
    }
pub fn add_provider ( & self ) -> Closure { let provider_map = self . providers . clone ( ) ; closure_opt ( move | mut args | { let key : String = Args :: next ( " " , & mut args ) ? ; let provider : Provider = Args :: next ( " " , & mut args ) ? ; // check if there are providers for that key let empty = { let provider_map = map_ref ( & provider_map ) ? ; provider_map . get ( & key ) . is_none ( ) } ; // if there's no providers for that key, insert empty collection into the map if empty { let mut provider_map = map_ref_mut ( & provider_map ) ? ; let provider_set = < _ > :: default ( ) ; provider_map . insert ( key . to_string ( ) , provider_set ) ; } let provider_map = map_ref ( & provider_map ) ? ; let provider_set = ok_get ! ( provider_map get ( key ) ) ; let mut provider_set = set_ref_mut ( & provider_set , & key ) ? ; provider_set . insert ( provider ) ; Ok ( None ) } ) }
Creates a closure that
takes a `Provider` instance as an argument, adds it to the `ProviderRepository`,
and returns nothing
Creates a closure that takes a ` Provider ` instance as an argument adds it to the ` ProviderRepository ` and returns nothing
&self