# Module cargo::util::toml::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 🔒

## Functions§

- configure 🔒
- infer_any 🔒
- infer_file 🔒
- infer_from_directory 🔒
- infer_subdirectory 🔒
- inferred_bins 🔒
- inferred_lib 🔒
- inferred_to_toml_targets 🔒
- is_not_dotfile 🔒
- is_resolved 🔒
- legacy_bin_path 🔒
- name_or_panic 🔒
- resolve_benches
- resolve_bins
- resolve_build
  Returns the path to the build script if one exists for this crate.
- resolve_examples
- resolve_lib
- resolve_targets 🔒
- resolve_targets_with_legacy_path 🔒
- resolve_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.