tauri-plugin-indexer 0.1.1

a custom indexer (if the version is 1.0.0 then the plugin is ready)
Documentation
use serde::de::DeserializeOwned;
use tauri::{plugin::PluginApi, AppHandle, Runtime};

use crate::models::*;

pub fn init<R: Runtime, C: DeserializeOwned>(
  app: &AppHandle<R>,
  _api: PluginApi<R, C>,
) -> crate::Result<Indexer<R>>
 {
  Ok(Indexer(app.clone()))
}

/// Access to the indexer APIs.
pub struct Indexer<R: Runtime>(AppHandle<R>);

impl<R: Runtime> Indexer<R> {
  pub fn ping(&self, payload: PingRequest) -> crate::Result<PingResponse> {
    Ok(PingResponse {
      value: payload.value,
    })
  }
}