Enum cargo_edit_9::CrateSpec
source · pub enum CrateSpec {
PkgId {
name: String,
version_req: Option<String>,
},
Path(PathBuf),
}
Expand description
User-specified crate
This can be a
- Name (e.g.
docopt
) - Name and a version req (e.g.
docopt@^0.8
) - Path
Variants§
Implementations§
source§impl CrateSpec
impl CrateSpec
sourcepub fn resolve(pkg_id: &str) -> CargoResult<Self>
pub fn resolve(pkg_id: &str) -> CargoResult<Self>
Convert a string to a Crate
sourcepub fn has_version(&self) -> bool
pub fn has_version(&self) -> bool
Whether the version req is known or not
sourcepub fn to_dependency(&self) -> CargoResult<Dependency>
pub fn to_dependency(&self) -> CargoResult<Dependency>
Generate a dependency entry for this crate specifier