catconf 0.1.2

Allows for reading from the executing binary in order to pull configuration
Documentation
  • Coverage
  • 100%
    9 out of 9 items documented9 out of 9 items with examples
  • Size
  • Source code size: 45.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 419.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • r-a303931

Catconf

For when you want:

  1. Runtime configuration for after the binary is compiled
  2. A single file binary

This library allows for taking the final result binary, and just concatenating the configuration to the end:

cat target/debug/binary <(echo -n "CATCONF") conf > confedbinary

Great, but how to get the configuration back out and use it in the code? catconf!

It’s use is pretty simple:

use catconf::ConfReaderOptions;

let conf_reader = ConfReaderOptions::new(b"CATCONF".to_vec()).read_from_exe()?;

This returns a Vec<u8> which can be transformed further, by converting to UTF-8 and combined with Serde, decompressing with zlib, etc.