#
cargo/sources/
mod.rs

    1//! The trait for sources of Cargo packages and its built-in implementations.
    2//!
    3//! A source is a provider that contains source files and metadata of packages.
    4//! It provides a number of methods to fetch those package information, for
    5//! example, querying metadata or downloading files for a package. These
    6//! information then can be used as dependencies for other Cargo packages.
    7//!
    8//! This module provides [`Source`][source::Source] trait as an abstraction of different sources,
    9//! as well as [`SourceMap`][source::SourceMap] struct as a map of all available sources.
    10//!
    11//! Several built-in implementations of `Source` trait are provided. Namely,
    12//!
    13//! * [`RegistrySource`] --- A source that provides an index for people to query
    14//!   a crate's metadata, and fetch files for a certain crate. crates.io falls
    15//!   into this category. So do local registry and sparse registry.
    16//! * [`DirectorySource`] --- Files are downloaded ahead of time. Primarily
    17//!   designed for crates generated from `cargo vendor`.
    18//! * [`GitSource`] --- This gets crate information from a git repository.
    19//! * [`PathSource`] --- This gets crate information from a local path on the
    20//!   filesystem.
    21//! * [`ReplacedSource`] --- This manages the [source replacement] feature,
    22//!   redirecting operations on the original source to the replacement.
    23//!
    24//! This module also contains [`SourceConfigMap`], which is effectively the
    25//! representation of the `[source.*]` value in Cargo configuration.
    26//!
    27//! [source replacement]: https://doc.rust-lang.org/nightly/cargo/reference/source-replacement.html
    28
    29pub use self::config::SourceConfigMap;
    30pub use self::directory::DirectorySource;
    31pub use self::git::GitSource;
    32pub use self::path::PathEntry;
    33pub use self::path::PathSource;
    34pub use self::path::RecursivePathSource;
    35pub use self::registry::{
    36    CRATES_IO_DOMAIN, CRATES_IO_INDEX, CRATES_IO_REGISTRY, IndexSummary, RegistrySource,
    37};
    38pub use self::replaced::ReplacedSource;
    39
    40pub mod config;
    41pub mod directory;
    42pub mod git;
    43pub mod overlay;
    44pub mod path;
    45pub mod registry;
    46pub mod replaced;
    47pub mod source;