#cargo-toml #applications #formatted #details #json

build

JSON formatted application build details provided by the Cargo.toml file

2 releases

Uses old Rust 2015

0.0.2 Dec 1, 2016
0.0.1 Dec 1, 2016

#31 in #formatted

Download history 8/week @ 2024-06-28 16/week @ 2024-07-05 59/week @ 2024-07-12 3/week @ 2024-07-19 11/week @ 2024-07-26 15/week @ 2024-08-02 9/week @ 2024-08-09 4/week @ 2024-08-16 2/week @ 2024-08-23 9/week @ 2024-08-30 9/week @ 2024-09-06 8/week @ 2024-09-13 19/week @ 2024-09-20 34/week @ 2024-09-27 17/week @ 2024-10-04 14/week @ 2024-10-11

85 downloads per month

MIT license

4KB
61 lines

Build

JSON formatted application build details provided by the Cargo.toml file.


Usage

Add the following to your Cargo.toml file (Edit the version if needed.):

build = "*"

Methods
build_as_json() -> String
Returns a JSON response formatted to the 1.1 specification that is in a String format for transit.

Example

extern crate build;

fn main(){
  let details = build::build_as_json();
  println!("{}", details);
}

To see it in action run (I pipe to jq to make it pretty!):

cargo run | jq

TODO

  1. Encapsulate environment request with try! and alternate response structures when some cannot be obtained.
  2. Provide string response for all env request types to Cargo.toml files offer.
  3. ... Suggestions?

Dependencies

~225KB