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: generic_provider.rs
    path of file: ./repos/vim-clap/crates/maple_core/src/stdio_server/provider/impls
    
    the code of the file until where you have to start completion: use crate::stdio_server::provider::hooks::{initialize_provider, CachedPreviewImpl, PreviewTarget};
use crate::stdio_server::provider::{
    BaseArgs, ClapProvider, Context, ProviderError, ProviderResult as Result, ProviderSource,
};
use crate::stdio_server::vim::SearchProgressor;
use filter::{FilterContext, ParallelSource};
use parking_lot::Mutex;
use printer::Printer;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread::JoinHandle;
use subprocess::Exec;
use types::MatchedItem;

#[derive(Debug)]
enum DataSource {
    File(PathBuf),
    Command(String),
}

#[derive(Debug)]
struct FilterControl {
    stop_signal: Arc<AtomicBool>,
    join_handle: JoinHandle<()>,
}

impl FilterControl {
    fn kill(self) {
        self.stop_signal.store(true, Ordering::SeqCst);
        let _ = self.join_handle.join();
    }
}

/// Start the parallel filter in a new thread.
fn start_filter_parallel(
    query: String,
    number: usize,
    data_source: DataSource,
    ctx: &Context,
) -> FilterControl {
    let stop_signal = Arc::new(AtomicBool::new(false));

    let join_handle = {
        le
    
    async fn on_move(&mut self, ctx: &mut Context) -> Result<()> {
        if !ctx.env.preview_enabled {
            return Ok(());
        }

        let lnum = ctx.vim.display_getcurlnum().await?;

        let curline = ctx.vim.display_getcurline().await?;

        if curline.is_empty() {
            tracing::debug!("Skipping preview as curline is empty");
            return Ok(());
        }

        let preview_height = ctx.preview_height().await?;
        let preview_impl =
            if let Some(preview_target) = self.nontypical_preview_target(&curline, ctx).await? {
                CachedPreviewImpl {
                    ctx,
                    preview_height,
                    preview_target,
                    cache_line: None,
                }
            } else {
                CachedPreviewImpl::new(curline, preview_height, ctx)?
            };

        let (preview_target, preview) = preview_impl.get_preview().await?;

        // Ensure the preview result is not out-dated.
        let curlnum = ctx.vim.display_getcurlnum().await?;
        if curlnum == lnum {
            ctx.update_picker_preview(preview)?;
        }

        ctx.preview_manager.set_preview_target(preview_target);

        Ok(())
    }