pub struct Version {
pub epoch: u32,
pub release: Vec<u32>,
pub pre: Option<PreRelease>,
pub post: Option<u32>,
pub dev: Option<u32>,
pub local: Option<String>,
}Expand description
A PEP 440 compliant version
Fields§
§epoch: u32Epoch (optional, defaults to 0)
release: Vec<u32>Release segment (major.minor.patch…)
pre: Option<PreRelease>Pre-release (alpha, beta, rc)
post: Option<u32>Post-release
dev: Option<u32>Development release
local: Option<String>Local version segment
Implementations§
Trait Implementations§
Source§impl DependencyProvider<Package, Version> for PyPIProvider
impl DependencyProvider<Package, Version> for PyPIProvider
Source§fn choose_package_version<T: Borrow<Package>, U: Borrow<Range<Version>>>(
&self,
potential_packages: impl Iterator<Item = (T, U)>,
) -> Result<(T, Option<Version>), Box<dyn StdError>>
fn choose_package_version<T: Borrow<Package>, U: Borrow<Range<Version>>>( &self, potential_packages: impl Iterator<Item = (T, U)>, ) -> Result<(T, Option<Version>), Box<dyn StdError>>
Decision making
is the process of choosing the next package
and version that will be appended to the partial solution.
Every time such a decision must be made,
potential valid packages and version ranges are preselected by the resolver,
and the dependency provider must choose. Read more
Source§fn get_dependencies(
&self,
package: &Package,
version: &Version,
) -> Result<Dependencies<Package, Version>, Box<dyn StdError>>
fn get_dependencies( &self, package: &Package, version: &Version, ) -> Result<Dependencies<Package, Version>, Box<dyn StdError>>
Retrieves the package dependencies.
Return Dependencies::Unknown if its dependencies are unknown.
Source§fn should_cancel(&self) -> Result<(), Box<dyn Error>>
fn should_cancel(&self) -> Result<(), Box<dyn Error>>
This is called fairly regularly during the resolution,
if it returns an Err then resolution will be terminated.
This is helpful if you want to add some form of early termination like a timeout,
or you want to add some form of user feedback if things are taking a while.
If not provided the resolver will run as long as needed.
Source§impl<'de> Deserialize<'de> for Version
impl<'de> Deserialize<'de> for Version
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
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.