Skip to main content

init

Function init 

Source
pub fn init() -> Result<(), KeelError>
Expand description

Initialize Keel from <current_dir>/keel.toml (or Level 0 defaults if absent). Idempotent — a second call is a no-op (mirrors python/keel’s/node/keel’s idempotent install_keel/installKeel).

Call this once from your own main before the first #[keel::wrap]’d call or KeelMiddleware use, so a malformed keel.toml fails your startup loudly. If you never call it, the first wrapped call/middleware invocation initializes lazily from the same file — but a load/parse failure at that point silently degrades to Level 0 defaults instead of surfacing a KeelError, since there is no caller left to hand the error to by then.

§Errors

KEEL-E001 if keel.toml is present but unreadable or not valid TOML, or if the policy it describes fails schema validation.