Skip to main content

Crate leach

Crate leach 

Source
Expand description

Build script utilities for CMake FFI and cross-compilation.

This crate provides convenience wrappers over Cargo build script environment variables, plus CMake integration for C/C++ FFI bindings.

Re-exports§

pub use ::bindgen;
pub use filetime;
pub use regex;
pub use semver;
pub use walkdir;

Modules§

bgx
Build configuration and FFI binding generation for C/C++ projects. Provides BindgenConfig for header parsing and code generation via bindgen.
bin
Toolchain binary locations (cargo, rustc, rustdoc).
cargo
Cargo package environment info: features, manifest, package metadata, and leach-specific build-directory helpers.
cmkabe
CMake build integration helpers. Provides CMake configuration, compilation, and installation utilities.
env
Inspection and manipulation of the process’s environment.
fs
Filesystem manipulation operations.
io
Traits, helpers, and type definitions for core I/O functionality.
metadata
Inter-dependency metadata communication between build scripts.
rustc
Functions for emitting rustc instruction metadata back to Cargo.
target
Target platform information (endianness, pointer width, triple).

Macros§

env
Inspects an environment variable at compile time.
warning
Instructs Cargo to display a warning.

Structs§

DirEntry
A directory entry.
FileTime
A helper structure to represent a timestamp for a file.
HashSet
A hash set implemented as a HashMap where the value is ().
InvalidInput
Error type indicating a string parse failed due to invalid input.
Path
A slice of a path (akin to str).
PathBuf
An owned, mutable path (akin to String).
RefCell
A mutable memory location with dynamically checked borrow rules
Regex
A compiled regular expression for searching Unicode haystacks.
RegexSet
Match multiple, possibly overlapping, regexes in a single search.
Triple
Platform triple (e.g. x86_64-unknown-linux-gnu).
WalkDir
A builder to create an iterator for recursively walking a directory.

Enums§

Atomic
Represents an atomic type supported by a target.
Endianness
Represents the target platform’s endianness.
LibKind
Library linkage kind.
Profile
A build profile.
SearchKind
Library search path kind.

Traits§

BufRead
A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.
Write
A trait for objects which are byte-oriented sinks.

Functions§

canon_feature_name
Converts a name to the canonical environment-variable format: upper-case, with hyphens replaced by underscores.
debug
Whether this is a debug build.
error
Instructs Cargo to display an error and fail the build.
host
Host platform triple.
is_primary_package
Whether the current package is the primary target being compiled.
num_jobs
Number of top-level parallel jobs.
opt_level
Optimisation level (e.g. 0, 1, 2, 3, s, z).
out_dir
Output directory for build script artifacts (OUT_DIR).
profile
Build profile (Debug or Release).
realpath
Resolves a path to its canonical (real) form if it exists, stripping the \\?\ prefix on Windows. Returns the original path if canonicalization fails.
rerun_if_changed
Instructs Cargo to rerun the build script if the given file/directory changes.
rerun_if_env_changed
Instructs Cargo to rerun the build script if the given environment variable changes.
target_tmpdir
Temporary directory for the current build target (CARGO_TARGET_TMPDIR).
touch
Updates the timestamps of the specified files.
unix
Whether the target platform is UNIX.
warning
Instructs Cargo to display a warning message.
watch_file_changes
Watch file changes in the specified directory and triggers rebuilds when matching files change.
windows
Whether the target platform is Windows.