Struct cargo::core::source::SourceId
[−]
[src]
pub struct SourceId { /* fields omitted */ }
Unique identifier for a source of packages.
Methods
impl SourceId
[src]
fn from_url(string: &str) -> CargoResult<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");
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_local_registry(path: &Path) -> CargoResult<SourceId>
fn for_directory(path: &Path) -> CargoResult<SourceId>
fn crates_io(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.
fn precise(&self) -> Option<&str>
fn git_reference(&self) -> Option<&GitReference>
fn with_precise(&self, v: Option<String>) -> SourceId
fn is_default_registry(&self) -> bool
Trait Implementations
impl Clone for SourceId
[src]
fn clone(&self) -> SourceId
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for SourceId
[src]
impl Debug for SourceId
[src]
impl PartialEq for SourceId
[src]
fn eq(&self, other: &SourceId) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd for SourceId
[src]
fn partial_cmp(&self, other: &SourceId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for SourceId
[src]
fn cmp(&self, other: &SourceId) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl Encodable for SourceId
[src]
impl Decodable for SourceId
[src]
impl Display for SourceId
[src]
impl Hash for SourceId
[src]
fn hash<S: Hasher>(&self, into: &mut S)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.