Struct maturin::Metadata23

source ·
pub struct Metadata23 {
Show 28 fields pub metadata_version: String, pub name: String, pub version: Version, pub platform: Vec<String>, pub supported_platform: 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_files: Vec<PathBuf>, pub classifiers: Vec<String>, pub requires_dist: Vec<Requirement>, pub provides_dist: Vec<String>, pub obsoletes_dist: Vec<String>, pub requires_python: Option<VersionSpecifiers>, pub requires_external: Vec<String>, pub project_url: IndexMap<String, String>, pub provides_extra: Vec<String>, pub scripts: IndexMap<String, String>, pub gui_scripts: IndexMap<String, String>, pub entry_points: IndexMap<String, IndexMap<String, String>>,
}
Expand description

Python Package Metadata 2.3 as specified in https://packaging.python.org/specifications/core-metadata/ Maturin writes static metadata and does not support dynamic fields atm.

Fields§

§metadata_version: String§name: String§version: Version§platform: Vec<String>§supported_platform: Vec<String>§summary: Option<String>§description: Option<String>§description_content_type: Option<String>§keywords: Option<String>§home_page: Option<String>§download_url: Option<String>§author: Option<String>§author_email: Option<String>§maintainer: Option<String>§maintainer_email: Option<String>§license: Option<String>§license_files: Vec<PathBuf>§classifiers: Vec<String>§requires_dist: Vec<Requirement>§provides_dist: Vec<String>§obsoletes_dist: Vec<String>§requires_python: Option<VersionSpecifiers>§requires_external: Vec<String>§project_url: IndexMap<String, String>§provides_extra: Vec<String>§scripts: IndexMap<String, String>§gui_scripts: IndexMap<String, String>§entry_points: IndexMap<String, IndexMap<String, String>>

Implementations§

source§

impl Metadata23

source

pub fn new(name: String, version: Version) -> Self

Initializes with name, version and otherwise the defaults

source§

impl Metadata23

source

pub fn merge_pyproject_toml( &mut self, pyproject_dir: impl AsRef<Path>, pyproject_toml: &PyProjectToml ) -> Result<()>

Merge metadata with pyproject.toml, where pyproject.toml takes precedence

pyproject_dir must be the directory containing pyproject.toml

source

pub fn from_cargo_toml( manifest_path: impl AsRef<Path>, cargo_metadata: &Metadata ) -> Result<Metadata23>

Uses a Cargo.toml to create the metadata for python packages

manifest_path must be the directory, not the file

source

pub fn to_vec(&self) -> Vec<(String, String)>

Formats the metadata into a list where keys with multiple values become multiple single-valued key-value pairs. This format is needed for the pypi uploader and for the METADATA file inside wheels

source

pub fn to_file_contents(&self) -> Result<String>

Writes the format for the metadata file inside wheels

source

pub fn get_distribution_escaped(&self) -> String

Returns the distribution name according to PEP 427, Section “Escaping and Unicode”

source

pub fn get_version_escaped(&self) -> String

Returns the version encoded according to PEP 427, Section “Escaping and Unicode”

source

pub fn get_dist_info_dir(&self) -> PathBuf

Returns the name of the .dist-info directory as defined in the wheel specification

Trait Implementations§

source§

impl Clone for Metadata23

source§

fn clone(&self) -> Metadata23

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Metadata23

source§

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

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

impl<'de> Deserialize<'de> for Metadata23

source§

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 PartialEq for Metadata23

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Metadata23

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Metadata23

source§

impl StructuralPartialEq for Metadata23

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> Chain<T> for T

source§

fn len(&self) -> usize

The number of items that this chain link consists of.
source§

fn append_to(self, v: &mut Vec<T>)

Append the elements in this link to the chain.
source§

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

§

type Iter = Once<T>

An iterator over the items within this container, by value.
source§

fn get_iter(&self) -> <T as Container<T>>::Iter

Iterate over the elements of the container (using internal iteration because GATs are unstable).
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<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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

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