Module targets

Source
Expand description

This module implements Cargo conventions for directory layout:

  • src/lib.rs is a library
  • src/main.rs is a binary
  • src/bin/*.rs are binaries
  • examples/*.rs are examples
  • tests/*.rs are integration tests
  • benches/*.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.