Expand description
§scon-core
scon-core is the Rust implementation of SCON, a strict and deterministic
configuration format inspired by HOCON. It provides parsing, sequential
substitution resolution, explicit object and array spread, sandboxed file
includes, formatting, source analysis, and Serde conversion.
The Cargo package is named scon-core; its Rust library name is scon.
§Installation
[dependencies]
scon-core = "0.1"
serde = { version = "1", features = ["derive"] }§Example
use serde::Deserialize;
#[derive(Debug, Deserialize, PartialEq)]
struct App {
name: String,
port: u16,
}
let app: App = scon::from_str(
r#"
name = "demo"
port = 8080
"#,
)?;
assert_eq!(app, App { name: "demo".into(), port: 8080 });Use scon::parse_file or scon::from_file when the document may contain
include directives. scon::parse_str and scon::from_str intentionally do
not provide filesystem access.
SCON v0.1 uses a single sequential resolution model: substitutions are resolved immediately and forward references are rejected. See the SCON v0.1 specification for the complete grammar and semantics.
§Compatibility
- Minimum supported Rust version: 1.85
- License: MIT
Macros§
Structs§
- Analyzed
Document - Comment
- Definition
- Diagnostic
- Diagnostic
Related Information - Error
- File
Source Store - Format
Options - Include
Reference - Limits
- Line
Index - Load
Options - Parse
Options - Parsed
Document - Reference
- Source
Position - Source
Range - Symbol
- Token
- Utf16
Position
Enums§
Constants§
Traits§
Functions§
- analyze_
file - analyze_
file_ with_ store - analyze_
source - diagnostic_
from_ error - format_
source - from_
file - from_
file_ with_ options - from_
str - from_
value - get_
path - parse_
file - parse_
file_ with_ options - parse_
source - parse_
str - resolve_
file - resolve_
source - to_
string - to_
string_ fragment - to_
string_ value - to_
value