Crate hcl_edit

Source
Expand description

§hcl-edit

Build Status crates.io docs.rs License: Apache 2.0 License: MIT

Parse and modify HCL documents while preserving whitespace and comments. This crate is to HCL what toml_edit is to TOML. In fact, its API is heavily inspired by toml_edit.

§Notice

The documentation as well as usage examples are scarce. There’s still a lot of planned functionality missing and some APIs might even be cumbersome to use at the moment.

This will improve over time as this project evolves.

Expect breaking changes at any time until the biggest issues are fleshed out.

§HCL document traversal

The visit module allows traversal of language items within a HCL document. Mutable document traversal is supported via the visit_mut module.

See the respective module’s documentation for more.

§Contributing

Contributions are welcome! Please read CONTRIBUTING.md before creating a PR.

§License

The source code of hcl-edit is licensed under either of Apache License, Version 2.0 or MIT license at your option.

Modules§

expr
Types to represent the HCL expression sub-language.
parser
An HCL parser which keeps track of whitespace, comments and span information.
prelude
Core concepts available for glob import.
structure
Types to represent the HCL structural sub-language.
template
Types to represent the HCL template sub-language.
visit
HCL language item traversal.
visit_mut
Mutable HCL language item traversal.

Structs§

Decor
Represents the whitespace and comments before (the “prefix”) or after (the “suffix”) a HCL value.
Decorated
A wrapper type for attaching a Decor and span information to a value.
Formatted
A wrapper type for a value together with its ToString representation with additional Decor and span infromation attached.
Ident
Represents an HCL identifier.
Number
Represents an HCL number.
RawString
Opaque string storage for raw HCL.
Spanned
A wrapper type for attaching span information to a value.

Traits§

Decorate
A trait for objects which can be decorated with whitespace and comments.
Span
A trait for objects which carry span information.