# Module cargo::util

source ·

## Re-exports

- `pub use self::config::homedir;`
- `pub use self::config::Config;`
- `pub use self::config::ConfigValue;`
- `pub use self::diagnostic_server::RustfixDiagnosticServer;`
- `pub use self::edit_distance::closest;`
- `pub use self::edit_distance::closest_msg;`
- `pub use self::edit_distance::edit_distance;`
- `pub use self::errors::CliError;`
- `pub use self::errors::internal;`
- `pub use self::errors::CargoResult;`
- `pub use self::errors::CliResult;`
- `pub use self::graph::Graph;`
- `pub use self::hex::hash_u64;`
- `pub use self::hex::short_hash;`
- `pub use self::hex::to_hex;`
- `pub use self::into_url::IntoUrl;`
- `pub use self::restricted_names::validate_package_name;`
- `pub use self::rustc::Rustc;`
- `pub use self::to_semver::ToSemver;`

## Modules

- auth
  Registry authentication support.
- canonical_url 🔒
- command_prelude
- config
  Cargo’s config system.
- counter 🔒
- cpu
- credential
  Built-in Cargo credential providers
- dependency_queue 🔒
  A graph-like structure used to represent a set of dependencies and in what order they should be built.
- diagnostic_server
  A small TCP server to handle collection of diagnostics information in a cross-platform way for the `cargo fix` command.
- edit_distance
- errors
- flock 🔒
- graph
- hasher 🔒
  Implementation of a hasher that produces the same values across releases.
- hex
- important_paths
- interning
- into_url
- into_url_with_base 🔒
- io 🔒
- job
  Job management (mostly for windows)
- lockserver 🔒
  An implementation of IPC locks, guaranteed to be released if a process dies
- machine_message
- network
  Utilities for networking.
- profile
  An internal performance profiler for Cargo itself.
- progress 🔒
  Support for CLI progress bars.
- queue 🔒
- restricted_names
  Helpers for validating and checking names like package and crate names.
- rustc
- semver_ext 🔒
- to_semver
- toml
- toml_mut
  Utilities for in-place editing of Cargo.toml manifests.
- vcs 🔒
- workspace 🔒

## Structs

- CanonicalUrl
  A newtype wrapper around `Url` which represents a “canonical” version of an original URL.
- DependencyQueue
- FileLock
- Filesystem
  A “filesystem” is intended to be a globally shared, hence locked, resource in Cargo.
- FossilRepo
- GitRepo
- HgRepo
- LockServer
- LockServerClient
- LockServerStarted
- PijulRepo
- Progress
  CLI progress bar.
- Queue
  A simple, threadsafe, queue of items of type `T`
- StableHasher

## Enums

- OptVersionReq
- ProgressStyle
  Indicates the style of information for displaying the amount of progress.

## Traits

- IntoUrlWithBase
  A type that can be interpreted as a relative Url and converted to a Url.
- VersionExt
- VersionReqExt

## Functions

- add_path_args
- elapsed
- existing_vcs_repo
- get_umask
  Get the current `umask` value.
- human_readable_bytes
  Formats a number of bytes into a human readable SI-prefixed size. Returns a tuple of `(quantity, units)`.
- indented_lines
- iter_join
- iter_join_onto
- path_args
  The path that we pass to rustc is actually fairly important because it will show up in error messages (important for readability), debug information (important for caching), etc. As a result we need to be pretty careful how we actually invoke rustc.
- print_available_benches
- print_available_binaries
- print_available_examples
- print_available_packages
- print_available_tests
- truncate_with_ellipsis
- try_canonicalize