pub struct WheelArchive { /* private fields */ }
Expand description
Represents a Python wheel archive.
Implementations§
Source§impl WheelArchive
impl WheelArchive
Sourcepub fn from_reader<R>(reader: R, basename: &str) -> Result<Self>
pub fn from_reader<R>(reader: R, basename: &str) -> Result<Self>
Construct an instance from a generic reader.
basename
is the filename of the wheel. It is used to try to
locate the info directory.
Sourcepub fn archive_metadata(&self) -> Result<PythonPackageMetadata>
pub fn archive_metadata(&self) -> Result<PythonPackageMetadata>
Obtain metadata about the wheel archive itself.
Sourcepub fn metadata(&self) -> Result<PythonPackageMetadata>
pub fn metadata(&self) -> Result<PythonPackageMetadata>
Obtain the .dist-info/METADATA
content as a parsed object.
Sourcepub fn archive_metadata_header(&self, header: &str) -> Result<Cow<'_, str>>
pub fn archive_metadata_header(&self, header: &str) -> Result<Cow<'_, str>>
Obtain the first header value from the archive metadata file.
Sourcepub fn archive_metadata_headers(
&self,
header: &str,
) -> Result<Vec<Cow<'_, str>>>
pub fn archive_metadata_headers( &self, header: &str, ) -> Result<Vec<Cow<'_, str>>>
Obtain values of all headers from the archive metadata file.
Sourcepub fn wheel_version(&self) -> Result<Cow<'_, str>>
pub fn wheel_version(&self) -> Result<Cow<'_, str>>
Obtain the version number of the wheel specification used to build this wheel.
Sourcepub fn wheel_generator(&self) -> Result<Cow<'_, str>>
pub fn wheel_generator(&self) -> Result<Cow<'_, str>>
Obtain the generator of the wheel archive.
Sourcepub fn root_is_purelib(&self) -> Result<bool>
pub fn root_is_purelib(&self) -> Result<bool>
Whether Root-Is-Purelib
is set.
Tag
values for the wheel archive.
Sourcepub fn dist_info_files(&self) -> Vec<File>
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.
Sourcepub fn purelib_files(&self) -> Vec<File>
pub fn purelib_files(&self) -> Vec<File>
Obtain files that should be installed to purelib
.
*.data/purelib/
prefix is stripped from returned PathBuf
.
Sourcepub fn platlib_files(&self) -> Vec<File>
pub fn platlib_files(&self) -> Vec<File>
Obtain files that should be installed to platlib
.
*.data/platlib/
prefix is stripped from returned PathBuf
.
Sourcepub fn headers_files(&self) -> Vec<File>
pub fn headers_files(&self) -> Vec<File>
Obtain files that should be installed to headers
.
*.data/headers/
prefix is stripped from returned PathBuf
.
Sourcepub fn scripts_files(&self) -> Vec<File>
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.
Sourcepub fn data_files(&self) -> Vec<File>
pub fn data_files(&self) -> Vec<File>
Obtain files that should be installed to data
.
*.data/data/
prefix is stripped from returned PathBuf
.
Sourcepub fn regular_files(&self) -> Vec<File>
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.
Sourcepub fn python_resources<'a>(
&self,
cache_tag: &str,
suffixes: &PythonModuleSuffixes,
emit_files: bool,
classify_files: bool,
) -> Result<Vec<PythonResource<'a>>>
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§
impl Freeze for WheelArchive
impl RefUnwindSafe for WheelArchive
impl Send for WheelArchive
impl Sync for WheelArchive
impl Unpin for WheelArchive
impl UnwindSafe for WheelArchive
Blanket Implementations§
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> 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 more