Crate tuffite

Crate tuffite 

Source
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§

ApplicationError
Failure while creating or shutting down an application.
BrowserContext
Immutable startup data supplied when one browser instance is created.
Bytes
Owned binary value corresponding to TypeScript Uint8Array.
ChromiumExecutor
Cloneable, thread-safe handle to Chromium’s process-wide thread pool.
ChromiumTask
Awaitable result of one finite closure scheduled on Chromium’s thread pool.
Command
One decoded binary ShellAPI command borrowed for the duration of dispatch.
CommandDescriptor
Generated metadata for one application ShellAPI endpoint.
EventEmitter
Cloneable, thread-safe handle for broadcasting named binary events.
JavaScriptExtensionHost
Cloneable trusted entrypoint for restricted JavaScript extension sessions.
JavaScriptExtensionPackage
Complete immutable ECMAScript module graph supplied by trusted Rust code.
JavaScriptExtensionSessionHandle
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.
ShellApiHost
Thread-safe native application client for generated Shell API requests.
TaskContext
Context passed to one supervised task.
TaskHandle
Public pointer-free identity of a supervised Runtime task.
Timestamp
UTC milliseconds since the Unix epoch, corresponding to TypeScript Date.
UtilityContext
Immutable service startup data owned by the Utility child process.
UtilityRequest
Owned input and cooperative lifecycle controls for one utility invocation.
UtilityServiceRegistration
Static registration for an application-defined utility service.
UtilitySessionClosed
Terminal state delivered exactly once when a Utility session closes.
UtilitySessionCommand
One command delivered to a live Utility session.
UtilitySessionEmitter
Cloneable, credit-controlled event emitter supplied to a Utility session.
UtilitySessionEvent
One ordered semantic event emitted by a long-lived Utility session.
UtilitySessionFlowControl
Producer-side credit and sequence state for one Utility session.
UtilitySessionHandle
Opaque main-Runtime handle for one supervised Utility session.
UtilitySessionHost
Cloneable entrypoint for creating long-lived Utility sessions.
UtilitySessionOptions
Session limits negotiated before the Utility process receives extension code.
UtilitySessionRequest
Immutable initialization data supplied when creating one Utility session.
V8Context
Browser-process environment for one named V8 resource provider.

Enums§

ChromiumTaskError
Failure reported by an awaited Chromium task.
CommandError
ExecutorError
Failure while submitting work to Chromium.
HandleKind
Stable object categories encoded into RawHandle.
JavaScriptExtensionError
Error detected while constructing or invoking a restricted extension realm.
RuntimeError
Errors produced by Runtime lifecycle and task operations.
RuntimeState
Observable Runtime lifecycle states.
ShellApiError
TaskPriority
Scheduling priority forwarded to Chromium.
UtilitySessionFlowError
Protocol errors detected before an event reaches Mojo or application code.
UtilitySessionHostError
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.
ShellApiRequest
Generated endpoint request with the same argument/result codecs as renderer calls.
Utility
Stateful Rust implementation hosted in a sandboxed Chromium process.
UtilitySession
Stateful implementation hosted for one long-lived Utility session.

Type Aliases§

ApplicationResult
Result returned by application lifecycle methods.
CommandResult
Result returned by a binary ShellAPI command.
UtilityFuture
Future returned by an asynchronous utility-service invocation.
UtilitySessionFuture
Future returned by one Utility session command.

Attribute Macros§

browser
Declares the browser backend selected by the main attribute.
command
Marks one synchronous Rust function as a generated ShellAPI handler.
main
Declares the logical application main and its explicit process implementations.
utility
Declares a named Rust or V8 utility by its implementation trait.