Expand description
Facade crate re-exporting the kardia crates.
Re-exports§
pub use kardia_fs as fs;pub use kardia_hmr as hmr;pub use kardia_http as http;pub use kardia_include as include;pub use kardia_loader as loader;pub use kardia_logger_console as logger_console;pub use kardia_server as server;pub use kardia_server_acl as server_acl;pub use kardia_server_echo as server_echo;pub use kardia_server_proxy as server_proxy;pub use kardia_server_static as server_static;pub use kardia_timer as timer;
Modules§
- index
- Positions within a dependency tuple (inferred, never written by hand).
- prelude
- The names most plugins need.
Macros§
- json
- Construct a
serde_json::Valuefrom a JSON literal.
Structs§
- Aggregate
Error - Several independent failures, e.g. of the listeners of a parallel event.
- Config
Committed - A fiber’s configuration was replaced through
update(write-back point). - Context
- A cheap, clonable handle to a position in the runtime: a root, the fiber that owns effects created through it, and its derivation scope (isolation and interception overlays).
- Disposal
- The completion of a disposal. Disposal makes progress without being
polled: the synchronous part has already run, and any asynchronous rest
runs as a spawned task, so dropping a
Disposaldoes not cancel it. - Disposer
- The inverse of an effect. Runs at most once (it is consumed).
- Effect
Handle - A non-owning handle to an effect. Dropping it does not dispose the effect: its lifetime is governed by the fiber it was registered on.
- Effect
Meta - Introspection of an effect: its label and the effects it adopted.
- Effect
Scope - The collector handed to an effect body.
- Error
- A cheaply clonable, type-erased error.
- Failure
- A failure notification delivered outside runtime locks.
- Fiber
- A handle to a fiber (one instantiation of a plugin).
- FiberId
- The paper’s fiber name; never reused within a root.
0is the root. - IdTable
- An insertion-ordered registry addressed by never-reused ids.
- ImplId
- Identity of one provider binding; never reused, so “replaced by an equal value” is observable.
- Inject
- Declared dependencies: ordered keys, each with optional interception metadata.
- Injected
- A plugin context whose typed accesses are checked against its declared
dependencies
Dat compile time:get::<S>()only compiles ifSis inD. - Interrupted
- Returned by an iteration boundary whose effect (or fiber load) has been
superseded. Propagating it with
?is not a failure: what was collected so far is disposed normally. - Issue
- One validation problem, located by its path inside the configuration.
- Key
- Name of a coeffect (service), e.g.
"database"or"foo.bar". - Logger
- A named logger bound to the fiber it was created for.
- Message
- Overlay
- Mutable isolation and interception tables of a derived context.
- Panicked
- Plugin
Def - A type-erased plugin definition, as stored in the registry.
- Plugin
Inserted - A fiber was created (
internal/pluginon insertion). - Plugin
Removed - A fiber was retired (
internal/pluginon removal). - RealmId
- A realm (the paper’s isolation symbol). Realms are generative: every call
to
RealmId::newyields a fresh one, shared only by explicit reuse. - Registry
- Registry operations of a root.
- Replaced
- A fiber was moved to another plugin implementation by
registry.replace. - Service
Changed - A binding of
keyinrealmappeared or disappeared. Delivered only to listeners whose context resolveskeyto the same realm. - Status
Changed - Svc
- An accessed service together with the context that accessed it.
- Validation
Error - A rejected configuration (the analogue of Standard Schema issues).
Enums§
- Access
Error - Fiber
State - The paper’s θ.
- Kardia
Error - Level
- Path
Segment - Recovery
Action - The host’s decision after observing a failed, fully cleaned-up instance.
- Recovery
Policy - Failure isolation is independent of this policy. The default never retries.
- Runtime
Key - Identity of a plugin in the registry: the plugin type, or the identity of a closure-based definition.
- Value
- Represents any valid JSON value.
Traits§
- Bailable
- Listener results that can stop a
bail/serialdispatch. - Deps
- A tuple of service types declared and accessed together:
type Inject = (Database, Cache)→ctx.deps::<(Database, Cache)>()?. - Event
- A typed event. Listeners are registered per event type.
- Exporter
- A log sink. Registering one is an effect of the registering fiber.
- Has
DcontainsS(at positionI).- Plugin
- A statically typed plugin (the paper’s component (d, p, e)).
- Service
- A service type bound to its coeffect key.
Functions§
- catalog
- A catalog with every built-in plugin, under its own name and the name of the corresponding JavaScript package.
- decode
- Deserializes a configuration value into
T, reporting the failing path. - hyphenate
fooBar→foo-bar,Qux→qux,snake_case→snake-case.- merge_
shallow - Merges JSON objects key by key, later values winning (like
Object.assign).
Type Aliases§
- Check
- An availability predicate of a binding, given the consumer’s
interception metadata for the key (declared
injectmetadata first). - Config
Hook - A configuration resolution hook: receives the source configuration and the next stage (ultimately the plugin’s own decoding).
- Erased
Config - A decoded, type-erased plugin configuration.
- Result
- Settle
- Resolves when a fiber has no transition in flight, with its failure if any.
Attribute Macros§
- plugin
#[derive(Service)]and#[plugin]; with this crate, passcrate = ::kardia.#[plugin(name = "...", provide = ["key"], crate = path)]onasync fn f(ctx: Context | Injected<(A, ..)>, config: Arc<Config>) -> Result<()>(the config parameter is optional) generates the plugin typeF.
Derive Macros§
- Service
#[derive(Service)]and#[plugin]; with this crate, passcrate = ::kardia.#[derive(Service)], with#[service(name = "...", crate = path)].