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.