Skip to main content

Crate gix_config_value

Crate gix_config_value 

Source
Expand description

Parsing for data types used in git-config files to allow their use from environment variables and other sources.

§Examples

use bstr::ByteSlice;
use gix_config_value::{Boolean, Integer, Path};

let auto_crlf: bool = Boolean::try_from("true")?.into();
assert!(auto_crlf);

let packed_limit: usize = Integer::from_bytes("10m")?;
assert_eq!(packed_limit, 10 * 1024 * 1024);

let ignore_revs = Path::from(":(optional)~/.git-blame-ignore-revs");
assert!(ignore_revs.is_optional);
assert_eq!(ignore_revs.value.as_bstr(), "~/.git-blame-ignore-revs");

§Feature Flags

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

Modules§

color
Color value parsing and the supported color names and attributes.
integer
Integer suffix parsing and conversion support.
path
Path interpolation support.

Structs§

Boolean
Any value that can be interpreted as a boolean. Conversion errors expose invalid input bytes as metadata.
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.
Integer
Any value that can be interpreted as an integer.
Path
Any value that can be interpreted as a path to a resource on disk.