tauri-plugin-indexer 0.1.1

a custom indexer (if the version is 1.0.0 then the plugin is ready)
Documentation
use tauri::{
  plugin::{Builder, TauriPlugin},
  Manager, Runtime,
};

pub use models::*;

#[cfg(desktop)]
mod desktop;
#[cfg(mobile)]
mod mobile;

mod commands;
mod error;
mod models;

pub use error::{Error, Result};

#[cfg(desktop)]
use desktop::Indexer;
#[cfg(mobile)]
use mobile::Indexer;

/// Extensions to [`tauri::App`], [`tauri::AppHandle`] and [`tauri::Window`] to access the indexer APIs.
pub trait IndexerExt<R: Runtime> {
  fn indexer(&self) -> &Indexer<R>;
}

impl<R: Runtime, T: Manager<R>> crate::IndexerExt<R> for T {
  fn indexer(&self) -> &Indexer<R> {
    self.state::<Indexer<R>>().inner()
  }
}

/// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> {
  Builder::new("indexer")
    .invoke_handler(tauri::generate_handler![commands::index_directory])
    .setup(|app, api| {
      #[cfg(mobile)]
      let indexer = mobile::init(app, api)?;
      #[cfg(desktop)]
      let indexer = desktop::init(app, api)?;
      app.manage(indexer);
      Ok(())
    })
    .build()
}

mod indexer {
    pub mod config;
    pub mod utils {
        pub mod tokenizer;
        pub mod word_utils;
        pub mod file_utils;
    }
    pub mod search;
    pub mod indexer;
}