You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: service.rs
    path of file: ./repos/vim-clap/crates/maple_core/src/stdio_server
    
    the code of the file until where you have to start completion: //! Each invocation of Clap provider is a session. When you exit the provider, the session ends.

use crate::stdio_server::input::{
    AutocmdEvent, AutocmdEventType, InternalProviderEvent, PluginAction, PluginEvent,
    ProviderEvent, ProviderEventSender,
};
use crate::stdio_server::plugin::{ActionType, ClapPlugin, PluginId};
use crate::stdio_server::provider::{ClapProvider, Context, ProviderId};
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::fmt::Debug;
use std::ops::ControlFlow;
use std::time::Duration;
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender};
use tokio::time::Instant;

pub type ProviderSessionId = u64;

#[derive(Debug)]
pub struct ProviderSession {
    ctx: Context,
    id: ProviderId,
    provider_session_id: ProviderSessionId,
    /// Each provider session can have its own message processing logic.
    provider: Box<dyn ClapProvider>,
    provider_events: UnboundedReceiver<ProviderEvent>,
}

impl ProviderSession {
    pub fn new(
    
    async fn run_event_loop_without_debounce(mut self) {
        while let Some(event) = self.provider_events.recv().await {
            tracing::trace!(debounce = false, "[{}] Received event: {event:?}", self.id);

            match event {
                ProviderEvent::Internal(internal_event) => {
                    if self.handle_internal_event(internal_event).await.is_break() {
                        break;
                    }
                }
                ProviderEvent::Exit => {
                    self.provider
                        .on_terminate(&mut self.ctx, self.provider_session_id);
                    break;
                }
                ProviderEvent::OnMove(_params) => {
                    if let Err(err) = self.provider.on_move(&mut self.ctx).await {
                        tracing::debug!(?err, "Failed to process OnMove");
                    }
                }
                ProviderEvent::OnTyped(_params) => {
                    let _ = self.ctx.record_input().await;
                    if let Err(err) = self.provider.on_typed(&mut self.ctx).await {
                        tracing::debug!(?err, "Failed to process OnTyped");
                    }
                }
                ProviderEvent::Key(key_event) => {
                    if let Err(err) = self.provider.on_key_event(&mut self.ctx, key_event).await {
                        tracing::error!(?err, "Failed to process key_event");
                    }
                }
            }
        }
    }