Struct python_packaging::resource::PythonPackageResource
source · [−]pub struct PythonPackageResource {
pub leaf_package: String,
pub relative_name: String,
pub data: FileData,
pub is_stdlib: bool,
pub is_test: bool,
}
Expand description
Python package resource data, agnostic of storage location.
Fields
leaf_package: String
The leaf-most Python package this resource belongs to.
relative_name: String
The relative path within leaf_package
to this resource.
data: FileData
Location of resource data.
is_stdlib: bool
Whether this resource belongs to the Python standard library.
Modules with this set are distributed as part of Python itself.
is_test: bool
Whether this resource belongs to a package that is a test.
Implementations
sourceimpl PythonPackageResource
impl PythonPackageResource
pub fn description(&self) -> String
pub fn to_memory(&self) -> Result<Self>
pub fn symbolic_name(&self) -> String
sourcepub fn resolve_path(&self, prefix: &str) -> PathBuf
pub fn resolve_path(&self, prefix: &str) -> PathBuf
Resolve filesystem path to this bytecode.
Trait Implementations
sourceimpl Clone for PythonPackageResource
impl Clone for PythonPackageResource
sourcefn clone(&self) -> PythonPackageResource
fn clone(&self) -> PythonPackageResource
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PythonPackageResource
impl Debug for PythonPackageResource
sourceimpl<'a> From<&'a PythonPackageResource> for PythonResource<'a>
impl<'a> From<&'a PythonPackageResource> for PythonResource<'a>
sourcefn from(r: &'a PythonPackageResource) -> Self
fn from(r: &'a PythonPackageResource) -> Self
Performs the conversion.
sourceimpl<'a> From<PythonPackageResource> for PythonResource<'a>
impl<'a> From<PythonPackageResource> for PythonResource<'a>
sourcefn from(r: PythonPackageResource) -> Self
fn from(r: PythonPackageResource) -> Self
Performs the conversion.
sourceimpl PartialEq<PythonPackageResource> for PythonPackageResource
impl PartialEq<PythonPackageResource> for PythonPackageResource
sourcefn eq(&self, other: &PythonPackageResource) -> bool
fn eq(&self, other: &PythonPackageResource) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PythonPackageResource) -> bool
fn ne(&self, other: &PythonPackageResource) -> bool
This method tests for !=
.
impl StructuralPartialEq for PythonPackageResource
Auto Trait Implementations
impl RefUnwindSafe for PythonPackageResource
impl Send for PythonPackageResource
impl Sync for PythonPackageResource
impl Unpin for PythonPackageResource
impl UnwindSafe for PythonPackageResource
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more