Crate gix_config

Source
Expand description

§gix_config

This crate is a high performance git-config file reader and writer. It exposes a high level API to parse, read, and write git-config files.

This crate has a few primary offerings and various accessory functions. The table below gives a brief explanation of all offerings, loosely in order from the highest to lowest abstraction.

OfferingDescriptionZero-copy?
FileAccelerated wrapper for reading and writing values.On some reads1
parse::StateSyntactic events for git-config files.Yes
value wrappersWrappers for git-config value types.Yes

This crate also exposes efficient value normalization which unescapes characters and removes quotes through the normalize_* family of functions, located in the value module.

§Known differences to the git config specification

  • Legacy headers like [section.subsection] are supposed to be turned into to lower case and compared case-sensitively. We keep its case and compare case-insensitively.

§Feature Flags

  • serde — Data structures implement serde::Serialize and serde::Deserialize.

  1. When read values do not need normalization and it wasn’t parsed in ‘owned’ mode. 

Modules§

color
file
A high level wrapper around a single or multiple git-config file, for reading and mutation.
integer
lookup
parse
This module handles parsing a git-config file. Generally speaking, you want to use a higher abstraction such as File unless you have some explicit reason to work with events instead.
path
source
value

Structs§

Boolean
Any value that can be interpreted as a boolean.
Color
Any value that may contain a foreground color, background color, a collection of color (text) modifiers, or a combination of any of the aforementioned values, like red or brightgreen.
File
High level git-config reader and writer.
Integer
Any value that can be interpreted as an integer.
KeyRef
An unvalidated parse result of parsing input like remote.origin.url or core.bare.
Path
Any value that can be interpreted as a path to a resource on disk.

Enums§

Source
A list of known sources for git configuration in order of ascending precedence.

Traits§

AsKey
Parse parts of a Git configuration key, like remote.origin.url or core.bare.