This is a collection of config types for Rust. It is intended to be used with
See example for usage.
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
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