Expand description
This crate is to be used from build.rs
build scripts.
Enums§
- Environment
- Where is this
build.rs
build script running?
Functions§
- cargo_
metadata - Returns info parsed from an invocation of the
cargo metadata
command. - compute_
crate_ hash - Given a crate name, computes the sha256 hash of its source code (ordered by filename) and returns an hexadecimal string for it.
- compute_
dir_ filtered_ hash - Given a directory path, computes the sha256 hash of the accumulated contents of all of its files (ordered by filename) except those failing a custom filter, and returns an hexadecimal string for it.
- compute_
dir_ hash - Given a directory path, computes the sha256 hash of the accumulated contents of all of its files (ordered by filename), and returns an hexadecimal string for it.
- compute_
file_ hash - Given a file path, computes the sha256 hash of its contents and returns an hexadecimal string for it.
- compute_
strings_ hash - Given a bunch of strings, computes the sha256 hash of their contents (in the order they were passed in) and returns an hexadecimal string for it.
- enabled_
features_ of - Returns a list of all the enabled features of the given package.
- export_
build_ info_ vars_ for_ crate - Call from the
build.rs
file of any crate you want to generate build info for. - get_
and_ track_ env_ var - Read the environment variable and trigger a rebuild whenever the environment variable changes.
- git_
branch - Get the current git branch name
- git_
commit_ hash - Get the full commit hash
- git_
commit_ short_ hash - Get the first 7 characters of the commit hash
- is_
tracked_ env_ var_ set - Read the environment variable and trigger a rebuild whenever the environment variable changes.
- iter_
dir - Recursively walks the directory at
path
in filename order. - read_
versioning_ hash - Reads back a versioning hash that was written with
write_versioning_hash
. - rebuild_
if_ crate_ changed - Call from
build.rs
to trigger a rebuild whenever any source file of the given package or any of its dependencies changes, recursively. - rerun_
if_ changed - Call from
build.rs
to trigger a rebuild whenever the file atpath
changes. - rerun_
if_ changed_ glob - Call from
build.rs
to trigger a rebuild whenever any of the files identified by the given globbedpath
change. - rerun_
if_ changed_ or_ doesnt_ exist - Call from
build.rs
to trigger a rebuild whenever the file atpath
changes, or it doesn’t exist. - set_
output_ cargo_ build_ instructions - Change whether or not this library should output cargo build instructions
- write_
file_ if_ necessary - Writes
content
to a file iff it differs from what’s already there. - write_
versioning_ hash - Writes the given
hash
at the specifiedpath
.