koi-embedded
Embed local network discovery, DNS, health, and TLS directly in your Rust application.
Overview
koi-embedded lets you embed the full Koi stack — mDNS discovery, DNS
resolution, health monitoring, TLS proxy, certmesh, and UDP bridging — inside
your own Rust application. It provides a Builder for configuration and
returns typed handles (MdnsHandle, DnsHandle, HealthHandle, etc.) for
interacting with each capability, plus a KoiEvent broadcast stream for
reacting to system-wide events.
Usage
use ;
let koi = new
.mode
.build
.await?;
// Register a service
koi.mdns.register.await?;
// Subscribe to events
let mut rx = koi.subscribe;
while let Ok = rx.recv.await
Cargo features (lean builds)
Three heavy, version-locking backends are gated behind default-on features. A default dependency is unchanged; a lean consumer opts out, and re-arms à la carte:
| Feature | Default | Compiles in | Off → fallback |
|---|---|---|---|
docker |
on | bollard Docker/Podman client (=-pinned stubs) |
runtime backend → BackendUnavailable |
keyring |
on | OS keychain / Secret Service / D-Bus | vault uses its passphrase backend |
qr |
on | qrcode + image PNG codec |
enrollment returns the otpauth:// URI text |
# default — everything
= "0.4"
# lean — no bollard, no OS-keychain/D-Bus, no image codec
= { = "0.4", = false }
# à la carte (also: features = ["full"])
= { = "0.4", = false, = ["docker"] }
These are compile-time choices, distinct from the runtime capability toggles on
Builder (which compile everything and just don't start it). See the
embedded guide
and ADR-014.
Part of Koi
This crate is part of the Koi workspace. See the main repository for architecture details and the full crate inventory.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.