Expand description
warpline-core — a multi-tenant WebAssembly function runtime you embed in your own app.
Hold a Runtime, publish components under
(tenant, function) names and invoke them with
per-call Limits. Guests get a tenant-scoped KvStore, logging and
allowlisted outbound HTTP; CPU (epoch ticks), memory, output size,
per-tenant concurrency and total memory are all capped, and every
invocation that reaches a guest is reported to a MeterSink.
runtime— theRuntimefacade, its config and builder.kv— theKvStoretrait and the in-memoryMemKv.meter—Usageand theMeterSinktrait.pg(featurepostgres, on by default) — schema-isolated migrations, bearer-token auth, tenant admin and a batchingMeterSink. Nothing in this crate reads environment variables or migrates implicitly.types—Limits, name validation and config validators.
For a complete integration (an axum app, a Rust guest, Postgres auth and
metering) see examples/storefront.
Re-exports§
pub use kv::KvError;pub use kv::KvStore;pub use kv::MemKv;pub use meter::MeterSink;pub use meter::Usage;pub use runtime::Invocation;pub use runtime::Runtime;pub use runtime::RuntimeBuilder;pub use runtime::RuntimeConfig;pub use runtime::Staged;pub use types::valid_name;pub use types::ConfigError;pub use types::Limits;pub use wasmtime;
Modules§
- kv
- Per-tenant key/value store abstraction.
- meter
- What a completed invocation cost, and where that gets reported.
- pg
- Everything Postgres: migrations, bearer-token auth, tenant admin and the
batching meter. Behind the
postgresfeature (on by default). - runtime
- The
Runtimefacade: the one type an embedding app holds. - types
- Limits and name validation, plus (crate-private) the per-invocation host
context attached to the wasmtime
Store.
Structs§
- Bytes
- A cheaply cloneable and sliceable chunk of contiguous memory.
Enums§
- Error
- General error for
Runtimeconstruction, GC and module loading. Non-exhaustive. - Invoke
Error - Why
Runtime::invokefailed. Non-exhaustive. - Publish
Error - Why
Runtime::stageorRuntime::activatefailed. Non-exhaustive.
Constants§
- GC_
GRACE_ PERIOD - Default grace period for
Runtime::gc— an hour is comfortably longer than any single upload’s compile-then-persist-then point window could plausibly take, so nothing an in-flight upload has touched in the last hour is ever a GC candidate.
Functions§
- digest
- Hex-encoded SHA-256 of
bytes— the content digestRuntimeidentifies a component by (Staged::digest).