pub struct Builder { /* private fields */ }Implementations§
Source§impl Builder
impl Builder
pub fn new() -> Self
pub fn data_dir(self, path: impl Into<PathBuf>) -> Self
pub fn service_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn service_mode(self, mode: ServiceMode) -> Self
pub fn http(self, enabled: bool) -> Self
pub fn mdns(self, enabled: bool) -> Self
pub fn dns<F>(self, configure: F) -> Self
pub fn dns_enabled(self, enabled: bool) -> Self
pub fn dns_auto_start(self, enabled: bool) -> Self
pub fn health(self, enabled: bool) -> Self
pub fn health_auto_start(self, enabled: bool) -> Self
pub fn certmesh(self, enabled: bool) -> Self
pub fn proxy(self, enabled: bool) -> Self
pub fn proxy_auto_start(self, enabled: bool) -> Self
pub fn udp(self, enabled: bool) -> Self
Sourcepub fn runtime(self, kind: RuntimeBackendKind) -> Self
pub fn runtime(self, kind: RuntimeBackendKind) -> Self
Enable the runtime adapter with the specified backend kind.
Runtime is opt-in for embedded (unlike daemon where capabilities are enabled by default).
Sourcepub fn runtime_auto(self) -> Self
pub fn runtime_auto(self) -> Self
Enable the runtime adapter with auto-detection.
Sourcepub fn orchestrator(self, enabled: bool) -> Self
pub fn orchestrator(self, enabled: bool) -> Self
Translate discovered runtime (container) lifecycle events into mDNS/DNS/health/proxy
entries — the same orchestrator the daemon runs. Opt-in; requires the runtime
adapter (runtime/runtime_auto) to be enabled to have any effect.
Sourcepub fn certmesh_background(self, enabled: bool) -> Self
pub fn certmesh_background(self, enabled: bool) -> Self
Run the certmesh role-driven background loop (trust-bundle pull — policy refresh +
revocation detection — plus cert renewal) — the same loop the daemon runs. Opt-in;
requires certmesh (certmesh) to be enabled. A clustered embedded CA host wants
this; a leaf does not. Enrollment approval auto-denies (no interactive console).
Sourcepub fn http_port(self, port: u16) -> Self
pub fn http_port(self, port: u16) -> Self
Set the embedded HTTP adapter’s port. Pass 0 to bind an OS-assigned
ephemeral port and read the actual one back with
KoiHandle::bound_http_port after start — the
supported way to run on a free port without racing to pick one.
pub fn dashboard(self, enabled: bool) -> Self
pub fn api_docs(self, enabled: bool) -> Self
pub fn mdns_browser(self, enabled: bool) -> Self
Sourcepub fn announce_http(self, enabled: bool) -> Self
pub fn announce_http(self, enabled: bool) -> Self
Advertise this host’s _http._tcp record on the LAN so peers discover it. Because
the advertised endpoint must be reachable, enabling this binds the embedded HTTP
adapter to 0.0.0.0 (all interfaces) instead of the secure loopback default.
Strongly pair with http_token — otherwise mutations are
unauthenticated to the whole LAN (a runtime warning is logged if you do not).
Sourcepub fn http_token(self, token: impl Into<String>) -> Self
pub fn http_token(self, token: impl Into<String>) -> Self
Require an x-koi-token header for embedded HTTP mutations (parity with the
daemon’s DAT). Optional: by default the embedded HTTP adapter binds loopback and
leaves mutations unauthenticated. Set a token when exposing the adapter to the LAN
(see announce_http).
pub fn events<F>(self, handler: F) -> Self
Sourcepub fn extra_firewall_ports(self, ports: Vec<FirewallPort>) -> Self
pub fn extra_firewall_ports(self, ports: Vec<FirewallPort>) -> Self
Register additional firewall ports that the host application needs
opened (e.g. an application’s discovery UDP, HTTP API). These are merged with
the ports from enabled Koi capabilities when ensure_firewall_rules
is called.
Sourcepub fn ensure_firewall_rules(self, prefix: &str) -> Self
pub fn ensure_firewall_rules(self, prefix: &str) -> Self
Best-effort ensure that Windows Firewall inbound-allow rules exist for every port required by the enabled capabilities plus any extra ports registered by the host application.
- Idempotent — safe to call on every startup.
- Non-fatal — logs warnings but never fails the build.
- No-op on non-Windows platforms.
prefix is used in the firewall rule display-names
(e.g. "My App" → "My App mDNS (UDP 5353)").
pub fn build(self) -> Result<KoiEmbedded>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Builder
impl !UnwindSafe for Builder
impl Freeze for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more