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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CrateSpec
impl RefUnwindSafe for CrateSpec
impl Send for CrateSpec
impl Sync for CrateSpec
impl Unpin for CrateSpec
impl UnwindSafe for CrateSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more