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

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, FileData>),
}

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

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]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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]

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.