Expand description
This module implements Cargo conventions for directory layout:
src/lib.rs
is a librarysrc/main.rs
is a binarysrc/bin/*.rs
are binariesexamples/*.rs
are examplestests/*.rs
are integration testsbenches/*.rs
are benchmarks
It is a bit tricky because we need match explicit information from Cargo.toml
with implicit info in directory layout.
Constantsยง
- DEFAULT_
BENCH_ ๐DIR_ NAME - DEFAULT_
EXAMPLE_ ๐DIR_ NAME - DEFAULT_
TEST_ ๐DIR_ NAME - TARGET_
KIND_ ๐BENCH - TARGET_
KIND_ ๐BIN - TARGET_
KIND_ ๐EXAMPLE - TARGET_
KIND_ ๐HUMAN_ BENCH - TARGET_
KIND_ ๐HUMAN_ BIN - TARGET_
KIND_ ๐HUMAN_ EXAMPLE - TARGET_
KIND_ ๐HUMAN_ LIB - TARGET_
KIND_ ๐HUMAN_ TEST - TARGET_
KIND_ ๐LIB - TARGET_
KIND_ ๐TEST
Functionsยง
- are_
normalized ๐ - are_
normalized_ ๐ - configure ๐
- infer_
any ๐ - infer_
file ๐ - infer_
from_ ๐directory - infer_
subdirectory ๐ - inferred_
bins ๐ - inferred_
lib ๐ - inferred_
to_ ๐toml_ targets - is_
normalized ๐ - is_
not_ ๐dotfile - legacy_
bin_ ๐path - name_
or_ ๐panic - normalize_
benches - normalize_
bins - normalize_
build - Returns the path to the build script if one exists for this crate.
- normalize_
examples - normalize_
lib - normalize_
targets ๐ - normalize_
targets_ ๐with_ legacy_ path - normalize_
tests - target_
path ๐ - target_
path_ ๐not_ found_ error_ message - Build an error message for a target path that cannot be determined either by auto-discovery or specifying.
- to_
bench_ ๐targets - to_
bin_ ๐targets - to_
example_ ๐targets - to_
lib_ ๐target - to_
targets ๐ - to_
test_ ๐targets - toml_
targets_ ๐and_ inferred - validate_
bin_ ๐crate_ types - validate_
bin_ ๐name - validate_
bin_ ๐proc_ macro - validate_
crate_ ๐types - validate_
lib_ ๐name - validate_
proc_ ๐macro - validate_
target_ ๐name - validate_
unique_ ๐names - Will check a list of toml targets, and make sure the target names are unique within a vector.