Expand description
Public Rust API for applications built with Tuffite.
Applications declare a logical main with explicit Browser and Utility types.
Browser state is created only in the main process. The main factory assembles
definitions in each process, while before_startup runs for each native process role.
use tuffite::{Browser, BrowserContext, ApplicationResult};
struct MyBrowser;
#[tuffite::browser]
impl Browser for MyBrowser {
fn new(_: BrowserContext) -> ApplicationResult<Self> { Ok(Self) }
}
#[tuffite::main(browser = MyBrowser)]
fn main() -> tuffite::app::Builder<MyBrowser> {
tuffite::app::Builder::new()
.before_startup(|launch| {
launch.argv_mut().retain(|arg| arg != "--business-debug");
Ok(())
})
}Modules§
- app
- Application entry assembly and browser launch hooks.
- browser
- Browser-process state and trusted native capabilities.
- build
- Build-time validation and source generation for Tuffite applications.
- cli
- remoting
- Asynchronous native desktop remoting client. Asynchronous native desktop remoting client. No application policy or transport.
- shell_
api - Generated Framework Shell API models and typed native requests.
- utility
- Sandboxed utility implementations and browser-side clients.
Macros§
- generate_
handler - Builds a statically checked command registry from explicitly annotated
handlers. Each handler must use
#[tuffite::command(endpoint::Type)].
Structs§
- Application
Error - Failure while creating or shutting down an application.
- Browser
Context - Immutable startup data supplied when one browser instance is created.
- Bytes
- Owned binary value corresponding to TypeScript
Uint8Array. - Chromium
Executor - Cloneable, thread-safe handle to Chromium’s process-wide thread pool.
- Chromium
Task - Awaitable result of one finite closure scheduled on Chromium’s thread pool.
- Command
- One decoded binary
ShellAPIcommand borrowed for the duration of dispatch. - Command
Descriptor - Generated metadata for one application
ShellAPIendpoint. - Event
Emitter - Cloneable, thread-safe handle for broadcasting named binary events.
- Java
Script Extension Host - Cloneable trusted entrypoint for restricted JavaScript extension sessions.
- Java
Script Extension Package - Complete immutable ECMAScript module graph supplied by trusted Rust code.
- Java
Script Extension Session Handle - Opaque handle for one restricted JavaScript extension realm.
- RawHandle
- A C-ABI-safe, pointer-free object identity.
- Runtime
- Rust control plane lifecycle and task supervisor.
- Shell
ApiHost - Thread-safe native application client for generated Shell API requests.
- Task
Context - Context passed to one supervised task.
- Task
Handle - Public pointer-free identity of a supervised Runtime task.
- Timestamp
- UTC milliseconds since the Unix epoch, corresponding to TypeScript
Date. - Utility
Context - Immutable service startup data owned by the Utility child process.
- Utility
Request - Owned input and cooperative lifecycle controls for one utility invocation.
- Utility
Service Registration - Static registration for an application-defined utility service.
- Utility
Session Closed - Terminal state delivered exactly once when a Utility session closes.
- Utility
Session Command - One command delivered to a live Utility session.
- Utility
Session Emitter - Cloneable, credit-controlled event emitter supplied to a Utility session.
- Utility
Session Event - One ordered semantic event emitted by a long-lived Utility session.
- Utility
Session Flow Control - Producer-side credit and sequence state for one Utility session.
- Utility
Session Handle - Opaque main-Runtime handle for one supervised Utility session.
- Utility
Session Host - Cloneable entrypoint for creating long-lived Utility sessions.
- Utility
Session Options - Session limits negotiated before the Utility process receives extension code.
- Utility
Session Request - Immutable initialization data supplied when creating one Utility session.
- V8Context
- Browser-process environment for one named V8 resource provider.
Enums§
- Chromium
Task Error - Failure reported by an awaited Chromium task.
- Command
Error - Executor
Error - Failure while submitting work to Chromium.
- Handle
Kind - Stable object categories encoded into
RawHandle. - Java
Script Extension Error - Error detected while constructing or invoking a restricted extension realm.
- Runtime
Error - Errors produced by Runtime lifecycle and task operations.
- Runtime
State - Observable Runtime lifecycle states.
- Shell
ApiError - Task
Priority - Scheduling priority forwarded to Chromium.
- Utility
Session Flow Error - Protocol errors detected before an event reaches Mojo or application code.
- Utility
Session Host Error - Host-side error for one Utility session operation.
Constants§
- DEFAULT_
UTILITY_ SESSION_ CREDITS - Default maximum number of unacknowledged events in one Utility session.
- MAX_
UTILITY_ SESSION_ CREDITS - Hard upper bound for a negotiated event-credit window.
- MAX_
UTILITY_ SESSION_ EVENT_ BYTES - Hard upper bound for a single semantic Utility session event.
Traits§
- Browser
- Stateful backend created only in the browser process.
- Shell
ApiRequest - Generated endpoint request with the same argument/result codecs as renderer calls.
- Utility
- Stateful Rust implementation hosted in a sandboxed Chromium process.
- Utility
Session - Stateful implementation hosted for one long-lived Utility session.
Type Aliases§
- Application
Result - Result returned by application lifecycle methods.
- Command
Result - Result returned by a binary
ShellAPIcommand. - Utility
Future - Future returned by an asynchronous utility-service invocation.
- Utility
Session Future - Future returned by one Utility session command.