pub fn insert_custom_component(
        &self,
        health_check: Arc<dyn CheckHealth>,
    ) -> Result<(), AppHealthCheckError> {
        let health_check_name = health_check.name();
        let mut guard = self.inner.lock().expect("`AppHealthCheck` is poisoned");
        if guard
            .components
            .iter()
            .any(|check| check.name() == health_check_name)
        {
            return Err(AppHealthCheckError::RedefinedComponent(health_check_name));
        }
        guard.components.push(health_check);
        Ok(())
    }
Inserts a custom health check for a component.

# Errors

Returns an error if the component with the same name is already defined.
core/lib/health_check/src/lib.rs