pub async fn start_server<M: Middleware + 'static, UD: Send + Sync + 'static, F>(
    config: &StateServerConfig,
    state_server: StateServer<M, UD, F>,
    kill_switch: Receiver<()>
) -> Result<(), Error>where
    F::InitialState: DeserializeOwned + 'static,
    F: Serialize + Foldable<UserData = UD> + 'static,