Crates.io | config-types |
lib.rs | config-types |
version | 1.1.0 |
created_at | 2025-03-07 00:11:56.847975+00 |
updated_at | 2025-03-10 12:59:44.770773+00 |
description | A library which provides ergononic types for configuration files |
homepage | |
repository | https://github.com/victornguen/config-types-rs |
max_upload_size | |
id | 1582055 |
size | 25,169 |
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
- hoursByteSizeConf
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