Omnia SDK
Shared traits, error types, and abstractions for building WASI guest components. This crate provides the glue between your business logic and the Omnia runtime capabilities.
Quick Start
Use the guest! macro to define your component's API surface. This wires up the necessary WASI exports and routing logic.
use ;
use ;
// Define your data models
// Define the provider (capabilities your app needs)
;
// Wire up the application
guest!;
// Implement the handler for the request
Capabilities
The SDK exposes trait-based abstractions for host capabilities. When compiled to wasm32, these delegate to WASI host calls.
| Trait | Purpose |
|---|---|
Config |
Read configuration values from the host. |
HttpRequest |
Make outbound HTTP requests. |
Publish |
Publish messages to a topic. |
StateStore |
Get/set/delete key-value state with optional TTL. |
Identity |
Obtain access tokens from an identity provider. |
TableStore |
Execute SQL queries and statements via the ORM layer. |
Broadcast |
Send events over WebSocket channels. |
Example: Using Capabilities
use ;
async
Error Handling
The crate provides an Error enum with HTTP-aware variants (BadRequest, NotFound, ServerError, BadGateway) and helper macros for ergonomic error creation.
use ;
Architecture
See the workspace documentation for the full architecture guide.
License
MIT OR Apache-2.0