# Module cargo::sources

source ·
Expand description

Implementations of `Source` trait.

Cargo provides several built-in implementations of `Source` trait. Namely,

- `RegistrySource` — A source that provides an index for people to query a crate’s metadata, and fetch files for a certain crate. crates.io falls into this category. So do local registry and sparse registry.
- `DirectorySource` — Files are downloaded ahead of time. Primarily designed for crates generated from `cargo vendor`.
- `GitSource` — This gets crate information from a git repository.
- `PathSource` — This gets crate information from a local path on the filesystem.
- `ReplacedSource` — This manages the source replacement feature, redirecting operations on the original source to the replacement.

This module also contains `SourceConfigMap`, which is effectively the representation of the `[source.*]` value in Cargo configuration.

## Re-exports

- `pub use self::config::SourceConfigMap;`
- `pub use self::directory::DirectorySource;`
- `pub use self::git::GitSource;`
- `pub use self::path::PathSource;`
- `pub use self::registry::RegistrySource;`
- `pub use self::registry::CRATES_IO_DOMAIN;`
- `pub use self::registry::CRATES_IO_INDEX;`
- `pub use self::registry::CRATES_IO_REGISTRY;`
- `pub use self::replaced::ReplacedSource;`

## Modules

- config
  Implementation of configuration for various sources.
- directory
- git
- path
- registry
  A `Source` for registry-based packages.
- replaced