#[non_exhaustive]pub enum Format {
Show 13 variants
Json,
Jsonc,
Json5,
Yaml,
Toml,
Zon,
Fig,
Ini,
Dotenv,
Properties,
Plist,
Nestedtext,
Runtime(RuntimeFormat),
}Expand description
A config format. Every variant parses, edits, and serializes.
Every variant is always present in the enum, but each format is gated by a
crate feature of the same name (json, yaml, toml, zon, fig).
Every format the core registers. json, yaml, toml, fig, ini,
dotenv, properties and nestedtext are on by default; zon and
plist are opt-in features. Disabling a feature compiles that format out
of the bundled native library, so selecting it then fails with
Error::UnsupportedFormat at runtime. Json/Jsonc/Json5 share one
core behind the json feature.
#[non_exhaustive]: the core gains formats over time, so a match needs a
_ arm. Constructing a variant is unaffected.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Json
Jsonc
Json5
Yaml
Toml
Zon
Fig
The native fig authoring dialect (see src/languages/fig/DESIGN.md
in the core repo) — a memorable, typeable surface over the same AST.
Ini
INI ([section] + key = value). Untyped-string scalars: port = 8080
reads back as the string "8080". A root mapping and one level of
[section] nesting only.
Dotenv
dotenv / .env (flat KEY=value). A flat string map: no nesting,
untyped scalars.
Properties
Java .properties (flat key=value). Same flat, untyped limits as
Format::Dotenv.
Plist
Apple XML property list. Typed and nested (dict/array/string/integer/
real/bool, with date/data on the extended scalar). Opt-in: the plist
feature.
Nestedtext
NestedText (https://nestedtext.org). Nested (dict/list) but deliberately untyped — every leaf is a string.
Runtime(RuntimeFormat)
A language registered at runtime through language::register —
the value that call returns, a peer of every variant above at every
entry point that takes a Format. Its integer is assigned per
process: persist the name and resolve it with Format::by_name.
Implementations§
Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.