Skip to main content

Crate edikt_env

Crate edikt_env 

Source
Expand description

edikt .env / .properties format module.

Flat, string-valued, honest line-level editing only - no grammar, no interpolation, no quoting semantics, no inline comments. key=value / key:value entries, #/! comments, and blanks round-trip byte-for-byte. Paths are a single .key; edits change only the targeted value or line.

Structs§

EditError
A format-preserving edit failure (bad path, wrong type for the operation, unsupported construct).
Env
A parsed .env / .properties document, backed by a lossless CST.
ParseError
A parse failure.

Constants§

COMMENT_KINDS
Comment kinds this format supports (empty => none); the comment capability, subsuming the boolean Feature::Comments. No inline: a # inside a value is data, not a comment.
FEATURES
Capabilities: comments only. Flat and string-valued - no nesting, arrays, typed scalars, or sections.

Functions§

apply
emit
Emit a value as a flat .env: every leaf becomes a key=value line, with nested objects/arrays flattened to dotted keys. Returns the text and warnings. (The comment-free case of emit_commented.)
emit_commented
Emit a commented value as a flat .env: every leaf becomes a key=value line (nesting flattened to dotted keys), head/foot comments as # lines. An inline comment can’t exist here, so it moves to a head line of its own - with a warning, since that is a remap, not a placement.
parse
Parse .env / .properties source into an Env document.