pub struct Metadata23 {Show 27 fields
pub metadata_version: String,
pub name: String,
pub version: String,
pub platforms: Vec<String>,
pub supported_platforms: Vec<String>,
pub summary: Option<String>,
pub description: Option<String>,
pub description_content_type: Option<String>,
pub keywords: Option<String>,
pub home_page: Option<String>,
pub download_url: Option<String>,
pub author: Option<String>,
pub author_email: Option<String>,
pub maintainer: Option<String>,
pub maintainer_email: Option<String>,
pub license: Option<String>,
pub license_expression: Option<String>,
pub license_files: Vec<String>,
pub classifiers: Vec<String>,
pub requires_dist: Vec<String>,
pub provides_dist: Vec<String>,
pub obsoletes_dist: Vec<String>,
pub requires_python: Option<String>,
pub requires_external: Vec<String>,
pub project_urls: Vec<String>,
pub provides_extra: Vec<String>,
pub dynamic: Vec<String>,
}Expand description
Code Metadata 2.3 as specified in https://packaging.python.org/specifications/core-metadata/.
Fields§
§metadata_version: StringVersion of the file format; legal values are 1.0, 1.1, 1.2, 2.1, 2.2, 2.3 and
2.4.
name: StringThe name of the distribution.
version: StringA string containing the distribution’s version number.
platforms: Vec<String>A Platform specification describing an operating system supported by the distribution which is not listed in the “Operating System” Trove classifiers.
supported_platforms: Vec<String>Binary distributions containing a PKG-INFO file will use the Supported-Platform field in their metadata to specify the OS and CPU for which the binary distribution was compiled.
summary: Option<String>A one-line summary of what the distribution does.
description: Option<String>A longer description of the distribution that can run to several paragraphs.
description_content_type: Option<String>A string stating the markup syntax (if any) used in the distribution’s description, so that tools can intelligently render the description.
Known values: text/plain, text/markdown and text/x-rst.
keywords: Option<String>A list of additional keywords, separated by commas, to be used to assist searching for the distribution in a larger catalog.
home_page: Option<String>A string containing the URL for the distribution’s home page.
Deprecated by PEP 753.
download_url: Option<String>A string containing the URL from which this version of the distribution can be downloaded.
Deprecated by PEP 753.
A string containing the author’s name at a minimum; additional contact information may be provided.
A string containing the author’s e-mail address. It can contain a name and e-mail address in
the legal forms for an RFC-822 From: header.
maintainer: Option<String>A string containing the maintainer’s name at a minimum; additional contact information may be provided.
Note that this field is intended for use when a project is being maintained by someone other
than the original author:
it should be omitted if it is identical to author.
maintainer_email: Option<String>A string containing the maintainer’s e-mail address.
It can contain a name and e-mail address in the legal forms for a RFC-822 From: header.
Note that this field is intended for use when a project is being maintained by someone other
than the original author: it should be omitted if it is identical to author_email.
license: Option<String>Text indicating the license covering the distribution where the license is not a selection
from the License Trove classifiers or an SPDX license expression.
license_expression: Option<String>An SPDX expression indicating the license covering the distribution.
Introduced by PEP 639, requires metadata version 2.4.
license_files: Vec<String>Paths to files containing the text of the licenses covering the distribution.
Introduced by PEP 639, requires metadata version 2.4.
classifiers: Vec<String>Each entry is a string giving a single classification value for the distribution.
requires_dist: Vec<String>Each entry contains a string naming some other distutils project required by this distribution.
provides_dist: Vec<String>Each entry contains a string naming a Distutils project which is contained within this distribution.
obsoletes_dist: Vec<String>Each entry contains a string describing a distutils project’s distribution which this distribution renders obsolete, meaning that the two projects should not be installed at the same time.
requires_python: Option<String>This field specifies the Python version(s) that the distribution is guaranteed to be compatible with.
requires_external: Vec<String>Each entry contains a string describing some dependency in the system that the distribution is to be used.
project_urls: Vec<String>A string containing a browsable URL for the project and a label for it, separated by a comma.
provides_extra: Vec<String>A string containing the name of an optional feature. Must be a valid Python identifier. May be used to make a dependency conditional on whether the optional feature has been requested.
dynamic: Vec<String>A string containing the name of another core metadata field.
Implementations§
Source§impl Metadata23
impl Metadata23
Sourcepub fn parse(content: &[u8]) -> Result<Self, MetadataError>
pub fn parse(content: &[u8]) -> Result<Self, MetadataError>
Parse distribution metadata from metadata MetadataError
Sourcepub fn core_metadata_format(&self) -> String
pub fn core_metadata_format(&self) -> String
Convert to the pseudo-email format used by Python’s METADATA.
The standard file format for metadata (including in wheels and installed projects) is based on the format of email headers. However, email formats have been revised several times, and exactly which email RFC applies to packaging metadata is not specified. In the absence of a precise definition, the practical standard is set by what the standard library
email.parsermodule can parse using thecompat32policy.
§Example
Metadata-Version: 2.3
Name: hello-world
Version: 0.1.0
License: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A [...]Trait Implementations§
Source§impl Clone for Metadata23
impl Clone for Metadata23
Source§fn clone(&self) -> Metadata23
fn clone(&self) -> Metadata23
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Metadata23
impl Debug for Metadata23
Source§impl Default for Metadata23
impl Default for Metadata23
Source§fn default() -> Metadata23
fn default() -> Metadata23
Source§impl FromStr for Metadata23
impl FromStr for Metadata23
Source§impl PartialEq for Metadata23
impl PartialEq for Metadata23
impl Eq for Metadata23
impl StructuralPartialEq for Metadata23
Auto Trait Implementations§
impl Freeze for Metadata23
impl RefUnwindSafe for Metadata23
impl Send for Metadata23
impl Sync for Metadata23
impl Unpin for Metadata23
impl UnwindSafe for Metadata23
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> 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<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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.