Enum python_packaging::resource::PythonResource[][src]

pub enum PythonResource<'a> {
    ModuleSource(Cow<'a, PythonModuleSource>),
    ModuleBytecodeRequest(Cow<'a, PythonModuleBytecodeFromSource>),
    ModuleBytecode(Cow<'a, PythonModuleBytecode>),
    PackageResource(Cow<'a, PythonPackageResource>),
    PackageDistributionResource(Cow<'a, PythonPackageDistributionResource>),
    ExtensionModule(Cow<'a, PythonExtensionModule>),
    EggFile(Cow<'a, PythonEggFile>),
    PathExtension(Cow<'a, PythonPathExtension>),
    File(Cow<'a, File>),
}

Represents a resource that can be read by Python somehow.

Variants

ModuleSource(Cow<'a, PythonModuleSource>)

A module defined by source code.

ModuleBytecodeRequest(Cow<'a, PythonModuleBytecodeFromSource>)

A module defined by a request to generate bytecode from source.

ModuleBytecode(Cow<'a, PythonModuleBytecode>)

A module defined by existing bytecode.

PackageResource(Cow<'a, PythonPackageResource>)

A non-module resource file.

PackageDistributionResource(Cow<'a, PythonPackageDistributionResource>)

A file in a Python package distribution metadata collection.

ExtensionModule(Cow<'a, PythonExtensionModule>)

An extension module.

EggFile(Cow<'a, PythonEggFile>)

A self-contained Python egg.

PathExtension(Cow<'a, PythonPathExtension>)

A path extension.

File(Cow<'a, File>)

An arbitrary file and its data.

Implementations

impl<'a> PythonResource<'a>[src]

pub fn full_name(&self) -> String[src]

Resolves the fully qualified resource name.

pub fn is_in_packages(&self, packages: &[String]) -> bool[src]

pub fn to_memory(&self) -> Result<Self>[src]

Create a new instance that is guaranteed to be backed by memory.

Trait Implementations

impl<'a> Clone for PythonResource<'a>[src]

fn clone(&self) -> PythonResource<'a>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for PythonResource<'a>[src]

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

Formats the value using the given formatter. Read more

impl<'a> From<&'a File> for PythonResource<'a>[src]

fn from(f: &'a File) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonEggFile> for PythonResource<'a>[src]

fn from(e: &'a PythonEggFile) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonExtensionModule> for PythonResource<'a>[src]

fn from(r: &'a PythonExtensionModule) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonModuleBytecode> for PythonResource<'a>[src]

fn from(m: &'a PythonModuleBytecode) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonModuleBytecodeFromSource> for PythonResource<'a>[src]

fn from(m: &'a PythonModuleBytecodeFromSource) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonModuleSource> for PythonResource<'a>[src]

fn from(m: &'a PythonModuleSource) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonPackageDistributionResource> for PythonResource<'a>[src]

fn from(r: &'a PythonPackageDistributionResource) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonPackageResource> for PythonResource<'a>[src]

fn from(r: &'a PythonPackageResource) -> Self[src]

Performs the conversion.

impl<'a> From<&'a PythonPathExtension> for PythonResource<'a>[src]

fn from(e: &'a PythonPathExtension) -> Self[src]

Performs the conversion.

impl<'a> From<File> for PythonResource<'a>[src]

fn from(f: File) -> Self[src]

Performs the conversion.

impl<'a> From<PythonEggFile> for PythonResource<'a>[src]

fn from(e: PythonEggFile) -> Self[src]

Performs the conversion.

impl<'a> From<PythonExtensionModule> for PythonResource<'a>[src]

fn from(r: PythonExtensionModule) -> Self[src]

Performs the conversion.

impl<'a> From<PythonModuleBytecode> for PythonResource<'a>[src]

fn from(m: PythonModuleBytecode) -> Self[src]

Performs the conversion.

impl<'a> From<PythonModuleBytecodeFromSource> for PythonResource<'a>[src]

fn from(m: PythonModuleBytecodeFromSource) -> Self[src]

Performs the conversion.

impl<'a> From<PythonModuleSource> for PythonResource<'a>[src]

fn from(m: PythonModuleSource) -> Self[src]

Performs the conversion.

impl<'a> From<PythonPackageDistributionResource> for PythonResource<'a>[src]

fn from(r: PythonPackageDistributionResource) -> Self[src]

Performs the conversion.

impl<'a> From<PythonPackageResource> for PythonResource<'a>[src]

fn from(r: PythonPackageResource) -> Self[src]

Performs the conversion.

impl<'a> From<PythonPathExtension> for PythonResource<'a>[src]

fn from(e: PythonPathExtension) -> Self[src]

Performs the conversion.

impl<'a> PartialEq<PythonResource<'a>> for PythonResource<'a>[src]

fn eq(&self, other: &PythonResource<'a>) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &PythonResource<'a>) -> bool[src]

This method tests for !=.

impl<'a> StructuralPartialEq for PythonResource<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for PythonResource<'a>

impl<'a> Send for PythonResource<'a>

impl<'a> Sync for PythonResource<'a>

impl<'a> Unpin for PythonResource<'a>

impl<'a> UnwindSafe for PythonResource<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.