Skip to main content

Crate allframe_tauri

Crate allframe_tauri 

Source
Expand description

Tauri 2.x plugin for AllFrame

Exposes AllFrame Router handlers as Tauri IPC commands for desktop apps. Designed for offline-first deployments where HTTP transport is unnecessary.

§Rust (Tauri app)

use allframe_core::router::Router;

fn main() {
    let mut router = Router::new();
    router.register("get_user", || async {
        r#"{"id":1,"name":"Alice"}"#.to_string()
    });

    tauri::Builder::default()
        .plugin(allframe_tauri::init(router))
        .run(tauri::generate_context!())
        .unwrap();
}

§Frontend (TypeScript)

import { invoke } from "@tauri-apps/api/core";

// List available handlers
const handlers = await invoke("plugin:allframe-tauri|allframe_list");

// Call a handler
const result = await invoke("plugin:allframe-tauri|allframe_call", {
    handler: "get_user",
    args: { id: 42 }
});

§In-Process Dispatch (Local LLM / Ollama)

TauriServer also supports direct in-process calls without Tauri runtime, useful for local LLM integration without opening a network port:

use allframe_core::router::Router;
use allframe_tauri::TauriServer;

let mut router = Router::new();
router.register("skill", || async { "done".to_string() });

let server = TauriServer::new(router);
let result = server.call_handler("skill", "{}").await.unwrap();
assert_eq!(result.result, "done");

Re-exports§

pub use boot::BootBuilder;
pub use boot::BootContext;
pub use boot::BootError;
pub use boot::BootProgress;
pub use error::TauriServerError;
pub use plugin::builder;
pub use plugin::init;
pub use plugin::init_with_state;
pub use plugin::PLUGIN_NAME;
pub use server::TauriServer;
pub use types::CallResponse;
pub use types::HandlerInfo;
pub use types::HandlerKind;
pub use types::StreamStartResponse;

Modules§

boot
Async boot lifecycle for Tauri plugins.
commands
Tauri IPC command handlers
error
Tauri-compatible error types
plugin
Tauri 2.x plugin builder
server
TauriServer wraps a Router for IPC dispatch
types
Request and response types for Tauri IPC commands

Structs§

StreamReceiver
Receiver half for streaming handlers.