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.

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 PartialEq for SourceId

fn eq(&self, other: &SourceId) -> bool

fn ne(&self, other: &Rhs) -> bool

impl PartialOrd for SourceId

fn partial_cmp(&self, other: &SourceId) -> Option<Ordering>

fn lt(&self, other: &Rhs) -> bool

fn le(&self, other: &Rhs) -> bool

fn gt(&self, other: &Rhs) -> bool

fn ge(&self, other: &Rhs) -> bool

impl Ord for SourceId

fn cmp(&self, other: &SourceId) -> Ordering

impl Encodable for SourceId

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error>

impl Decodable for SourceId

fn decode<D: Decoder>(d: &mut D) -> Result<SourceId, D::Error>

impl Display for SourceId

fn fmt(&self, f: &mut Formatter) -> Result

impl Hash for SourceId

fn hash<S: Hasher>(&self, into: &mut S)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

Derived Implementations

impl Debug for SourceId

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Eq for SourceId

impl Clone for SourceId

fn clone(&self) -> SourceId

fn clone_from(&mut self, source: &Self)