Struct WheelArchive

Source
pub struct WheelArchive { /* private fields */ }
Expand description

Represents a Python wheel archive.

Implementations§

Source§

impl WheelArchive

Source

pub fn from_reader<R>(reader: R, basename: &str) -> Result<Self>
where R: Read + Seek,

Construct an instance from a generic reader.

basename is the filename of the wheel. It is used to try to locate the info directory.

Source

pub fn from_path(path: &Path) -> Result<Self>

Construct an instance from a filesystem path.

Source

pub fn archive_metadata(&self) -> Result<PythonPackageMetadata>

Obtain metadata about the wheel archive itself.

Source

pub fn metadata(&self) -> Result<PythonPackageMetadata>

Obtain the .dist-info/METADATA content as a parsed object.

Source

pub fn archive_metadata_header(&self, header: &str) -> Result<Cow<'_, str>>

Obtain the first header value from the archive metadata file.

Source

pub fn archive_metadata_headers( &self, header: &str, ) -> Result<Vec<Cow<'_, str>>>

Obtain values of all headers from the archive metadata file.

Source

pub fn wheel_version(&self) -> Result<Cow<'_, str>>

Obtain the version number of the wheel specification used to build this wheel.

Source

pub fn wheel_generator(&self) -> Result<Cow<'_, str>>

Obtain the generator of the wheel archive.

Source

pub fn root_is_purelib(&self) -> Result<bool>

Whether Root-Is-Purelib is set.

Source

pub fn tags(&self) -> Result<Vec<Cow<'_, str>>>

Tag values for the wheel archive.

Source

pub fn build(&self) -> Result<Cow<'_, str>>

Build identifier for the wheel archive.

Source

pub fn install_paths_to(&self) -> Result<Vec<Cow<'_, str>>>

Install-Paths-To values.

Source

pub fn dist_info_files(&self) -> Vec<File>

Obtain files in the .dist-info/ directory.

The returned PathBuf are prefixed with the appropriate *.dist-info directory.

Source

pub fn purelib_files(&self) -> Vec<File>

Obtain files that should be installed to purelib.

*.data/purelib/ prefix is stripped from returned PathBuf.

Source

pub fn platlib_files(&self) -> Vec<File>

Obtain files that should be installed to platlib.

*.data/platlib/ prefix is stripped from returned PathBuf.

Source

pub fn headers_files(&self) -> Vec<File>

Obtain files that should be installed to headers.

*.data/headers/ prefix is stripped from returned PathBuf.

Source

pub fn scripts_files(&self) -> Vec<File>

Obtain files that should be installed to scripts.

*.data/scripts/ prefix is stripped from returned PathBuf.

TODO support optional argument to rewrite #!python shebangs.

Source

pub fn data_files(&self) -> Vec<File>

Obtain files that should be installed to data.

*.data/data/ prefix is stripped from returned PathBuf.

Source

pub fn regular_files(&self) -> Vec<File>

Obtain normal files not part of metadata or special files.

These are likely installed as-is.

The returned PathBuf has the same path as the file in the wheel archive.

Source

pub fn python_resources<'a>( &self, cache_tag: &str, suffixes: &PythonModuleSuffixes, emit_files: bool, classify_files: bool, ) -> Result<Vec<PythonResource<'a>>>

Obtain PythonResource for files within the wheel.

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.