Skip to main content

Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }

Implementations§

Source§

impl Builder

Source

pub fn new() -> Self

Source

pub fn data_dir(self, path: impl Into<PathBuf>) -> Self

Source

pub fn service_endpoint(self, endpoint: impl Into<String>) -> Self

Source

pub fn service_mode(self, mode: ServiceMode) -> Self

Source

pub fn http(self, enabled: bool) -> Self

Source

pub fn mdns(self, enabled: bool) -> Self

Source

pub fn dns<F>(self, configure: F) -> Self

Source

pub fn dns_enabled(self, enabled: bool) -> Self

Source

pub fn dns_auto_start(self, enabled: bool) -> Self

Source

pub fn health(self, enabled: bool) -> Self

Source

pub fn health_auto_start(self, enabled: bool) -> Self

Source

pub fn certmesh(self, enabled: bool) -> Self

Source

pub fn proxy(self, enabled: bool) -> Self

Source

pub fn proxy_auto_start(self, enabled: bool) -> Self

Source

pub fn udp(self, enabled: bool) -> Self

Source

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).

Source

pub fn runtime_auto(self) -> Self

Enable the runtime adapter with auto-detection.

Source

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.

Source

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).

Source

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.

Source

pub fn dashboard(self, enabled: bool) -> Self

Source

pub fn api_docs(self, enabled: bool) -> Self

Source

pub fn mdns_browser(self, enabled: bool) -> Self

Source

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).

Source

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).

Source

pub fn events<F>(self, handler: F) -> Self
where F: Fn(KoiEvent) + Send + Sync + 'static,

Source

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.

Source

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)").

Source

pub fn build(self) -> Result<KoiEmbedded>

Trait Implementations§

Source§

impl Default for Builder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more