Struct cargo::core::source::SourceId
[−]
[src]
pub struct SourceId { // some fields omitted }
Unique identifier for a source of packages.
Methods
impl SourceId
fn from_url(string: String) -> SourceId
Parses a source URL and returns the corresponding ID.
Example
use cargo::core::SourceId; SourceId::from_url("git+https://github.com/alexcrichton/\ libssh2-static-sys#80e71a3021618eb05\ 656c58fb7c5ef5f12bc747f".to_string());
fn to_url(&self) -> String
fn for_path(path: &Path) -> CargoResult<SourceId>
fn for_git(url: &Url, reference: GitReference) -> SourceId
fn for_registry(url: &Url) -> SourceId
fn for_central(config: &Config) -> CargoResult<SourceId>
Returns the SourceId
corresponding to the main repository.
This is the main cargo registry by default, but it can be overridden in
a .cargo/config
.
fn url(&self) -> &Url
fn is_path(&self) -> bool
fn is_registry(&self) -> bool
fn is_git(&self) -> bool
fn load<'a>(&self, config: &'a Config) -> Box<Source + 'a>
Creates an implementation of Source
corresponding to this ID.