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>
[src]
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) -> SourceIdToUrl
[src]
fn for_path(path: &Path) -> CargoResult<SourceId>
[src]
fn for_git(url: &Url, reference: GitReference) -> CargoResult<SourceId>
[src]
fn for_registry(url: &Url) -> CargoResult<SourceId>
[src]
fn for_local_registry(path: &Path) -> CargoResult<SourceId>
[src]
fn for_directory(path: &Path) -> CargoResult<SourceId>
[src]
fn crates_io(config: &Config) -> CargoResult<SourceId>
[src]
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
[src]
fn is_path(&self) -> bool
[src]
fn is_registry(&self) -> bool
[src]
fn is_git(&self) -> bool
[src]
fn load<'a>(&self, config: &'a Config) -> CargoResult<Box<Source + 'a>>
[src]
Creates an implementation of Source
corresponding to this ID.
fn precise(&self) -> Option<&str>
[src]
fn git_reference(&self) -> Option<&GitReference>
[src]
fn with_precise(&self, v: Option<String>) -> SourceId
[src]
fn is_default_registry(&self) -> bool
[src]
fn stable_hash<S: Hasher>(&self, workspace: &Path, into: &mut S)
[src]
Trait Implementations
impl Clone for SourceId
[src]
fn clone(&self) -> SourceId
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
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
[src]
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[src]
This method tests for !=
.
impl PartialOrd for SourceId
[src]
fn partial_cmp(&self, other: &SourceId) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
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[src]
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[src]
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[src]
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
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Serialize for SourceId
[src]
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for SourceId
[src]
fn deserialize<D>(d: D) -> Result<SourceId, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Display for SourceId
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more