Expand description
The Tauri host layer (ADR-0001).
Everything Tauri-specific about an Origin application lives here: plugin registration, tray, window handling, the IPC surface and the bridge that forwards platform events to the webview.
A product’s main.rs stays small:
ⓘ
fn main() {
let config = HostConfig::new("dev.origin.demo");
origin_tauri::builder(&config)
.invoke_handler(origin_handler![my_product_command])
.setup(move |app| {
let application = my_product::build(app.handle())?;
origin_tauri::attach(app.handle(), application, &config)?;
Ok(())
})
.run(tauri::generate_context!())
.expect("failed to start");
}Re-exports§
pub use commands::CommandError;
Modules§
Macros§
- origin_
handler - Builds a Tauri invoke handler containing Origin’s own commands plus the product’s.
Structs§
- Host
Config - Host-level product configuration.
- Origin
State - Tauri-managed state: the assembled application plus its host configuration.
- Tauri
Notification Service - Tauri
Opener - Opens URLs in the user’s default browser.
- Tauri
Tray Service - A
TrayServicebacked by a running Tauri tray icon.
Functions§
- attach
- Hand the assembled application to the desktop shell.
- builder
- A
tauri::Builderwith the Origin plugin set already registered. - focus_
main_ window - Show and focus the main window, creating nothing — if it was closed to tray it is only hidden.