3 releases (stable)
new 1.1.0 | Mar 10, 2025 |
---|---|
1.0.0 | Mar 7, 2025 |
0.1.0 | Mar 7, 2025 |
#246 in Configuration
356 downloads per month
13KB
282 lines
Config types for rust
This is a collection of config types for Rust. It is intended to be used with
Usage
See example for usage.
DurationConf
DurationConf
is a wrapper around std::time::Duration
that allows you to specify duration in human readable format in your config.
For example, you can specify duration in your config file like this:
duration = "5m"
Supported suffixes(case insensitive):
ns
- nanosecondsus
- microsecondsms
- millisecondss
- secondsm
- minutesh
- hours
ByteSizeConf
ByteSizeConf
allows you to specify byte size in your config.
For example, if you want to specify max file size in your config file, you can do it like this:
max_file_size = "10Mi"
Supported suffixes(case insensitive):
B
- bytesKi
- kibibytesKb
- kilobytesMi
- mebibytesMb
- megabytesGi
- gibibytesGb
- gigabytesTi
- tebibytesTb
- terabytes
Dependencies
~2.4–4MB
~74K SLoC