Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tauri

taba-tauri carries Taba’s RPC over Tauri’s invoke.

A handler answers a procedure, here the introduction’s AddTodo:

#![allow(unused)]
fn main() {
use taba::Never;

async fn add_todo(AddTodo(todo): AddTodo) -> Result<Todo, Never> {
    Ok(todo)
}
}

A Router gives each procedure its handler:

#![allow(unused)]
fn main() {
use taba::{Procedures, rpc::Router};

let procedures = Procedures::new().declare::<AddTodo>();
let router = Router::builder([procedures]).handle(add_todo).build()?;
}

.taba(router) takes the place of .invoke_handler(...):

#![allow(unused)]
fn main() {
use taba_tauri::BuilderExt as _;

tauri::Builder::default()
    .taba(router)
    .run(tauri::generate_context!())
    .expect("error while running tauri application");
}

An app with commands already passes them as the fallback, and moves them over one at a time:

#![allow(unused)]
fn main() {
tauri::Builder::default()
    .taba_with_fallback(router, tauri::generate_handler![greet])
}

Tauri is a trademark of The Tauri Programme within the Commons Conservancy. Taba is not an official Tauri project.