pub struct ResolutionMetadata {
pub name: PackageName,
pub version: Version,
pub requires_dist: Box<[Requirement<VerbatimParsedUrl>]>,
pub requires_python: Option<VersionSpecifiers>,
pub provides_extra: Box<[ExtraName]>,
pub dynamic: bool,
}Expand description
A subset of the full core metadata specification, including only the fields that are relevant to dependency resolution.
Core Metadata 2.3 is specified in https://packaging.python.org/specifications/core-metadata/.
Fields§
§name: PackageName§version: Version§requires_dist: Box<[Requirement<VerbatimParsedUrl>]>§requires_python: Option<VersionSpecifiers>§provides_extra: Box<[ExtraName]>§dynamic: boolWhether the version field is dynamic.
Implementations§
Source§impl ResolutionMetadata
impl ResolutionMetadata
Sourcepub fn parse_metadata(content: &[u8]) -> Result<Self, MetadataError>
pub fn parse_metadata(content: &[u8]) -> Result<Self, MetadataError>
Parse the ResolutionMetadata from a METADATA file, as included in a built distribution (wheel).
Sourcepub fn parse_pkg_info(content: &[u8]) -> Result<Self, MetadataError>
pub fn parse_pkg_info(content: &[u8]) -> Result<Self, MetadataError>
Read the ResolutionMetadata from a source distribution’s PKG-INFO file, if it uses Metadata 2.2
or later and none of the required fields (Requires-Python, Requires-Dist, and
Provides-Extra) are marked as dynamic.
Sourcepub fn parse_pyproject_toml(
pyproject_toml: PyProjectToml,
sdist_version: Option<&Version>,
) -> Result<Self, MetadataError>
pub fn parse_pyproject_toml( pyproject_toml: PyProjectToml, sdist_version: Option<&Version>, ) -> Result<Self, MetadataError>
Extract the metadata from a pyproject.toml file, as specified in PEP 621.
If we’re coming from a source distribution, we may already know the version (unlike for a source tree), so we can tolerate dynamic versions.
Trait Implementations§
Source§impl Archive for ResolutionMetadatawhere
PackageName: Archive,
Version: Archive,
Box<[Requirement<VerbatimParsedUrl>]>: Archive,
Option<VersionSpecifiers>: Archive,
Box<[ExtraName]>: Archive,
bool: Archive,
impl Archive for ResolutionMetadatawhere
PackageName: Archive,
Version: Archive,
Box<[Requirement<VerbatimParsedUrl>]>: Archive,
Option<VersionSpecifiers>: Archive,
Box<[ExtraName]>: Archive,
bool: Archive,
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedResolutionMetadata
type Archived = ArchivedResolutionMetadata
Source§impl Clone for ResolutionMetadata
impl Clone for ResolutionMetadata
Source§fn clone(&self) -> ResolutionMetadata
fn clone(&self) -> ResolutionMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolutionMetadata
impl Debug for ResolutionMetadata
Source§impl<'de> Deserialize<'de> for ResolutionMetadata
impl<'de> Deserialize<'de> for ResolutionMetadata
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>,
Source§impl<__D: Fallible + ?Sized> Deserialize<ResolutionMetadata, __D> for Archived<ResolutionMetadata>where
PackageName: Archive,
<PackageName as Archive>::Archived: Deserialize<PackageName, __D>,
Version: Archive,
<Version as Archive>::Archived: Deserialize<Version, __D>,
Box<[Requirement<VerbatimParsedUrl>]>: Archive,
<Box<[Requirement<VerbatimParsedUrl>]> as Archive>::Archived: Deserialize<Box<[Requirement<VerbatimParsedUrl>]>, __D>,
Option<VersionSpecifiers>: Archive,
<Option<VersionSpecifiers> as Archive>::Archived: Deserialize<Option<VersionSpecifiers>, __D>,
Box<[ExtraName]>: Archive,
<Box<[ExtraName]> as Archive>::Archived: Deserialize<Box<[ExtraName]>, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
impl<__D: Fallible + ?Sized> Deserialize<ResolutionMetadata, __D> for Archived<ResolutionMetadata>where
PackageName: Archive,
<PackageName as Archive>::Archived: Deserialize<PackageName, __D>,
Version: Archive,
<Version as Archive>::Archived: Deserialize<Version, __D>,
Box<[Requirement<VerbatimParsedUrl>]>: Archive,
<Box<[Requirement<VerbatimParsedUrl>]> as Archive>::Archived: Deserialize<Box<[Requirement<VerbatimParsedUrl>]>, __D>,
Option<VersionSpecifiers>: Archive,
<Option<VersionSpecifiers> as Archive>::Archived: Deserialize<Option<VersionSpecifiers>, __D>,
Box<[ExtraName]>: Archive,
<Box<[ExtraName]> as Archive>::Archived: Deserialize<Box<[ExtraName]>, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<ResolutionMetadata, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<ResolutionMetadata, <__D as Fallible>::Error>
Source§impl<__S: Fallible + ?Sized> Serialize<__S> for ResolutionMetadatawhere
PackageName: Serialize<__S>,
Version: Serialize<__S>,
Box<[Requirement<VerbatimParsedUrl>]>: Serialize<__S>,
Option<VersionSpecifiers>: Serialize<__S>,
Box<[ExtraName]>: Serialize<__S>,
bool: Serialize<__S>,
impl<__S: Fallible + ?Sized> Serialize<__S> for ResolutionMetadatawhere
PackageName: Serialize<__S>,
Version: Serialize<__S>,
Box<[Requirement<VerbatimParsedUrl>]>: Serialize<__S>,
Option<VersionSpecifiers>: Serialize<__S>,
Box<[ExtraName]>: Serialize<__S>,
bool: Serialize<__S>,
Auto Trait Implementations§
impl Freeze for ResolutionMetadata
impl RefUnwindSafe for ResolutionMetadata
impl Send for ResolutionMetadata
impl Sync for ResolutionMetadata
impl Unpin for ResolutionMetadata
impl UnwindSafe for ResolutionMetadata
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.