Skip to main content

Metadata

Struct Metadata 

Source
pub struct Metadata {
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 keywords: Option<String>, pub home_page: Option<String>, pub download_url: Option<String>, pub author: Option<String>, pub author_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 maintainer: Option<String>, pub maintainer_email: Option<String>, pub requires_python: Option<String>, pub requires_external: Vec<String>, pub project_urls: Vec<String>, pub provides_extras: Vec<String>, pub description_content_type: Option<String>, pub dynamic: Vec<String>,
}
Expand description

Python package metadata

Fields§

§metadata_version: String

Version of the file format; legal values are 1.0, 1.1, 1.2, 2.1 and 2.2.

§name: String

The name of the distribution.

§version: String

A 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.

§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.

§download_url: Option<String>

A string containing the URL from which this version of the distribution can be downloaded.

§author: Option<String>

A string containing the author’s name at a minimum; additional contact information may be provided.

§author_email: Option<String>

A string containing the author’s e-mail address. It can contain a name and e-mail address in the legal forms for a RFC-822 From: header.

§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.

§license_files: Vec<String>

Paths to files containing the text of the licenses covering the distribution.

§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.

§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.

§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_extras: 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.

§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.

§dynamic: Vec<String>

A string containing the name of another core metadata field.

Implementations§

Source§

impl Metadata

Source

pub fn parse(content: &[u8]) -> Result<Self, Error>

Parse distribution metadata from metadata bytes

Trait Implementations§

Source§

impl Clone for Metadata

Source§

fn clone(&self) -> Metadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Metadata

Source§

fn default() -> Metadata

Returns the “default value” for a type. Read more
Source§

impl Eq for Metadata

Source§

impl FromStr for Metadata

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for Metadata

Source§

fn eq(&self, other: &Metadata) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Metadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'src, T> IntoMaybe<'src, T> for T
where T: 'src,

Source§

type Proj<U: 'src> = U

Source§

fn map_maybe<R>( self, _f: impl FnOnce(&'src T) -> &'src R, g: impl FnOnce(T) -> R, ) -> <T as IntoMaybe<'src, T>>::Proj<R>
where R: 'src,

Source§

impl<T> OrderedSeq<'_, T> for T
where T: Clone,

Source§

impl<'p, T> Seq<'p, T> for T
where T: Clone,

Source§

type Item<'a> = &'a T where T: 'a

The item yielded by the iterator.
Source§

type Iter<'a> = Once<&'a T> where T: 'a

An iterator over the items within this container, by reference.
Source§

fn seq_iter(&self) -> <T as Seq<'p, T>>::Iter<'_>

Iterate over the elements of the container.
Source§

fn contains(&self, val: &T) -> bool
where T: PartialEq,

Check whether an item is contained within this sequence.
Source§

fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>
where 'p: 'b,

Convert an item of the sequence into a MaybeRef.
Source§

impl<T, S> SpanWrap<S> for T
where S: WrappingSpan<T>,

Source§

fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned

Invokes WrappingSpan::make_wrapped to wrap an AST node in a span.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.