Expand description
Parsing for data types used in git-config files to allow their use from environment variables and other sources.
§Examples
use std::borrow::Cow;
use bstr::ByteSlice;
use gix_config_value::{Boolean, Integer, Path};
let auto_crlf: bool = Boolean::try_from("true".as_bytes().as_bstr()).unwrap().into();
assert!(auto_crlf);
let packed_limit = Integer::try_from("10m".as_bytes().as_bstr()).unwrap();
assert_eq!(packed_limit.to_decimal(), Some(10 * 1024 * 1024));
let ignore_revs = Path::from(Cow::Borrowed(b":(optional)~/.git-blame-ignore-revs".as_bstr()));
assert!(ignore_revs.is_optional);
assert_eq!(ignore_revs.value.as_ref(), b"~/.git-blame-ignore-revs".as_bstr());§Feature Flags
serde— Data structures implementserde::Serializeandserde::Deserialize.
Modules§
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
redorbrightgreen. - Error
- The error returned when any config value couldn’t be instantiated due to malformed input.
- 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.