pub async fn reconfigure_or_remake(
    provider: &mut Box<dyn SuggestionProvider>,
    new_config: SuggestionProviderConfig,
    make_fresh: &MakeFreshType
) -> Result<(), SetupError>
Expand description

Reconfigure the passed provider, or if there is a problem reconfiguring it, replace it with a newly created provider.

Errors

If there is an error serializing the config, no changes will be made and that error will be returned. If there is an error reconfiguring the original provider, a new provider will be created and written to the reference for the original provider, overwriting the original. The error that resulted from reconfigure will be logged as a warning. If there is an error during while creating the new provider, the original provider will not be overwritten, and may be in an inconsistent state.