pub struct DepSpec {
pub name: String,
pub key: String,
pub url: Option<String>,
/* private fields */
}Fields§
§name: String§key: String§url: Option<String>Implementations§
Source§impl DepSpec
impl DepSpec
Sourcepub fn from_string(input: &str) -> ResultDynError<Self>
pub fn from_string(input: &str) -> ResultDynError<Self>
Given a string as found in a requirements.txt or similar, create a DepSpec.
pub fn validate_version(&self, version: &VersionSpec) -> bool
pub fn validate_package(&self, package: &Package) -> bool
pub fn validate_env_marker(&self, ems: &EnvMarkerState) -> bool
Sourcepub fn get_exact(&self) -> Option<VersionSpec>
pub fn get_exact(&self) -> Option<VersionSpec>
If the DepSpec specifies an exact version, return that VersionSpec. We assume this only applyes to “==” dependencies, not arbitrary equal “===” dependencies
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DepSpec
impl<'de> Deserialize<'de> for DepSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for DepSpec
Auto Trait Implementations§
impl Freeze for DepSpec
impl RefUnwindSafe for DepSpec
impl Send for DepSpec
impl Sync for DepSpec
impl Unpin for DepSpec
impl UnsafeUnpin for DepSpec
impl UnwindSafe for DepSpec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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